Real-time price WebSocket
curl --request GET \
--url https://api.rach.finance/v1/market/wsimport requests
url = "https://api.rach.finance/v1/market/ws"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.rach.finance/v1/market/ws', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.rach.finance/v1/market/ws",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.rach.finance/v1/market/ws"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.rach.finance/v1/market/ws")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.rach.finance/v1/market/ws")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_bodyMarket Data
Real-time price WebSocket
Upgrade to a WebSocket connection for real-time coin price ticks.
Auth: Pass your API key as ?key=<api-key> in the query string
(browser WebSocket clients cannot set arbitrary headers).
Client → server messages:
{ "op": "subscribe", "symbols": ["btc", "eth"] }
{ "op": "subscribe", "symbols": ["*"] }
{ "op": "ping" }
Server → client messages:
{ "op": "snapshot", "as_of": 1751584800, "coins": [ ...CoinMarket objects... ] }
{ "op": "tick", "as_of": 1751585100, "changes": [
{ "symbol": "btc", "price": 62800.00, "pct_24h": 2.5, "direction": "raise" },
{ "symbol": "eth", "price": 1740.00, "pct_24h": -0.8, "direction": "fall" }
]}
{ "op": "pong" }
Limits: 10 concurrent connections per merchant. Slow consumers have individual ticks dropped (they are not disconnected).
GET
/
v1
/
market
/
ws
Real-time price WebSocket
curl --request GET \
--url https://api.rach.finance/v1/market/wsimport requests
url = "https://api.rach.finance/v1/market/ws"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.rach.finance/v1/market/ws', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.rach.finance/v1/market/ws",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.rach.finance/v1/market/ws"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.rach.finance/v1/market/ws")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.rach.finance/v1/market/ws")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_bodyQuery Parameters
WaaS API key (live_sk_... or test_sk_...)
Response
WebSocket connection established

