Skip to Content
Getting StartedUse Market WebSocket

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

Endpoint variable
{MARKET_WSS_URL}
Auth header
Authorization: Bearer {API_KEY}
First action
subscribe

How 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

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" } }
Last updated on