Skip to main content
The Coinbase Advanced Trade WebSocket feed lets your application receive live market events the moment they occur — no polling, no repeated HTTP calls, and no unnecessary latency. Once you establish a connection and subscribe to one or more channels, the server pushes updates to you in real time, whether that is a new trade execution, an order book change, or a status update on one of your own orders. This guide walks you through connecting, authenticating, subscribing to channels, and handling the messages you receive.

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 the jwt 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

To unsubscribe, send the same message with "type": "unsubscribe".

Ticker channel

The ticker 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

The level2 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:
Example level2 update message:
A 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

The user 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:
Example user order update:

Full Python subscribe and receive loop

The following example shows a production-ready pattern that subscribes to both the ticker and heartbeats channels and handles disconnections gracefully with an exponential backoff reconnect loop.
Python
Coinbase enforces per-IP and per-account connection limits on the WebSocket feed. Exceeding these limits will cause new connections to be rejected. Keep the number of simultaneous connections to a minimum — prefer subscribing to multiple product IDs within a single connection rather than opening one connection per product. Always implement reconnect logic with exponential backoff so that transient disconnections do not result in a flood of reconnection attempts.