K-line Subscription
Subscribe to real-time K-line data push.
Subscription Format
{symbol}@kline_{interval} (e.g., AAPL@kline_1m)
Supported Time Intervals
1m, 5m, 15m, 30m, 1h, 2h, 4h, 1d, 1w, 1mo
Subscribe Request
Can subscribe to multiple trading pairs and intervals simultaneously
{
"action": "subscribe",
"streams": [
"AAPL@kline_1m",
"TSLA@kline_5m"
]
}
Push Data Fields
| Field | Type | Description |
|---|---|---|
| event | string | Event type: data |
| channel | string | Channel: kline |
| data.symbol | string | Trading pair |
| data.interval | string | K-line interval |
| data.t | int64 | K-line open time (millisecond timestamp) |
| data.o | string | Open price |
| data.h | string | High price |
| data.l | string | Low price |
| data.c | string | Close price (current K-line latest price) |
| data.v | string | Volume |
| data.isClosed | bool | Whether K-line is closed (true=closed, false=ongoing) |
| time | int64 | Push timestamp (milliseconds) |
Push Example
{
"event": "data",
"channel": "kline",
"data": {
"symbol": "AAPL",
"interval": "1m",
"t": 1736163000000,
"o": "150.00",
"h": "151.50",
"l": "149.80",
"c": "151.20",
"v": "1000000",
"isClosed": false
},
"time": 1736163000000
}
Unsubscribe
{
"action": "unsubscribe",
"streams": ["AAPL@kline_1m"]
}