Kline Data
Query Kline Data
Get K-line (candlestick) historical data for a specified trading pair.
HTTP Request
GET
/api/perp-market-api/kline/history
Request Frequency Restriction:
- Recommended: no more than 3 times per second
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | Trading pair symbol, e.g., ETH-PERP |
| interval | string | Yes | K-line type: 1m, 3m, 5m, 15m, 30m, 1h, 2h, 4h, 6h, 12h, D, W, M |
| startTime | integer | Yes | Start time (second-level timestamp), e.g., 1553320321 |
| endTime | integer | Yes | End time (second-level timestamp), e.g., 1553339535 |
Kline Type Description
| Parameter Value | Corresponding Period |
|---|---|
| 1m | 1 minute |
| 3m | 3 minutes |
| 5m | 5 minutes |
| 15m | 15 minutes |
| 30m | 30 minutes |
| 1h | 1 hour |
| 2h | 2 hours |
| 4h | 4 hours |
| 6h | 6 hours |
| 12h | 12 hours |
| D | 1 day |
| W | 1 week |
| M | 1 month |
Response Fields Description
Returns K-line data array, each element is: - [0]: Opening time (second-level timestamp) - [1]: Opening price - [2]: Highest price - [3]: Lowest price - [4]: Closing price - [5]: Trading volume
Response Example
{
"code": 200,
"message": "success",
"data": [
[1553320321, "2500.0", "2510.0", "2495.0", "2505.0", "1000.5"],
[1553320381, "2505.0", "2515.0", "2500.0", "2510.0", "1200.3"],
[1553320441, "2510.0", "2520.0", "2505.0", "2515.0", "1500.8"]
]
}
Note
- Timestamp is in seconds, not milliseconds
- If startTime <= 0 or endTime <= 0 or startTime > endTime, an empty array will be returned