Skip to main content

Candlestick Channel

Description

Get the candlestick data of the product

After first subscription, it will push the recent snapshot data and then push the update data

Request Example
{
"op": "subscribe",
"args": [
{
"instType": "SPOT",
"channel": "candle1m",
"instId": "ETHUSDT"
}
]
}

Request Parameters

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

Response Parameters

ParameterTypeDescription
eventStringYes
event, subscribe unsubscribe error
argObjectSubscribed channels
> instTypeStringProduct type
> channelStringChannel name, candle1m, candle5m 5 minutes, candle15 15 minutes, candle30m 30 minutes, candle1H 1 hour, candle4H 4 hours, candle6H 6 hours, candle12H 12 hours.
candle1D 1 day, candle3D 3 days, candle1W 1 week, candle1M 1 month-line, candle6Hutc 6-hour line, UTC, candle12Hutc 12-hour line, UTC, candle1Dutc 1-day line, UTC
candle3Dutc, UTC, 3-day line, candle1Wutc UTC, weekly line, candle1Mutc monthly line, UTC.
> instIdStringProduct ID, e.g. ETHUSDT
codeStringError code, returned only on error
msgStringError message
Push Data
{
"action": "snapshot",
"arg": {
"instType": "SPOT",
"channel": "candle1m",
"instId": "ETHUSDT"
},
"data": [
[
"1695672780000",
"2200.1",
"2200.1",
"2200.1",
"2200.1",
"0",
"0",
"0"
]
],
"ts": 1695702747821
}

Push Parameters

ParameterTypeDescription
actionStringPush data action, snapshot or update
argObjectSubscribed channels
> channelStringChannel name
> instTypeStringProduct type
> instIdStringProduct ID, e.g. ETHUSDT
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]StringTrading volume of the coin
> index[6]StringTrading volume of quote currency
> index[7]StringTrading volume (USDT)
> index[7]StringCandlestick status