Get Historical Candlestick Data
Get historical candlestick/kline data for a trading pair from archived data.
HTTP Request
GET /api/v1/spot/market/history-candles
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | Trading pair symbol (e.g., BTCUSDT) |
| granularity | string | Yes | Candlestick interval (e.g., 1m, 5m, 15m, 1h, 4h, 1d) |
| endTime | string | Yes | End time in milliseconds |
| limit | string | No | Number of results to return (default and max may vary) |
Request Example
curl -X GET "https://open-api.bydoxe.com/api/v1/spot/market/history-candles?symbol=BTCUSDT&granularity=1h&endTime=1763459280833&limit=100"
Response Parameters
| Parameter | Type | Description |
|---|---|---|
| code | string | Response code |
| msg | string | Response message |
| requestTime | number | Request timestamp in milliseconds |
| data | array | Array of candlestick data |
Candlestick Data Array Structure
Each candlestick is represented as an array with the following elements in order:
| Index | Field | Type | Description |
|---|---|---|---|
| 0 | openTime | number | Candle open time (milliseconds) |
| 1 | open | string | Opening price |
| 2 | high | string | Highest price |
| 3 | low | string | Lowest price |
| 4 | close | string | Closing price |
| 5 | volume | string | Trading volume (base currency) |
| 6 | quoteVolume | string | Trading volume (quote currency) |
Response Example
Success Response
{
"code": "00000",
"msg": "success",
"requestTime": 1732000000000,
"data": [
[1763457000000, "91000.00", "91300.00", "90900.00", "91250.00", "123.456", "11234567.89"],
[1763453400000, "90800.00", "91100.00", "90700.00", "91000.00", "98.765", "8976543.21"]
]
}
Error Codes
| Code | Message |
|---|---|
| 400172 | Parameter verification failed |
| 50010 | Candle data not available |