OHLC Candles
On this page, we’ll dive into the OHLC endpoint you can use to get hourly or daily candles (open, high, low, close) of up to 10 currencies, as JSON or CSV.
A candle tells you more than a single rate: where a currency started and ended an hour or a day, and how far it moved in between. Typical uses are candlestick charts, volatility checks and backtests.
Like /range, the OHLC endpoint needs a plan that includes the range endpoint. Hourly candles also need a plan with quarter-hourly updates or finer, daily candles a plan with hourly updates or finer. Otherwise the API responds with a 403, e.g. "You are not allowed to use the interval: hour, please upgrade your plan".
OHLC Candles
Returns the candles of every requested currency between datetime_start and datetime_end, oldest first.
Required attributes
- Name
currencies- Type
- string
- Description
1 to 10 comma separated currency codes (EUR,GBP) Alternatively you can provide a GET parameter array like so:
currencies[]=EUR¤cies[]=GBP
- Name
datetime_start- Type
- string
- Description
The start of the range (format: 2026-09-29T00:00:00Z / ISO8601 Datetime, or a date) The first candle is the one this moment falls in
- Name
datetime_end- Type
- string
- Description
The end of the range (format: 2026-09-30T23:59:59Z / ISO8601 Datetime, or a date), on or after
datetime_startThe last candle is the one this moment falls in
Optional attributes
- Name
interval- Type
- string
- Description
day(default) orhour, the length of each candle. For valid time ranges see below
- Name
base_currency- Type
- string
- Description
The base currency to which all results are behaving relative to By default all values are based on USD
- Name
shape- Type
- string
- Description
defaultorcompact. Withcompactevery candle is a plain array[datetime, open, high, low, close]
- Name
precision- Type
- integer
- Description
Round every value to this many decimals (
0to10) By default values carry up to 10 decimals
- Name
format- Type
- string
- Description
json(default),csvorxlsx. The CSV has one row per candle:datetime,base_currency,currency,open,high,low,closexlsxgives the same table as an Excel workbook, see Excel downloads
Valid time ranges
- Name
hour- Type
- Description
- built from the minute rates
datetime_startnot more than 7 days back- not more than 7 days between start and end
- needs a plan with quarter-hourly updates or finer
- Name
day- Type
- Description
- built from the hourly rates
datetime_startnot more than 3 months back- not more than 92 days between start and end
- needs a plan with hourly updates or finer
Ranges outside these limits return a 422. For daily rates further back, use /range.
Response Properties
- Name
meta.base_currency- Type
- string
- Description
The base currency of all values
- Name
meta.interval- Type
- string
- Description
hourorday
- Name
meta.datetime_start- Type
- string
- Description
The start of the first candle
- Name
meta.datetime_end- Type
- string
- Description
The start of the last candle (of the current one when
datetime_endlies in the future)
- Name
data.EUR[].datetime- Type
- string
- Description
The start of the hour or day
- Name
data.EUR[].open- Type
- float
- Description
The close of the candle before
- Name
data.EUR[].high- Type
- float
- Description
The highest rate in the candle
- Name
data.EUR[].low- Type
- float
- Description
The lowest rate in the candle
- Name
data.EUR[].close- Type
- float
- Description
The stored rate at the end of the hour or day
How the candles are built
- Close. Each candle closes on the rate stored at the end of its hour or day, the same rate
/rangereturns for that hour or day. - Open. Each candle opens on the close of the candle before it, as FX candles do. The first candle opens on the close before
datetime_start; after a gap in the data, a candle opens on its own close. - High and low. The extremes of the minute rates (hourly candles) or hourly rates (daily candles) in between. They never lie inside the open/close range, so a candle whose open is below every finer rate has the open as its low.
- Missing candles. Candles whose close is not stored yet, such as the hour or day still running, are left out.
A request costs one request of your quota, however many currencies and candles it holds. More than 10 currencies return a 422.
Compact and CSV
Compact candles
curl -G https://api.currencyapi.com/v3/ohlc \
-d currencies=EUR \
-d interval=hour \
-d datetime_start=2026-09-30T10:00:00Z \
-d datetime_end=2026-09-30T11:59:59Z \
-d shape=compact \
-H "apikey: YOUR-API-KEY"
Response
{
"meta": {
"base_currency": "USD",
"interval": "hour",
"datetime_start": "2026-09-30T10:00:00Z",
"datetime_end": "2026-09-30T11:00:00Z"
},
"data": {
"EUR": [
["2026-09-30T10:00:00Z", 0.91, 0.95, 0.9, 0.92],
["2026-09-30T11:00:00Z", 0.92, 0.925, 0.9165, 0.9188]
]
}
}
With format=csv:
Response (text/csv)
datetime,base_currency,currency,open,high,low,close
2026-09-30T10:00:00Z,USD,EUR,0.91,0.95,0.9,0.92
2026-09-30T11:00:00Z,USD,EUR,0.92,0.925,0.9165,0.9188
Request
curl -G https://api.currencyapi.com/v3/ohlc \
-d currencies=EUR \
-d interval=hour \
-d datetime_start=2026-09-30T10:00:00Z \
-d datetime_end=2026-09-30T11:59:59Z \
-H "apikey: YOUR-API-KEY"
Response
{
"meta": {
"base_currency": "USD",
"interval": "hour",
"datetime_start": "2026-09-30T10:00:00Z",
"datetime_end": "2026-09-30T11:00:00Z"
},
"data": {
"EUR": [
{
"datetime": "2026-09-30T10:00:00Z",
"open": 0.91,
"high": 0.95,
"low": 0.9,
"close": 0.92
},
{
"datetime": "2026-09-30T11:00:00Z",
"open": 0.92,
"high": 0.925,
"low": 0.9165,
"close": 0.9188
}
]
}
}