Depth Channel
Get the order book depth data
Supported Channels
| Channel | Description |
|---|---|
| books | Full orderbook with checksum |
| books1 | Top 1 level orderbook |
| books5 | Top 5 levels orderbook |
| books15 | Top 15 levels orderbook |
Note:
bookschannel sends snapshot first, then incremental updates. Other channels (books1,books5,books15) always send snapshots.
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| op | string | Yes | Operation, subscribe unsubscribe |
| args | list | Yes | List of channels to request subscription |
| > instType | string | Yes | Product type: SPOT |
| > channel | string | Yes | Channel name (books, books1, books5, books15) |
| > instId | string | Yes | Product ID E.g. BTCUSDT |
Request Example
{
"op": "subscribe",
"args": [
{
"instType": "SPOT",
"channel": "books5",
"instId": "BTCUSDT"
}
]
}
Response Example
{
"event": "subscribe",
"arg": {
"instType": "SPOT",
"channel": "books5",
"instId": "BTCUSDT"
}
}
Push Parameters
| Parameter | Type | Description |
|---|---|---|
| action | string | Push data action: snapshot / update |
| arg | object | Channels with successful subscription |
| > instType | string | Product type: SPOT |
| > channel | string | Channel name |
| > instId | string | Product ID E.g. BTCUSDT |
| data | list | Orderbook data |
| > asks | list | Ask orders [price, size] |
| > bids | list | Bid orders [price, size] |
| > checksum | number | Checksum (only for books channel) |
| > seq | number | Sequence number |
| > ts | string | Timestamp |
| ts | number | Push timestamp |
Push Data
{
"action": "snapshot",
"arg": {
"instType": "SPOT",
"channel": "books5",
"instId": "BTCUSDT"
},
"data": [
{
"asks": [
["27001.0", "0.5"],
["27002.0", "1.2"],
["27003.0", "0.8"],
["27004.0", "2.1"],
["27005.0", "0.3"]
],
"bids": [
["27000.0", "0.7"],
["26999.0", "1.5"],
["26998.0", "0.9"],
["26997.0", "2.3"],
["26996.0", "0.6"]
],
"checksum": 0,
"seq": 1695716760566,
"ts": "1695716760565"
}
],
"ts": 1695716761589
}