Websocket V2
The base endpoint is here
Access Websocket V2 Stream
WEBSOCKET /openapi/quote/ws/v2The V2 websocket supports faster streaming, therefore we recommend all previous users to switch to the V2 version. The subscription message structure has changed for all streams. Please see below for changes.
Full Depth Stream
Subscription:
{
"topic": "depth",
"event": "sub",
"params": {
"binary": false,
"symbol": "$symbol",
}
}Return:
{
"topic": "depth",
"params": {
"symbol": "BTCUSDT",
"binary": "false"
},
"data": {
"s": "BTCUSDT",
"t": 1582001376853,
"v": "13850022_2",
"b": [
[
"9780.79", // price
"0.01" // quantity
],
[
"9780.5",
"0.1"
],
[
"9780.4",
"0.517813"
], ...
"a": [
[
"9781.21", // price
"0.042842" // quantity
],
[
"9782",
"0.3"
],
[
"9782.1",
"0.226"
], ...
]
}
}Market Tickers Stream
Subscription:
Return:
Trade Streams
Subscription:
Return:
Bookticker
Subscription:
Return:
Kline
Subscription:
Return: