Skip to content

Description

Retrieve the candlesticks data of a symbol. Data will be pushed every 500 ms.

The channel will push a snapshot after successful subscription, followed by subsequent updates.

To switch K-line intervals without disconnecting the WebSocket, you must first send an "unsubscribe" command to cancel the previous K-line subscription before subscribing to the new interval. For example, if you are currently subscribed to mark_kline_1min and want to switch to mark_kline_15min, you must first unsubscribe from mark_kline_1min and then subscribe to mark_kline_15min.

Request Parameters

ParameterTypeRequiredDescription
opStringYesOperation, subscribe unsubscribe
argsList<Object>YesList of channels to request subscription
> chStringYesChannel name, The subscription channel is: Price TypeklineTime Interval;The price types include market price and marked price;market_kline_1min,mark_kline_1min,market_kline_3min,mark_kline_3min,market_kline_5min,mark_kline_5min,market_kline_15min,mark_kline_15min,market_kline_30min,mark_kline_30min,market_kline_60min,mark_kline_60min,market_kline_2h,mark_kline_2h,market_kline_4h,mark_kline_4h,market_kline_6h,mark_kline_6h,market_kline_8h,mark_kline_8h,market_kline_12h,mark_kline_12h,market_kline_1day,mark_kline_1day,market_kline_3day,mark_kline_3day,market_kline_1week,mark_kline_1week,market_kline_1month,mark_kline_1month
> symbolStringYesProduct ID E.g. ETHUSDT

request example:

json
{
    "op":"subscribe",
    "args":[
        {
            "symbol":"BTCUSDT",
            "ch":"market_kline_1min" 
        }
    ]
}

Push Parameters

ParameterTypeDescription
chStringChannel name
symbolStringProduct ID E.g. ETHUSDT
tsint64Time stamp
dataList<String>Subscription data
> oStringOpening price
> hStringHighest price
> lStringLowest price
> cStringClosing price
> bStringTrading volume of the coin
> qStringTrading volume of quote currency

push data:

json
{ 
  "ch": "market_kline_1min",
  "symbol": "BTCUSDT",
  "ts": 1775541412718,                   
  "data":{
      "o": "68581.4",                     
      "c": "68583.4",                     
      "h": "68590",                     
      "l": "68579.5",                    
      "b": "5.2395",                     
      "q": "359348.14078"                         
  }
}