Skip to main content
GET
1 credit per 1,000 returned candles, rounded up (minimum 1 credit).

  • Chronological, fully closed candles for a specific exchange and market pair.
  • Compact rows shaped as [timestampMs, open, high, low, close, volumeBase].
  • The effective start and end times.
  • exchange: Exchange name, for example Binance.
  • pair: Case-sensitive market pair, for example BTC/USDT.
  • interval: Candle interval from 5m through 1w.
  • Exactly one time mode: range, or both start and end.
  • range: 1h, 6h, 24h, 1w, 1mo, 3mo, 6mo, 1y, or all.
  • start / end: ISO 8601 custom bounds. Start is inclusive and end is exclusive.
range=all returns all stored history available for the pair and may contain genuine source gaps. Maximum: 100,000 candles per response. Requests exceeding this limit return HTTP 400; use a shorter range or a larger interval. Credits are based on the number of candles actually returned: 1 credit per 1,000 candles, rounded up, with a minimum of 1 credit. For example: 150 or 1,000 candles = 1 credit; 1,001 candles = 2 credits; 10,000 candles = 10 credits; 100,000 candles = 100 credits. An empty successful response costs 1 credit.

Authorizations

X-API-KEY
string
header
required

API key required to access the endpoints. Generate one from your dashboard at https://openapi.coinstats.app and pass it in the X-API-KEY request header. Never expose your key in client-side code.

Query Parameters

exchange
string
required

Exchange name. Matching is case-insensitive.

Example:

"Binance"

pair
string
required

Case-sensitive market pair.

Example:

"BTC/USDT"

interval
enum<string>
required

Candle interval.

Available options:
5m,
15m,
30m,
1h,
4h,
1d,
1w
Example:

"1h"

range
enum<string>

Rolling time range ending now. Use this or both start and end, never both modes.

Available options:
1h,
6h,
24h,
1w,
1mo,
3mo,
6mo,
1y,
all
Example:

"24h"

start
string<date-time>

Inclusive custom-range start as an ISO 8601 timestamp. Requires end and cannot be combined with range.

Example:

"2026-09-01T00:00:00.000Z"

end
string<date-time>

Exclusive custom-range end as an ISO 8601 timestamp. Requires start, must be later than start, and cannot be combined with range.

Example:

"2026-09-02T00:00:00.000Z"

Response

Exchange-specific historical OHLCV candles.

exchange
string
required
Example:

"Binance"

pair
string
required
Example:

"BTC/USDT"

interval
enum<string>
required
Available options:
5m,
15m,
30m,
1h,
4h,
1d,
1w
Example:

"1h"

start
string<date-time>
required

Effective range start.

Example:

"2026-09-01T00:00:00.000Z"

end
string<date-time>
required

Effective range end.

Example:

"2026-09-02T00:00:00.000Z"

count
number
required
Example:

24

candles
((number | null)[])[]
required

Chronological compact candles. Each item is [timestampMs, open, high, low, close, volumeBase]. Volume may be null when the source does not provide it.

Required array length: 6 elements
Example: