Skip to main content

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​

ParameterTypeRequiredDescription
categorystringYesProduct type: spot / linear
symbolstringYesTrading pair
intervalstringYesGranularity: 1m / 3m / 5m / 15m / 30m / 1h / 2h / 4h / 6h / 8h / 12h / 1d / 1w / 1o / 3o
startTimelongNoStart 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.
endTimelongNoEnd time (ms)
typestringNoKline type: mark / index. Defaults to mark.
limitintNoNumber of records, up to 1000. When omitted, the default is 1000 for futures and 300 for spot.

Response Parameters​

FieldTypeDescription
timestampstringtimestamp (ms)
openstringopening price
highstringhighest price
lowstringlowest price
closestringclosing price
qtystringTrading volume
amountstringTrading 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
}