044depth - coinexcom/coinex_exchange_api GitHub Wiki
See request count and merge constraint here Acquire market depth
- result: checksum is a signed integer (32 bit) of full depth data and is for verify the accuracy of depth data, the checksum string will be bid1_price:bid1_amount:bid2_price:bid2_amount:ask1_price:ask1_amount:... if there is no bids, the checksum string will be ask1_price:ask1_amount:ask2_price:ask2_amount...
#Example
#Request
{
"method":"depth.query",
"params":[
"BTCBCH", #1.market: See<API invocation description·market>
20, #2.limit: Count limit, Integer
"0" #3.interval: Merge,String
],
"id":15
}
#Response
{
"error": null,
"result": {
"bids": [ #Depth of Buy
[
"12.25", #Buy in price
"0.0588" #Buy in count
]
],
"asks": [ #Depth of Sell
[
"12.94", #Sell out price
"0.1524" #Sell out count
]
],
"checksum": 21658179
},
"id": 15
}
#Example
#Request
{
"method":"depth.subscribe",
"params":[
"BTCBCH", #1.market: See<API invocation description·market>
5, #2.limit: Count limit
"0", #3.interval: Merge,String
true #4.diff, Boolen, Optional, default is true
],
"id":15
}
#notify
{
"method": "depth.update",
"params": [
false, #Boolean, true: for complete result,false: for update based on latest retrun result
{ #Update info
"bids": [ #Depth of Buy
[
"12.25", #Buy in price
"0.0588" #Buy in count
]
],
"asks": [ #Depth of Sell
[
"12.94", #Sell out price
"0.1524" #Sell out count
]
],
"checksum": 21658179
}
],
"id": null
}
#Example
#Request
{
"method":"depth.subscribe_multi",
"params":
[
[
"BTCBCH", #1.market: See<API invocation description·market>
5, #2.limit: Count limit
"0" #3.interval: Merge,String
true #4.diff, Boolen, Optional, default is true
],
[
"BTCUSDT",
5,
"0",
false
],
[
...
]
]
"id":15
}
#notify
{
"method": "depth.update",
"params": [
false, #Boolean, true: for complete result,false: for update based on latest retrun result
{ #Update info
"bids": [ #Depth of Buy
[
"12.25", #Buy in price
"0.0588" #Buy in count
]
],
"asks": [ #Depth of Sell
[
"12.94", #Sell out price
"0.1524" #Sell out count
]
],
"checksum": 21658179
}
],
"id": null
}