Public market data streams¶
Required Type: — (no API key)
Symbol names in channel strings are case-insensitive.
Aggregate trade¶
Stream: <symbol>@aggTrade
{
"e": "aggTrade",
"E": 1672515782136,
"s": "BTCUSDT",
"a": 5933014,
"p": "0.001",
"q": "100",
"f": 100,
"l": 105,
"T": 1672515782136,
"m": true
}
| Field | Type | Description |
|---|---|---|
e |
string | Event type: aggTrade |
E |
number | Event time (ms) |
s |
string | Symbol |
a |
number | Aggregate trade id |
p |
string | Price |
q |
string | Quantity |
f |
number | First trade id |
l |
number | Last trade id |
T |
number | Trade time (ms) |
m |
boolean | Is the buyer the market maker? |
Trade¶
Stream: <symbol>@trade
{
"e": "trade",
"E": 1672515782136,
"s": "BTCUSDT",
"t": 12345,
"p": "0.001",
"q": "100",
"b": 88,
"a": 50,
"T": 1672515782136,
"m": true
}
| Field | Type | Description |
|---|---|---|
e |
string | Event type: trade |
E |
number | Event time (ms) |
s |
string | Symbol |
t |
number | Trade id |
p |
string | Price |
q |
string | Quantity |
b |
number | Buyer order id |
a |
number | Seller order id |
T |
number | Trade time (ms) |
m |
boolean | Is the buyer the market maker? |
Kline¶
Stream: <symbol>@kline_<interval>
Intervals: 1m, 3m, 5m, 15m, 30m, 1h, 2h, 4h, 6h, 8h, 12h, 1d, 3d, 1w, 1M.
Open candles are pushed periodically; a closed candle is pushed immediately when the interval ends.
{
"e": "kline",
"E": 1672515782136,
"s": "BTCUSDT",
"k": {
"t": 1672515780000,
"T": 1672515839999,
"s": "BTCUSDT",
"i": "1m",
"f": 100,
"L": 200,
"o": "0.0010",
"c": "0.0020",
"h": "0.0025",
"l": "0.0015",
"v": "1000",
"n": 100,
"x": false,
"q": "1.0000",
"V": "500",
"Q": "0.500"
}
}
| Field | Type | Description |
|---|---|---|
e |
string | Event type: kline |
E |
number | Event time (ms) |
s |
string | Symbol |
k |
object | Candlestick payload |
k.t |
number | Kline open time (ms) |
k.T |
number | Kline close time (ms) |
k.s |
string | Symbol |
k.i |
string | Interval |
k.f |
number | First trade ID in this kline |
k.L |
number | Last trade ID in this kline |
k.o |
string | Open price |
k.c |
string | Close price |
k.h |
string | High price |
k.l |
string | Low price |
k.v |
string | Base asset volume |
k.n |
number | Number of trades |
k.x |
boolean | Whether this kline is closed |
k.q |
string | Quote asset volume |
k.V |
string | Taker buy base asset volume |
k.Q |
string | Taker buy quote asset volume |
Tickers¶
| Stream | Description |
|---|---|
<symbol>@miniTicker |
Compact ticker (last price / open / high / low / volume) without full 24h statistics |
!miniTicker@arr |
All-market mini tickers as an array |
<symbol>@ticker |
Full 24hr ticker (includes OHLC, volume, trade count, and related fields) |
!ticker@arr |
All-market full tickers as an array |
<symbol>@bookTicker |
Best bid/ask price and quantity |
!bookTicker |
All book tickers |
Depth¶
| Stream | Description |
|---|---|
<symbol>@depth<levels> or @depth<levels>@100ms |
Partial depth — top-N snapshot per push (levels e.g. 5/10/20). Optional @100ms sets push cadence. |
<symbol>@depth or @depth@100ms |
Diff depth — incremental book updates. Optional @100ms sets push cadence. |
Local book sync¶
Terms:
| Field | Meaning |
|---|---|
U |
First update id in this diff event |
u |
Final update id in this diff event |
lastUpdateId |
Snapshot cursor from REST depth |
Example diff event:
{
"e": "depthUpdate",
"E": 1672515782136,
"s": "BTCUSDT",
"U": 157,
"u": 160,
"b": [["0.0024", "10"]],
"a": [["0.0026", "100"]]
}
- Subscribe to
<symbol>@depth. - REST snapshot:
GET /openapi/quote/v1/depth?symbol=<SYMBOL>. - Drop events with
u≤ snapshotlastUpdateId. - Apply diffs; quantity
"0"removes a level. - Ensure each event
Uequals previousu + 1, else re-snapshot.