API Reference

/history Endpoint

Fetch a dense day-by-day time series of one currency's exchange rate over a date range.


Endpoint

GET https://api.currency-core.com/v1/history

Returns a daily time series for one currency against a base, as a dense date→rate map, one entry per calendar day in the range. For a single date’s full snapshot use /v1/rates; to convert a specific amount use /v1/convert.

For trends, comparisons and movers, see /history/analysis.

Plan requirement

/v1/history is available on the Growth plan and higher. Keys on the Free and Starter plans receive HTTP 403 forbidden:

{ "error": "forbidden", "message": "The /v1/history endpoint requires the Growth plan or higher." }

Query parameters

ParameterTypeRequiredDescription
currencystringYesA single 3-letter ISO 4217 code, e.g. INR. One currency per call, call again for more.
fromstringNoStart date YYYY-MM-DD (UTC, inclusive). Defaults to to minus 7 days.
tostringNoEnd date YYYY-MM-DD (UTC, inclusive). Defaults to today. Future dates clamp to today.
basestringNoBase currency (3-letter ISO 4217). Defaults to USD.
intervalstringNodaily (default), weekly, monthly, or yearly. Coarser intervals average the daily rates per bucket.

All dates are UTC calendar dates, so results don’t shift with the caller’s local timezone. When from and to are both omitted you get the trailing 8 days (today and the 7 days before it).

Response

rates is a dense map: every calendar day in [from, to] is present, even weekends, holidays, and non-trading days. Each value is units of currency per 1 base. Gaps are filled by carrying the most recent earlier rate forward, and today is always included with the live rate.

{
  "currency": "INR",
  "base": "USD",
  "interval": "daily",
  "from": "2026-06-09",
  "to": "2026-06-16",
  "rates": {
    "2026-06-09": 83.10,
    "2026-06-10": 83.14,
    "2026-06-11": 83.21,
    "2026-06-12": 83.18,
    "2026-06-13": 83.18,
    "2026-06-14": 83.18,
    "2026-06-15": 83.30,
    "2026-06-16": 83.42
  }
}

Here 2026-06-13 and 2026-06-14 (a weekend) carry 2026-06-12’s rate forward, and 2026-06-16 is today’s live rate.

Response fields

FieldTypeDescription
currencystringThe currency you requested, echoed back.
basestringThe base currency used (defaults to USD).
intervalstringThe aggregation interval applied (daily / weekly / monthly / yearly).
fromstringStart date of the range actually returned (YYYY-MM-DD, UTC).
tostringEnd date of the range actually returned (YYYY-MM-DD, UTC).
ratesobjectFor daily, a dense date → rate map (one entry per calendar day). For coarser intervals, a period → average rate map. Each rate is units of currency per 1 base.

Aggregation (interval)

By default (interval=daily) you get one entry per calendar day. Pass weekly, monthly, or yearly to average the daily rates within each bucket, useful for charts and long ranges. Partial buckets at the edges of the range average only the days that fall inside [from, to]. Bucket keys:

intervalKey formatExample key
dailyYYYY-MM-DD (the day)2026-06-16
weeklyYYYY-MM-DD (the week’s Monday, UTC)2026-06-15
monthlyYYYY-MM (the month)2026-06
yearlyYYYY (the year)2026
curl "https://api.currency-core.com/v1/history?currency=INR&from=2024-01-01&to=2026-06-16&interval=monthly" \
  -H "Authorization: Bearer cc_live_your_key"
{
  "currency": "INR",
  "base": "USD",
  "interval": "monthly",
  "from": "2024-01-01",
  "to": "2026-06-16",
  "rates": { "2024-01": 82.97, "2024-02": 83.04, "2026-06": 83.25 }
}

Example requests

A one-week series for INR against USD:

curl "https://api.currency-core.com/v1/history?currency=INR&from=2026-06-09&to=2026-06-16&base=USD" \
  -H "Authorization: Bearer cc_live_your_key"

Trailing 8 days (defaults), rebased to EUR:

curl "https://api.currency-core.com/v1/history?currency=INR&base=EUR" \
  -H "Authorization: Bearer cc_live_your_key"

Errors

StatusCodeWhen
400invalid_inputcurrency is missing or not a 3-letter code, base isn’t a 3-letter code, or a date isn’t a valid YYYY-MM-DD.
400unknown_currencycurrency or base isn’t a known currency.
403forbiddenYour plan is below Growth (Free / Starter).