Skip to content

Klines · WebSocket ​

See connection, authentication and subscription limits in the WebSocket overview.

Unsubscribe

Subscription message (type: subscribe) ​

SENDsubscribe / klines

Client → server

Receive kline events for the selected assets, quote, and intervals. Omit intervals for all supported intervals. Omit both symbol and symbols for all assets in this quote, subject to the connection-wide symbol limit.

Reply: subscribed

Message fields ​

FieldTypeRequiredDescription
typestringYesAlways subscribe.
Allowed: "subscribe"
idstringNoSubscription ID. Default: default. Reuse it to replace the subscription.
Default: "default"
symbolstringNoBase asset, e.g. BTC; do not append the quote currency.
symbolsstring[]NoBase assets. Combined with symbol when both are supplied.
quotestringNoJPY (default) or USD.
Allowed: "JPY", "USD"
Default: "JPY"
channelsstring[]YesProvide this value to subscribe only to this feed.
Allowed: ["klines"]
intervalsstring[]NoKlines only: 1m, 5m, 15m, 30m, 1h, 1d, 1w, 1M. Omit for all intervals.
Allowed: "1m", "5m", "15m", "30m", "1h", "1d", "1w", "1M"

Push message (e: kline) ​

RECEIVEkline

Server → client

Kline: k uses the REST order [open_time_ms, open, high, low, close, volume, is_closed]. x=false means the candle is still forming. After closed history is stored, the same candle is sent again with x=true and its final OHLCV; replace the active row with this final row. s is the base asset and quote is the price currency.

Message fields ​

FieldTypeRequiredDescription
estringYesAlways kline.
Allowed: "kline"
EintegerYesOracle publish time, Unix milliseconds.
sstringYesBase asset symbol.
quotestringYesOutput price currency: JPY or USD.
Allowed: "JPY", "USD"
istringYesKline interval.
Allowed: "1m", "5m", "15m", "30m", "1h", "1d", "1w", "1M"
xbooleanYesWhether the Kline is closed.
karrayYes[open_time_ms, open, high, low, close, volume, is_closed]. Time is an integer; prices and volume are decimal strings; the last value is a boolean.
k[0]integerYesOpen time in Unix milliseconds.
k[1]stringYesOpen price as a decimal string.
k[2]stringYesHigh price as a decimal string.
k[3]stringYesLow price as a decimal string.
k[4]stringYesClose price as a decimal string.
k[5]stringYesBase-asset volume as a decimal string.
k[6]booleanYesWhether the candle is closed.