Skip to main content

Depth Channel

Get the order book depth data

Supported Channels

ChannelDescription
booksFull orderbook with checksum
books1Top 1 level orderbook
books5Top 5 levels orderbook
books15Top 15 levels orderbook

Note: books channel sends snapshot first, then incremental updates. Other channels (books1, books5, books15) always send snapshots.

Request Parameters

ParameterTypeRequiredDescription
opstringYesOperation, subscribe unsubscribe
argslistYesList of channels to request subscription
> instTypestringYesProduct type: SPOT
> channelstringYesChannel name (books, books1, books5, books15)
> instIdstringYesProduct 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

ParameterTypeDescription
actionstringPush data action: snapshot / update
argobjectChannels with successful subscription
> instTypestringProduct type: SPOT
> channelstringChannel name
> instIdstringProduct ID E.g. BTCUSDT
datalistOrderbook data
> askslistAsk orders [price, size]
> bidslistBid orders [price, size]
> checksumnumberChecksum (only for books channel)
> seqnumberSequence number
> tsstringTimestamp
tsnumberPush 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
}