Klines
Candlestick (OHLCV) data for a futures symbol over a given time range and interval. Passthrough of Binance USDⓈ-M Futures /fapi/v1/klines.
Endpoint
GET /fapi/v1/klines
Authentication: Public.
Query parameters
| Name | Type | Required | Default | Notes |
|---|---|---|---|---|
symbol | string | No | BTCUSDT | Uppercase futures symbol. |
interval | string | No | 1d | One of 1m, 3m, 5m, 15m, 30m, 1h, 2h, 4h, 6h, 8h, 12h, 1d, 3d, 1w, 1M. |
limit | integer | No | 100 | Number of klines to return. Binance caps at 1500. |
startTime | integer | No | — | Inclusive start, Unix milliseconds. |
endTime | integer | No | — | Inclusive end, Unix milliseconds. |
If neither startTime nor endTime is provided, the most recent limit klines are returned. Klines are returned in ascending open_time order.
Response — 200 OK
2D array. Each row is positional:
[
[
1745920800000,
"67310.00",
"67450.50",
"67280.20",
"67432.15",
"182.4521",
1745920859999,
"12298745.33",
1842,
"98.3211",
"6628412.10",
"0"
]
]
| Index | Field | Type | Description |
|---|---|---|---|
| 0 | open_time | integer (ms) | Bar open time. |
| 1 | open | string (decimal) | Open price. |
| 2 | high | string (decimal) | High price. |
| 3 | low | string (decimal) | Low price. |
| 4 | close | string (decimal) | Close price. |
| 5 | volume | string (decimal) | Base-asset volume. |
| 6 | close_time | integer (ms) | Bar close time. |
| 7 | quote_volume | string (decimal) | Quote-asset volume. |
| 8 | trades | integer | Trade count. |
| 9 | taker_buy_volume | string (decimal) | Base-asset volume bought by takers. |
| 10 | taker_buy_quote_volume | string (decimal) | Quote-asset volume bought by takers. |
| 11 | ignore | string | Reserved by Binance. |
Errors
| HTTP | Cause |
|---|---|
400 | symbol does not exist on the upstream exchange (Binance error surfaced). |
422 | interval not in the allowed set. |
502 | Upstream Binance request failed ({"detail": "Binance请求失败: <reason>"}). |
Example
curl -s "https://api.pipai.org/fapi/v1/klines?symbol=BTCUSDT&interval=1h&limit=500"