Skip to main content

Klines (Candlesticks)

Description

Returns pre-aggregated OHLCV candles in Binance-style array-of-arrays format. The kline aggregator updates bars incrementally on every fill and applies a 60-second decay pass to expire out-of-window trades.

HTTP Request

GET /spot/klines (public — no auth required)

Weight

0 — public market-data endpoints have no per-IP weight limit today (MVP).

Request Parameters

NameTypeRequiredDescription
symbolSTRINGYESMarket id (e.g. DFUSDT). Case-sensitive. See GET /spot/markets.
intervalSTRINGYESCandle width. See K-line Intervals: 1m / 5m / 15m / 1h / 4h / 1d.
limitNUMBERNONumber of bars to return. Default 500, range 1–1000.
start_timeNUMBERNOUnix seconds. Filter: open_time >= start_time.
end_timeNUMBERNOUnix seconds. Filter: open_time <= end_time.

Response Example

200 OK

[
[1778313600, "0.48", "0.51", "0.47", "0.50", "10000", 1778313659, "4900", 234],
[1778313660, "0.50", "0.52", "0.49", "0.51", "8500", 1778313719, "4335", 187]
]

Position-based fields (all prices and volumes are strings; trade_count is a number):

IndexFieldNotes
0open_timeUnix seconds. Bar start.
1open_priceFirst fill price in the bar (or carry from previous bar if no fills).
2high_priceHighest fill price in the bar.
3low_priceLowest fill price in the bar.
4close_priceLast fill price in the bar.
5volumeTotal base-token volume traded in the bar.
6close_timeUnix seconds. open_time + interval_seconds - 1.
7quote_volumeTotal quote-token volume (notional) traded in the bar.
8trade_countNumber of individual fills in the bar.

Error Responses

HTTPerror
400invalid intervalinterval value is not one of the supported strings.
500DB_ERROR

Full list: Error Codes.

Code Examples

cURL

# Last 10 one-minute bars
curl -s "https://api-sepolia.p99.world/api/v1/spot/klines?symbol=DFUSDT&interval=1m&limit=10"

# Bars in a specific time window
curl -s "https://api-sepolia.p99.world/api/v1/spot/klines?symbol=DFUSDT&interval=1h&start_time=1778313600&end_time=1778400000"

Python

import requests

BASE = "https://api-sepolia.p99.world/api/v1"

bars = requests.get(f"{BASE}/spot/klines", params={
"symbol": "DFUSDT",
"interval": "1m",
"limit": 10,
}).json()

for bar in bars:
open_time, open_p, high, low, close, vol, close_time, quote_vol, trades = bar
print(f"t={open_time} O={open_p} H={high} L={low} C={close} vol={vol} n={trades}")