Skip to main content

Candlestick Channel

Description

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

The channel will push a snapshot after successful subscribed, later on the updates will be pushed

If intended to query history data in a customized time range, please refer to Get Candle Data

Request Example
{
"op": "subscribe",
"args": [
{
"instType": "USDT-FUTURES",
"channel": "candle1m",
"instId": "BTCUSDT"
}
]
}

Request Parameters

ParameterTypeRequiredDescription
opStringYesOperation, subscribe unsubscribe
argsList<Object>YesList of channels to request subscription
> instTypeStringYesProduct type
> channelStringYesChannel name, candle1m (1 minute) candle5m (5 minutes) candle15m (15 minutes) candle30m (30 minutes) candle1H (1 hour) candle4H (4 hours) candle12H (12 hours)
candle1D (1 day) candle1W (1 week) candle6H (6 hours) candle3D (3 days) candle1M (1-month line) candle6Hutc (6-hour line, UTC) candle12Hutc (12-hour line, UTC)
candle1Dutc (1-day line, UTC) candle3Dutc (3-day line, UTC) candle1Wutc (weekly line, UTC) candle1Mutc (monthly line. UTC)
> instIdStringYesProduct ID
E.g. ETHUSDT
Response Example
{
"event": "subscribe",
"arg": {
"instType": "USDT-FUTURES",
"channel": "candle1m",
"instId": "BTCUSDT"
}
}

Response Parameters

ParameterTypeDescription
eventStringYes
Event
argObjectSubscribed channels
> channelStringChannel name, candle1m (1 minute) candle5m (5 minutes) candle15m (15 minutes) candle30m (30 minutes) candle1H (1 hour) candle4H (4 hours) candle12H (12 hours)
candle1D (1 day) candle1W (1 week) candle6H (6 hours) candle3D (3 days) candle1M (1-month line) candle6Hutc (6-hour line, UTC) candle12Hutc (12-hour line, UTC)
candle1Dutc (1-day line, UTC) candle3Dutc (3-day line, UTC) candle1Wutc (weekly line, UTC) candle1Mutc (monthly line. UTC)
> instTypeStringProduct type
> instIdStringYes
E.g. ETHUSDT
codeStringError code, returned only on error
msgStringError message
Push Data
{
"action": "snapshot",
"arg": {
"instType": "USDT-FUTURES",
"channel": "candle1m",
"instId": "BTCUSDT"
},
"data": [
[
"1695685500000",
"27000",
"27000.5",
"27000",
"27000.5",
"0.057",
"1539.0155",
"1539.0155"
]
],
"ts": 1695715462250
}

Push Parameters

ParameterTypeDescription
argObjectChannels with successful subscription
> channelStringChannel name
> instIdStringProduct ID
> instTypeStringProduct type
dataList<String>Subscription data
> index[0]StringStart time, milliseconds format of Unix timestamp, e.g.1597026383085
> index[1]StringOpening price
> index[2]StringHighest price
> index[3]StringLowest price
> index[4]StringClosing price
> index[5]StringThe value is the trading volume of left coin
> index[6]StringTrading volume of quote currency
> index[7]StringCandlestick status