Limited depth
Request format
depth@{symbol},{levels},{interval}
- Levels:
5, 10, 20, 50 - Interval options:
100, 250, 500, 1000(default:1000ms) - Example:
depth@btc_usdt,50,1000ms
Request example
Subscribe — After establishing the WebSocket connection, send the following JSON string.
SUBSCRIBE
{
"method": "SUBSCRIBE",
"params": ["depth@btc_usdt,50,1000ms"],
"id": "test" // this param could call whatever you want
}
Response example
{
"topic": "depth",
"event": "depth@btc_usdt,20",
"data": {
"id": "1234", // lastUpdateId
"s": "btc_index", // symbol
"a": [
["50000", "0.1"],
["50001", "0.2"]
], // asks [price, size]
"b": [
["49999", "0.1"],
["48888", "0.2"]
], // bids [price, size]
"t": 123456789 // timestamp
}
}