Get Klines
Description
Query K-line data
HTTP Request
- POST
/api/v3/market/kline - Supported Products:
spot/linear - Rate Limit: 10 requests per second per IP
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
category | string | Yes | Product type: spot / linear |
symbol | string | Yes | Trading pair |
interval | string | Yes | Granularity: 1m / 3m / 5m / 15m / 30m / 1h / 2h / 4h / 6h / 8h / 12h / 1d / 1w / 1o / 3o |
startTime | long | No | Start time (ms). Both startTime and endTime are optional. If both are omitted, returns the most recent Klines, including the current one. If only startTime is provided, returns limit entries going backward in time, including the Kline at that time. If only endTime is provided, returns limit entries going forward in time, including the Kline at that time. If both are provided, startTime must be at or before endTime. |
endTime | long | No | End time (ms) |
type | string | No | Kline type: mark / index. Defaults to mark. |
limit | int | No | Number of records, up to 1000. When omitted, the default is 1000 for futures and 300 for spot. |
Response Parameters
| Field | Type | Description |
|---|---|---|
timestamp | string | timestamp (ms) |
open | string | opening price |
high | string | highest price |
low | string | lowest price |
close | string | closing price |
qty | string | Trading volume |
amount | string | Trading turnover |
Request Example
POST /api/v3/market/kline HTTP/1.1
Host: openapi.lbank.com
Content-Type: application/json
ex-timestamp: <current_unix_timestamp_ns>
{
"category": "linear",
"symbol": "BTCUSDT",
"interval": "1m",
"limit": 2
}
Response Example
{
"code": 200,
"message": "Success",
"data": {
"list": [
{
"timestamp": "1793196240000",
"open": "80010.00",
"high": "80010.00",
"low": "80010.00",
"close": "80010.00",
"qty": "0.00000",
"amount": "0"
}
]
},
"extras": null
}