Depth Channel
Get the order book depth data
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 |
| > channel | string | Yes | Channel name (books1 ~ books20) |
| > instId | string | Yes | Product ID E.g. BTCUSDT |
Note: The channel name determines the depth size. Use
books1tobooks20where the number indicates the depth level (1-20).
Request Example
{
"op": "subscribe",
"args": [
{
"instType": "USDT-FUTURES",
"channel": "books5",
"instId": "BTCUSDT"
}
]
}
Response Parameters
| Parameter | Type | Description |
|---|---|---|
| event | string | Event |
| arg | object | Subscribed channels |
| > instType | string | Product type |
| > channel | string | Channel name |
| > instId | string | Product ID E.g. BTCUSDT |
| code | string | Error code |
| msg | string | Error message |
Response Example
{
"event": "subscribe",
"arg": {
"instType": "USDT-FUTURES",
"channel": "books5",
"instId": "BTCUSDT"
}
}
Push Parameters
| Parameter | Type | Description |
|---|---|---|
| action | string | Push data action |
| arg | object | Channels with successful subscription |
| > instType | string | Product type |
| > channel | string | Channel name |
| > instId | string | Product ID E.g. BTCUSDT |
| data | object | Subscription data |
| > asks | list | Ask orders [price, size] |
| > bids | list | Bid orders [price, size] |
| > ts | number | Timestamp |
Push Data
{
"action": "snapshot",
"arg": {
"instType": "USDT-FUTURES",
"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"]
],
"ts": 1695716760565
},
"ts": 1695716761589
}