Get Kline/Candlestick History
Get Kline/Candlestick History
Descriptionâ
You can retrieve historical candlestick data from more than 90 days ago.
Note: If endTime goes past a candle interval boundary (even by 1 ms), the system may round up when calculating the number of candles, and the response may include one additional interval (i.e., the returned data may start one interval earlier).
Notes for Reality stock (rtoken) symbols
- Only the
marketcandlestick type is supported. Passingmark,index, orpremiumfalls back tomarketwithout returning an error. - Only the
1m,5m,15m,1H,4H,1Dintervals are supported. Passing an unsupported interval returns a parameter error.
HTTP Requestâ
- GET /api/v3/market/history-candles
- Rate limit: 20/sec/IP
Request
curl "https://api.bitget.com/api/v3/market/history-candles?category=USDT-FUTURES&symbol=BTCUSDT&interval=1D&limit=10"
Request Parametersâ
| Parameter | Type | Required | Comments |
|---|---|---|---|
| category | String | Yes | Product TypeSPOT Spot tradingUSDT-FUTURES USDT futures COIN-FUTURES Coin-M futures USDC-FUTURES USDC futures |
| symbol | String | Yes | Symbol name e.g., BTCUSDT |
| interval | String | Yes | Granularity1m,3m,5m,15m,30m,1H,4H,6H,12H,1D |
| startTime | String | No | Start timestamp A Unix millisecond timestamp, e.g., 1672410780000Request data after this start time (the maximum time query range is 90 days) |
| endTime | String | No | End timestamp A Unix millisecond timestamp, e.g., 1672410781000Request data before this end time (the maximum time query range is 90 days) |
| type | String | No | Candlestick typemarket, mark, index, premium. Default: market |
| limit | String | No | Limit per page Default: 100. Maximum: 100 |
Response
{
"code": "00000",
"msg": "success",
"requestTime": 1695865864944,
"data": [
[
"1687708800000",
"27176.93",
"27177.43",
"27166.93",
"27177.43",
"2990.08",
"81246917.3294"
],
[
"1688313600000",
"27177.43",
"27177.43",
"24000",
"24001",
"2989.1",
"72450031.0448"
]
]
}
Response Parametersâ
| Parameter | Type | Comments |
|---|---|---|
| >index[0] | String | The timestamp that the system generated the data |
| >index[1] | String | Open price |
| >index[2] | String | Highest price |
| >index[3] | String | Lowest price |
| >index[4] | String | Close price |
| >index[5] | String | Volume. The unit is base coin |
| >index[6] | String | Turnover. The unit is quote coin |