Skip to main content

K-line

Request format

kline@{symbol},{interval}
  • Intervals: 1m, 3m, 5m, 15m, 30m, 1h, 2h, 4h, 6h, 8h, 12h, 1d, 3d, 1w, 1M
  • Example: kline@btc_usdt,5m
  • Push rate: 1000ms

Request example

Subscribe — After establishing the WebSocket connection, send the following JSON string.

SUBSCRIBE
{
"method": "SUBSCRIBE",
"params": ["kline@btc_usdt,5m"],
"id": "test" // this param could call whatever you want
}

Response example

{
"topic": "kline",
"event": "kline@btc_usdt,5m",
"data": {
"s": "btc_index", // symbol
"o": "49000", // open
"c": "50000", // close
"h": "0.1", // high
"l": "0.1", // low
"a": "0.1", // volume
"v": "0.1", // quote volume
"ch": "0.21", // change
"t": 123124124 // timestamp
}
}