Market Streams
Real-time public market data over WebSocket.
Market streams push live data as it happens, so you never poll for prices. Connect to a single stream, or combine many on one connection.
Connecting
Available streams
| Stream | Pushes |
|---|---|
| <symbol>@ticker | Rolling 24h ticker, once per second |
| <symbol>@trade | Each executed trade in real time |
| <symbol>@depth | Order-book changes (diff updates) |
| <symbol>@kline_<interval> | Candlestick updates for the interval |
Stream names use the lowercase symbol. For example, live trades for BTCUSDT:
Keeping a depth cache in sync
For a local order book: take a REST depth snapshot, then apply diff updates from the stream whose update id follows the snapshot's lastUpdateId. If you ever see a gap in update ids, discard the book and take a fresh snapshot.