K-Line Subscription
Subscribe to real-time K-line data push for futures.
Subscription Format
{symbol}@kline_{interval} (e.g.: BTCUSD@kline_1m)
Supported Time Intervals
1m, 5m, 15m, 30m, 1h, 2h, 4h, 1d, 1w, 1mo
Subscribe Request
Can subscribe to multiple pairs and intervals simultaneously
{
"action": "subscribe",
"streams": [
"BTCUSD@kline_1m",
"ETHUSD@kline_5m"
]
}
Push Data Fields
| Field | Type | Description |
|---|---|---|
| event | string | Event type: data |
| channel | string | Channel: kline |
| data.symbol | string | Contract symbol |
| data.interval | string | K-line interval |
| data.t | int64 | K-line opening time (milliseconds) |
| data.o | string | Open price |
| data.h | string | High price |
| data.l | string | Low price |
| data.c | string | Close price (latest price of current K-line) |
| data.v | string | Volume |
| data.isClosed | bool | Is K-line closed (true=closed, false=in progress) |
| time | int64 | Push timestamp (milliseconds) |
Push Example
{
"event": "data",
"channel": "kline",
"data": {
"symbol": "BTCUSD",
"interval": "1m",
"t": 1736163000000,
"o": "50000.00",
"h": "50150.00",
"l": "49980.00",
"c": "50120.00",
"v": "1000000",
"isClosed": false
},
"time": 1736163000000
}
Unsubscribe
{
"action": "unsubscribe",
"streams": ["BTCUSD@kline_1m"]
}