Skip to main content

Get Market Depth

HTTP request

GET /spot/depth

Request parameters

Parameter NameRequiredTypeNotes
markettruestringMarket name
limittrueintNumber of depth data items.
One of [5, 10, 20, 50]
intervaltruestringMerge interval.
One of ["0", "0.00000000001", "0.000000000001", "0.0000000001", "0.000000001", "0.00000001", "0.0000001", "0.000001", "0.00001", "0.0001", "0.001", "0.01", "0.1", "1", "10", "100", "1000"]

Return parameters

Parameter NameTypeNotes
marketstringMarket name
is_fullboolTrue means full push, and false means incremental push
depthobjectDepth data
depth.asksarraySeller data
asks[n][0]stringSeller price
asks[n][1]stringSeller size. During incremental push, a value of 0 indicates the depth at which the price needs to be deleted.
depth.bidsarrayBuyer data
bids[n][0]stringBuyer price
bids[n][1]stringBuyer size. During incremental push, a value of 0 indicates the depth at which the price needs to be deleted.
depth.laststringLatest price
depth.updated_atintTimestamp, millisecond
depth.checksumstringData checksum
Reminder

About Depth Checksum:

  1. The checksum is a signed 32-bit integer of the full depth data, used to verify the accuracy of the depth data.
  2. Construct the checksum string: bid1_price:bid1_amount:bid2_price:bid2_amount:ask1_price:ask1_amout:... (if there is no bid, the checksum string will be ask1_price:ask1_amount:ask2_price:ask2_amount:...)
  3. Encode the checksum string using crc32 algorithm

Please check out the Code Examples to see how to use both full and incremental data pushes in the API client to recover complete depth data and verify its accuracy.


Request example

GET /spot/depth?market=BTCUSDT&limit=5&interval=0.01

Response example

{
"code": 0,
"data": {
"market": "BTCUSDT",
"is_full": true,
"depth": {
"asks": [
[
"30740.00",
"0.31763545"
],
[
"30769.00",
"1.45155000"
]
],
"bids": [
[
"30736.00",
"0.04857373"
],
[
"30733.00",
"0.84696320"
],
[
"30725.00",
"0.12563353"
],
[
"30422.00",
"0"
]
],
"last": "30746.28",
"updated_at": 1689152421692,
"checksum": 2578768879
}
},
"message": "OK"
}