Hourly or daily OHLC candles
getOhlcReturns open, high, low and close per hour or per day for 1 to 10 currencies, built from the stored rates. Requires a plan that includes the range endpoint (medium and up).
hour: 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.day(default): 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.
Each candle closes on the stored rate at the end of its hour or day and opens on the close of the candle before it (on its own close after a gap); high and low are the extremes of the finer rates in between and always include the open and the close. datetime is the start of the candle. Candles whose close is not stored yet (e.g. the hour or day still running) are left out. A request costs one request, however many currencies and candles it holds.
shape=compact gives every candle as [datetime, open, high, low, close], precision rounds, and format=csv gives one row per candle: datetime,base_currency,currency,open,high,low,close.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| shape | No | `default`: every rate as `{"code": "EUR", "value": 0.918456}`. `compact`: plain values, `"EUR": 0.918456`. | |
| format | No | `json` (default), `csv` or `xlsx`. CSV has a header line and one row per currency (and point in time), values without exponent notation. `xlsx` is the same table as an Excel workbook (one sheet, bold frozen header row, numbers as numbers), sent as a download named after the endpoint, e.g. `latest.xlsx`. | |
| interval | No | The length of each candle. | |
| precision | No | Round every value to this many decimals (0 to 10). By default values carry up to 10 decimals (10 significant digits below 0.1). | |
| currencies | Yes | 1 to 10 currency codes, comma-separated (e.g. `EUR,GBP`) or as `currencies[]=`. | |
| datetime_end | Yes | End of the range as an ISO 8601 datetime or date, on or after `datetime_start`. The last candle is the one this moment falls in. | |
| base_currency | No | The base currency that all returned values are relative to. Defaults to `USD`. | |
| datetime_start | Yes | Start of the range as an ISO 8601 datetime or date (e.g. `2026-09-29T00:00:00Z`). The first candle is the one this moment falls in. |