API Reference

/rates Endpoint

Fetch the full exchange-rate snapshot for a date, or rebased to any base currency.


Endpoints

GET https://api.currency-core.com/v1/rates
GET https://api.currency-core.com/v1/rates/:base

/v1/rates returns the full snapshot with USD as the base. /v1/rates/:base returns the same snapshot re-expressed against any base currency, handy when your product thinks in EUR, INR, or anything other than USD. Neither endpoint converts a specific amount; for that, use /v1/convert.

Parameters

ParameterInDescription
:basepathBase currency (3-letter ISO 4217), e.g. USD, EUR.
datequeryYYYY-MM-DD. Defaults to the latest available date. History goes back to 1949. A date with no snapshot (weekend / holiday / gap) resolves to the most recent earlier one, see Historical dates.

Rates for a base currency

Every value is units of that currency per 1 unit of the base, the base itself is always 1.

curl "https://api.currency-core.com/v1/rates/EUR?date=2024-11-01" \
  -H "Authorization: Bearer cc_live_your_key"
{
  "base": "EUR",
  "date": "2024-11-01",
  "rates": {
    "EUR": 1,
    "USD": 1.0861,
    "INR": 91.62,
    "GBP": 0.835
  }
}

Rebasing is exact: units-per-base = (units-per-USD) / (base-units-per-USD).

Historical dates & carry-forward

Rates are never missing for an in-range date. Two fallbacks fill the gaps, and both are reported so you always know what you got:

  • Whole date missing (weekend, holiday, or a non-trading day): the response serves the most recent earlier snapshot. date is the date actually used, and requestedDate echoes what you asked for. It’s present only when the two differ.
  • One currency missing on an otherwise-present date (e.g. a currency not yet listed, or temporarily unquoted): its most recent prior rate is carried forward. Such currencies are listed in asOf (code → the date the value is from). asOf is present only when at least one rate was carried forward.
{
  "date": "2024-11-01",
  "requestedDate": "2024-11-03",
  "base": "USD",
  "rates": { "USD": 1, "EUR": 0.92, "INR": 84.07, "CLP": 947.6 },
  "asOf": { "CLP": "2024-10-31" }
}

Here 2024-11-03 (a Sunday) resolved back to Friday 2024-11-01, and CLP on that date carried its last value from 2024-10-31.

Errors

StatusCodeWhen
400invalid_inputBase isn’t a 3-letter code.
400unknown_currencyThe base currency isn’t in the snapshot.
404rate_not_foundNo rate data exists on or before the requested date (i.e. before history begins).