Skip to main content

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

NameTypeRequiredDefaultNotes
symbolstringNoBTCUSDTUppercase futures symbol.
intervalstringNo1dOne of 1m, 3m, 5m, 15m, 30m, 1h, 2h, 4h, 6h, 8h, 12h, 1d, 3d, 1w, 1M.
limitintegerNo100Number of klines to return. Binance caps at 1500.
startTimeintegerNoInclusive start, Unix milliseconds.
endTimeintegerNoInclusive 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"
]
]
IndexFieldTypeDescription
0open_timeinteger (ms)Bar open time.
1openstring (decimal)Open price.
2highstring (decimal)High price.
3lowstring (decimal)Low price.
4closestring (decimal)Close price.
5volumestring (decimal)Base-asset volume.
6close_timeinteger (ms)Bar close time.
7quote_volumestring (decimal)Quote-asset volume.
8tradesintegerTrade count.
9taker_buy_volumestring (decimal)Base-asset volume bought by takers.
10taker_buy_quote_volumestring (decimal)Quote-asset volume bought by takers.
11ignorestringReserved by Binance.

Errors

HTTPCause
400symbol does not exist on the upstream exchange (Binance error surfaced).
422interval not in the allowed set.
502Upstream Binance request failed ({"detail": "Binance请求失败: <reason>"}).

Example

curl -s "https://api.pipai.org/fapi/v1/klines?symbol=BTCUSDT&interval=1h&limit=500"