Call Market WebSocket
Hosted Market WebSocket is the public live-delivery path for market
subscriptions. Connect once, pass Authorization: Bearer {api_key}, then send
one subscribe frame for the market target you need.
Market WebSocket is the product-level stream surface. Use it for market events, not for native chain subscriptions.
Access
{MARKET_WSS_URL}Authorization: Bearer {API_KEY}subscribeHow to call Market WebSocket
Prepare the API key
Create the API key first if needed. Browser clients can place it in the websocket URL query; server-side clients can send it as a bearer header.
Connect once
Open one websocket connection to the hosted market endpoint with one supported auth form.
Start with one price target
Confirm the first MARKET_PRICE event before widening into OHLCV or more
target sets.
Connection flow
Browser
const socket = new WebSocket("{MARKET_WSS_URL}?api_key={api_key}");Look for SESSION_READY followed by MARKET_PRICE or
MARKET_SHORT_RANGE_OHLCV.
Failure contract
If auth or rate limits reject the WebSocket upgrade, the HTTP rejection keeps
both X-Trace-ID and X-Request-ID headers and returns a structured JSON body
before the socket is established.
{
"error": {
"code": "AUTH_REQUIRED",
"message": "workspace identity is required",
"trace_id": "trace_123",
"request_id": "req_456",
"retryable": false,
"source_status": "unknown"
}
}Related pages
- Get API Key: prepare the API key before opening the socket.
- Market WebSocket: browse the product-level websocket reference tree.
- Price streams: open the exact event
shape for
MARKET_PRICE.