Klines · WebSocket
See connection, authentication and subscription limits in the WebSocket overview.
Subscription message (type: subscribe)
SEND
subscribe / klinesClient → 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
| Field | Type | Required | Description |
|---|---|---|---|
type | string | Yes | Always subscribe.Allowed: "subscribe" |
id | string | No | Subscription ID. Default: default. Reuse it to replace the subscription.Default: "default" |
symbol | string | No | Base asset, e.g. BTC; do not append the quote currency. |
symbols | string[] | No | Base assets. Combined with symbol when both are supplied. |
quote | string | No | JPY (default) or USD.Allowed: "JPY", "USD"Default: "JPY" |
channels | string[] | Yes | Provide this value to subscribe only to this feed. Allowed: ["klines"] |
intervals | string[] | No | Klines 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)
RECEIVE
klineServer → 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
| Field | Type | Required | Description |
|---|---|---|---|
e | string | Yes | Always kline.Allowed: "kline" |
E | integer | Yes | Oracle publish time, Unix milliseconds. |
s | string | Yes | Base asset symbol. |
quote | string | Yes | Output price currency: JPY or USD.Allowed: "JPY", "USD" |
i | string | Yes | Kline interval. Allowed: "1m", "5m", "15m", "30m", "1h", "1d", "1w", "1M" |
x | boolean | Yes | Whether the Kline is closed. |
k | array | Yes | [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] | integer | Yes | Open time in Unix milliseconds. |
k[1] | string | Yes | Open price as a decimal string. |
k[2] | string | Yes | High price as a decimal string. |
k[3] | string | Yes | Low price as a decimal string. |
k[4] | string | Yes | Close price as a decimal string. |
k[5] | string | Yes | Base-asset volume as a decimal string. |
k[6] | boolean | Yes | Whether the candle is closed. |
