WebSocket endpoint
Connect to the following endpoint over a standard WebSocket (WSS) connection:Authentication
Unlike the REST API, where the JWT goes in an HTTP header, the WebSocket feed accepts your JWT inside the subscribe message you send after the connection is established. Include the token in thejwt field of every subscribe request. Your JWT must be signed with the same credentials as your REST API calls.
JWT tokens are short-lived. If your application maintains a long-running WebSocket connection, generate a fresh token and send a new subscribe message before the current token expires — typically within 2 minutes. The server will reject messages signed with an expired token.
Available channels
Connect and subscribe
After opening a WebSocket connection, send a JSON subscribe message to start receiving events. You can subscribe to multiple product IDs and one channel per message, or send multiple subscribe messages for different channels.Subscribe message format
"type": "unsubscribe".
Ticker channel
Theticker channel sends a message whenever the best bid, best ask, or last price changes for a subscribed product. Each message contains a channel field and an events array.
Example ticker message:
Level2 order book channel
Thelevel2 channel provides full-depth order book updates as incremental diffs. On first subscribe, you receive a snapshot event containing the current state of the book; subsequent messages are update events with only the changed price levels.
Subscribe to the order book:
new_quantity of "0.000" means the price level has been removed from the book. Apply each update to your local book in sequence_num order to maintain an accurate view of available liquidity.
User channel for order tracking
Theuser channel streams real-time status changes for your own orders — fills, cancellations, acknowledgements, and rejections. This lets you react to order events without polling GET /api/v3/brokerage/orders/historical/batch.
Subscribe to user updates:
Full Python subscribe and receive loop
The following example shows a production-ready pattern that subscribes to both theticker and heartbeats channels and handles disconnections gracefully with an exponential backoff reconnect loop.
Python