Skip to main content

Kline/Candlestick Data

Type: NONE

Weight: 5

GET /fapi/v1/klines

OHLCV buckets built on the fly from ledger.trades using date_trunc.

Request

GET /fapi/v1/klines?symbol=BTCUSDT&interval=1m&limit=500

Query params

NameTypeRequiredDefaultNotes
symbolstringyes—Standard pair (e.g. BTCUSDT).
intervalstringyes—One of 1m, 1h, 1d. Other values → -1100.
limitintegerno500Clamped to 1..=1500. Acts as a lookback window, not a row cap: the query covers the last limit intervals (ts > now() − limit × interval) and returns only buckets that contain at least one trade, so fewer than limit rows may come back and empty buckets are omitted rather than zero-filled.
startTime, endTimeint64no—Accepted but ignored; only limit controls the window.

Response — 200 (standard nested-array form)

[
[
1748275140000, // openTime
"76510.000000000000000000", // open
"76525.000000000000000000", // high
"76500.000000000000000000", // low
"76521.340000000000000000", // close
"1.245600000000000000", // volume (base)
1748275199999, // closeTime
"95300.123456789012345678", // quoteVolume
142, // count
"0.623400000000000000", // takerBuyVolume (base)
"47700.500000000000000000", // takerBuyQuoteVolume
"0" // ignore
]
]

Candles are returned ascending by openTime. The most recent bucket is partial until its boundary closes.

Errors

HTTPcodemsg
400-1100Unknown symbol, or unsupported interval (only 1m / 1h / 1d accepted).
400—symbol or interval missing or malformed: plain-text axum rejection (Failed to deserialize query string: …), not the {code,msg} JSON shape.
500-1000Database error.

Intervals beyond 1m / 1h / 1d (3m, 5m, 15m, 30m, 2h, 4h, 6h, 8h, 12h, 1w, 1M) are not yet supported. Also available on Rocky's native Web v1 surface: GET /v1/markets/{symbol}/candles?period=1m&limit=500 (interval is accepted as an alias of period; periods 1m|3m|5m|15m|30m|1h|2h|4h|6h|12h|1d|3d|1w; limit clamped to 1..=2000 and there means the number of most-recent buckets) — returns an array of {bucket_ms, open, high, low, close, volume} objects instead of the nested-array form.