curl "https://api.coinstats.app/v1/ohlcv/candles?exchange=Binance&pair=BTC%2FUSDT&interval=1h&range=24h" \
-H "X-API-KEY: YOUR_API_KEY"{
"exchange": "Binance",
"pair": "BTC/USDT",
"interval": "1h",
"start": "2026-09-01T00:00:00.000Z",
"end": "2026-09-02T00:00:00.000Z",
"count": 24,
"candles": [
[
1788220800000,
78580,
78900,
78570.01,
78605.8,
522.70913
]
]
}{
"statusCode": 400,
"message": "Bad Request",
"requestId": "11111111-2222-3333-4444-555555555555",
"path": "<requested-endpoint>"
}{
"statusCode": 401,
"message": "Unauthorized",
"requestId": "11111111-2222-3333-4444-555555555555",
"path": "<requested-endpoint>"
}{
"statusCode": 403,
"message": "Forbidden",
"requestId": "11111111-2222-3333-4444-555555555555",
"path": "<requested-endpoint>"
}{
"statusCode": 404,
"message": "Not Found",
"requestId": "11111111-2222-3333-4444-555555555555",
"path": "<requested-endpoint>"
}{
"statusCode": 409,
"message": "Transactions not synced",
"requestId": "11111111-2222-3333-4444-555555555555",
"path": "<requested-endpoint>"
}{
"statusCode": 429,
"message": "Rate limit exceeded",
"requestId": "11111111-2222-3333-4444-555555555555",
"path": "<requested-endpoint>"
}{
"statusCode": 503,
"message": "Service Unavailable. Please Contact Support"
}Get Ohlcv Candles
Get historical OHLCV candles for an exchange market
curl "https://api.coinstats.app/v1/ohlcv/candles?exchange=Binance&pair=BTC%2FUSDT&interval=1h&range=24h" \
-H "X-API-KEY: YOUR_API_KEY"{
"exchange": "Binance",
"pair": "BTC/USDT",
"interval": "1h",
"start": "2026-09-01T00:00:00.000Z",
"end": "2026-09-02T00:00:00.000Z",
"count": 24,
"candles": [
[
1788220800000,
78580,
78900,
78570.01,
78605.8,
522.70913
]
]
}{
"statusCode": 400,
"message": "Bad Request",
"requestId": "11111111-2222-3333-4444-555555555555",
"path": "<requested-endpoint>"
}{
"statusCode": 401,
"message": "Unauthorized",
"requestId": "11111111-2222-3333-4444-555555555555",
"path": "<requested-endpoint>"
}{
"statusCode": 403,
"message": "Forbidden",
"requestId": "11111111-2222-3333-4444-555555555555",
"path": "<requested-endpoint>"
}{
"statusCode": 404,
"message": "Not Found",
"requestId": "11111111-2222-3333-4444-555555555555",
"path": "<requested-endpoint>"
}{
"statusCode": 409,
"message": "Transactions not synced",
"requestId": "11111111-2222-3333-4444-555555555555",
"path": "<requested-endpoint>"
}{
"statusCode": 429,
"message": "Rate limit exceeded",
"requestId": "11111111-2222-3333-4444-555555555555",
"path": "<requested-endpoint>"
}{
"statusCode": 503,
"message": "Service Unavailable. Please Contact Support"
}You will get
You will get
- 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.
Required
Required
- exchange: Exchange name, for example
Binance. - pair: Case-sensitive market pair, for example
BTC/USDT. - interval: Candle interval from
5mthrough1w. - Exactly one time mode:
range, or bothstartandend.
Optional
Optional
- range:
1h,6h,24h,1w,1mo,3mo,6mo,1y, orall. - 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
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 name. Matching is case-insensitive.
"Binance"
Case-sensitive market pair.
"BTC/USDT"
Candle interval.
5m, 15m, 30m, 1h, 4h, 1d, 1w "1h"
Rolling time range ending now. Use this or both start and end, never both modes.
1h, 6h, 24h, 1w, 1mo, 3mo, 6mo, 1y, all "24h"
Inclusive custom-range start as an ISO 8601 timestamp. Requires end and cannot be combined with range.
"2026-09-01T00:00:00.000Z"
Exclusive custom-range end as an ISO 8601 timestamp. Requires start, must be later than start, and cannot be combined with range.
"2026-09-02T00:00:00.000Z"
Response
Exchange-specific historical OHLCV candles.
"Binance"
"BTC/USDT"
5m, 15m, 30m, 1h, 4h, 1d, 1w "1h"
Effective range start.
"2026-09-01T00:00:00.000Z"
Effective range end.
"2026-09-02T00:00:00.000Z"
24
Chronological compact candles. Each item is [timestampMs, open, high, low, close, volumeBase]. Volume may be null when the source does not provide it.
6 elements[
[
1788220800000,
78580,
78900,
78570.01,
78605.8,
522.70913
]
]
Was this page helpful?