API Reference

/history Endpoint

Fetch a dense day-by-day time series for one currency, with interval averaging, carry-forward gaps, and plan history limits.


Endpoint

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

Returns a daily time series for one currency against a base, as a dense date-to-rate map with 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 /v1/history/analysis.

Plan requirement

/v1/history is available on every plan. The lookback window depends on your plan:

PlanHistory window
FreeLast 30 days
Starter and aboveFull history (GBP/USD and USD/INR parity from 1949; other pairs start later)

A Free key requesting a from older than 30 days receives HTTP 403 forbidden:

{
  "error": {
    "code": "forbidden",
    "message": "Your plan limits historical data to the last 30 days. Upgrade to Starter or higher for full history access."
  }
}

Live keys require a paid plan. The Growth plan or higher requirement applies only to the analytics endpoint, /v1/history/analysis.

Query parameters

ParameterTypeRequiredDefaultNotes
currencystringYesnoneA single 3-letter ISO 4217 code, e.g. INR. One currency per call; call again for more.
fromstringNoto minus 7 daysStart date YYYY-MM-DD (UTC, inclusive). Must be a real calendar date. Values before 1949-12-30 clamp to that date.
tostringNoToday (UTC)End date YYYY-MM-DD (UTC, inclusive). A future date clamps to today.
basestringNoUSDBase currency (3-letter ISO 4217).
intervalstringNodailydaily, weekly, monthly, or yearly. Coarser intervals average the daily rates per bucket.

All dates are UTC calendar dates, so results do not 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, including 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 included from the current rate snapshot.

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

Here 2024-06-09 is a Sunday, so it carries the previous Friday’s rate forward, and the series resumes on Monday 2024-06-10.

Response fields

FieldTypeDescription
currencystringThe currency you requested, echoed back in uppercase.
basestringThe base currency used (defaults to USD).
intervalstringThe aggregation interval applied (daily, weekly, monthly, or 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 to rate map. For coarser intervals, a period to average-rate map. Each rate is units of currency per 1 base.

Aggregation

By default (interval=daily) you get one entry per calendar day. Pass weekly, monthly, or yearly to average the daily rates within each bucket, which is 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)2024-06-16
weeklyYYYY-MM-DD (the week’s Monday, UTC)2024-06-10
monthlyYYYY-MM (the month)2024-06
yearlyYYYY (the year)2024
curl "https://api.currency-core.com/v1/history?currency=INR&from=2024-01-01&to=2024-02-29&interval=monthly" \
  -H "Authorization: Bearer cc_live_your_key"
{
  "currency": "INR",
  "base": "USD",
  "interval": "monthly",
  "from": "2024-01-01",
  "to": "2024-02-29",
  "rates": { "2024-01": 82.97, "2024-02": 83.04 }
}

Data coverage

History starts at 1949-12-30. A currency that did not exist yet, or was not quoted on a date, has no entry before its first quote; the response does not invent one. For dates after that first quote, gaps are carried forward, so the series stays dense. If you need to know whether a specific day was a real quote or a carried value, compare the value with the prior day or use /v1/rates, which reports asOf.

Reading the series

  • The series is quoted as units of currency per 1 base. For currency=INR&base=USD, a rising number means the rupee weakened against the dollar; a falling number means it strengthened.
  • Because gaps are carried forward, flat runs are expected on weekends and holidays. They are not missing data.
  • A coarser interval is an average of the daily values in that bucket, not an end-of-period snapshot.

Example requests

A one-week series for INR against USD:

curl "https://api.currency-core.com/v1/history?currency=INR&from=2024-06-09&to=2024-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 is not a 3-letter code, interval is invalid, a date is not a real YYYY-MM-DD, or from is after to.
400unknown_currencybase is unknown or has no history in the window.
401unauthorizedThe API key is missing or invalid.
403forbiddenA Free key requested a from older than the 30-day Free window, the key is disabled, or billing is past due.
404unknown_currencycurrency has no history available.
429rate_limitedThe per-minute rate limit was exceeded. Honor Retry-After.
  • One currency per request. For several series, make one request per currency.
  • Free plan is limited to the last 30 days; Starter and above get full history.
  • No maximum span is enforced on this endpoint; cost does not scale with the requested window because history is read as one stored series and sliced in memory.
  • Each request consumes one monthly request and one per-minute rate-limit unit.

Related pages: