API Reference

REST API Reference

Browsable reference for all 15 CurrencyCore REST paths, generated from the OpenAPI 3.1 contract: parameters, auth, plan gates, response statuses, and schema names.


Reference overview

This reference is generated from the committed OpenAPI contract. It lists all 15 REST paths, their parameters, response statuses, and response schema names. The contract is CurrencyCore API v1, published as OpenAPI 3.1.0.

Base URL
https://api.currency-core.com/v1
Paths
15
Auth
Bearer or x-api-key
Plan gates
7 paths require Growth and higher
Errors
ApiError envelope

Every operation in this contract is GET and reads its inputs from the URL. Paths below are relative to the base URL. The spec defines no request bodies. All responses are JSON.

Authentication

Keyed endpoints accept either header shown below. The spec defines no query-string authentication, so the key belongs in a request header.

Authentication schemes defined by the OpenAPI contract
Scheme Header Description
bearerAuth Authorization: Bearer <key> Your CurrencyCore API key, e.g. cc_live_….
apiKeyAuth x-api-key: <key> Your CurrencyCore API key. Equivalent to Authorization: Bearer <key>.

The public paths are /countries and /currencies . They mount without a key and are not metered.

Copy as cURL: GET /v1/convert

curl "https://api.currency-core.com/v1/convert?from=USD&to=EUR%2CINR&amount=100" \
  -H "Authorization: Bearer $CURRENCY_CORE_API_KEY"

The example uses values published in the spec. Set CURRENCY_CORE_API_KEY in your shell before running it.

Errors

Non-2xx JSON responses in the spec reference the ApiError schema: a single error object with a machine-readable code, a human-readable message, and an optional details object.

Fields published for the ApiError schema
Field Type Required Description
error object Yes Not published
error.code string Yes Not published
error.message string Yes Not published
error.details No schema published No Not published

Error codes listed in the spec enum

  • invalid_input
  • unsupported_query
  • unknown_currency
  • unknown_ppp
  • rate_not_found
  • unauthorized
  • forbidden
  • billing_past_due
  • rate_limited
  • internal_error

The details field has no published schema in the spec, so this reference does not describe its keys.

Plan gates

7 paths publish x-min-plan-tier: growth in the OpenAPI contract. Their 403 response is described as requiring the growth plan or higher.

Paths without x-min-plan-tier do not publish a plan tier in the spec. /history still describes a Free-plan limit of the last 30 days in its 403 response, and /ai has its own enablement and input-size responses.

Core

Conversion and the current or dated exchange-rate snapshot.

GET /convert

Convert

Convert an amount between currencies, optionally PPP-adjusted.

Auth
Bearer or x-api-key

Parameters

Parameters for GET /convert
Name In Required Type Description
from query Yes string Source currency (ISO 4217), e.g. USD. For PPP (ppp=true), pass CUR:COUNTRY (e.g. USD:USA) when the currency is used in more than one country; common currencies are resolved automatically.
to query Yes string One or more target currencies, comma-separated, e.g. EUR,INR (max 25). For PPP, pass CUR:COUNTRY pairs (e.g. EUR:DEU,INR:IND) when a currency is used in more than one country; common currencies are resolved automatically.
amount query No number Amount to convert. Optional, defaults to 1 (so each result equals the rate). When provided it must be a finite positive number.
ppp query No boolean When true, apply a PPP adjustment. Pass CUR:COUNTRY for currencies used in more than one country; common currencies (USD, EUR, INR and others) resolve automatically.
date query No string Rate date in YYYY-MM-DD (UTC). Must not be in the future. Defaults to latest.

Responses

Responses for GET /convert
Status Description Schema
200 Successful response. ConvertResponse
400 Invalid or missing request parameters. ApiError
401 Missing or invalid API key. ApiError
402 Billing is past due; API access is paused until payment is cleared. ApiError
403 Forbidden: the Free plan is limited to the last 30 days of historical date= data and cannot use live keys; upgrade for access. ApiError
429 Rate limit or monthly quota exceeded. ApiError
default Unexpected error. ApiError
200 response schema: ConvertResponse
Top-level fields for ConvertResponse
Field Type Required Description
from string Yes Not published
fromCountry string No Not published
amount number Yes Not published
date string Yes Not published
requestedDate string No Not published
asOf object (string values) No Not published
results array of object Yes Not published
message string No Not published
GET /rates

Rates

The full exchange-rate snapshot for a date (USD base).

Auth
Bearer or x-api-key

Parameters

Parameters for GET /rates
Name In Required Type Description
date query No string YYYY-MM-DD. Defaults to the latest available date.

Responses

Responses for GET /rates
Status Description Schema
200 Successful response. RatesResponse
400 Invalid or missing request parameters. ApiError
401 Missing or invalid API key. ApiError
402 Billing is past due; API access is paused until payment is cleared. ApiError
403 Forbidden: the Free plan is limited to the last 30 days of historical date= data and cannot use live keys; upgrade for access. ApiError
404 No exchange-rate snapshot is available for the requested date. ApiError
429 Rate limit or monthly quota exceeded. ApiError
default Unexpected error. ApiError
200 response schema: RatesResponse
Top-level fields for RatesResponse
Field Type Required Description
date string Yes Not published
base string (always "USD") Yes Not published
rates object (number values) Yes Not published
requestedDate string No Not published
asOf object (string values) No Not published
GET /rates/{base}

Rates by base

The same snapshot re-expressed against any base currency.

Auth
Bearer or x-api-key

Parameters

Parameters for GET /rates/{base}
Name In Required Type Description
base path Yes string Base currency (3-letter ISO 4217), e.g. EUR.
date query No string YYYY-MM-DD. Defaults to the latest available date.

Responses

Responses for GET /rates/{base}
Status Description Schema
200 Successful response. RatesByBaseResponse
400 Invalid or missing request parameters. ApiError
401 Missing or invalid API key. ApiError
402 Billing is past due; API access is paused until payment is cleared. ApiError
403 Forbidden: the Free plan is limited to the last 30 days of historical date= data and cannot use live keys; upgrade for access. ApiError
404 No exchange-rate snapshot is available for the requested date or base currency. ApiError
429 Rate limit or monthly quota exceeded. ApiError
default Unexpected error. ApiError
200 response schema: RatesByBaseResponse
Top-level fields for RatesByBaseResponse
Field Type Required Description
base string Yes Not published
date string Yes Not published
requestedDate string No Not published
asOf object (string values) No Not published
rates object (number values) Yes Not published
ppp object No Not published

History

Daily rate series and analysis over a date window.

GET /history

History

A single currency's daily rate time series over a date range. Free: last 30 days; Starter and above: full history.

Auth
Bearer or x-api-key

Parameters

Parameters for GET /history
Name In Required Type Description
currency query Yes string The currency whose history to fetch (3-letter ISO 4217), e.g. INR. One currency per call.
from query No string Start date YYYY-MM-DD (UTC). Defaults to 7 days before to.
to query No string End date YYYY-MM-DD (UTC). Defaults to today; a future date clamps to today.
base query No string Base currency the rates are expressed against (3-letter ISO 4217). Defaults to USD.
interval query No string Aggregation: daily (default), weekly, monthly, or yearly. Coarser intervals average the daily rates per bucket (weekly key = the week's Monday, monthly = YYYY-MM, yearly = YYYY).

Responses

Responses for GET /history
Status Description Schema
200 Successful response. HistoryResponse
400 Invalid or missing request parameters. ApiError
401 Missing or invalid API key. ApiError
402 Billing is past due; API access is paused until payment is cleared. ApiError
403 Forbidden: the Free plan limits history to the last 30 days. Upgrade to Starter or higher for full history. ApiError
404 No history is available for the requested currency. ApiError
429 Rate limit or monthly quota exceeded. ApiError
default Unexpected error. ApiError
200 response schema: HistoryResponse
Top-level fields for HistoryResponse
Field Type Required Description
currency string Yes Not published
base string Yes Not published
interval string Yes Not published
from string Yes Not published
to string Yes Not published
rates object (number values) Yes Not published
GET /history/analysis Growth and higher

History analysis

Trends, comparisons & 'movers': % change, strength, and min/max/avg over a window. Growth plan or higher.

Auth
Bearer or x-api-key

Parameters

Parameters for GET /history/analysis
Name In Required Type Description
base query No string Currency everything is measured against (3-letter ISO 4217). Defaults to USD.
currencies query No string Comma-separated currencies to compare, e.g. GBP,EUR,AED. OMIT to rank ALL currencies vs base ('movers' mode).
from query No string Window start YYYY-MM-DD (UTC). Defaults to 20 years (2 decades) before to. See period for a shorthand.
to query No string Window end YYYY-MM-DD (UTC). Defaults to today; a future date clamps to today.
period query No string Relative window shorthand for from: e.g. 10y, 6m, 30d, ytd, max. Ignored if from is given.
sort query No string Movers ranking: strengthened (default) or weakened.
assetClass query No string Movers universe: fiat (default, the liquid tradeable currencies), metals (XAU/XAG/XPT/XPD), or all (every currency incl. illiquid/frontier). fiat excludes metals/synthetics + illiquid frontier codes; redenomination artifacts are always dropped.
limit query No number Movers: how many top results to return (default 10, max 200).
interval query No string Attach a trend series per named currency: weekly, monthly, or yearly (compare mode only).
stats query No boolean Include min/max/avg over the window per currency. Defaults to true; pass false to skip.

Responses

Responses for GET /history/analysis
Status Description Schema
200 Successful response. HistoryAnalysisResponse
400 Invalid or missing request parameters. ApiError
401 Missing or invalid API key. ApiError
402 Billing is past due; API access is paused until payment is cleared. ApiError
403 Requires the growth plan or higher. ApiError
404 No rate data is available at or before the requested start or end date. ApiError
429 Rate limit or monthly quota exceeded. ApiError
default Unexpected error. ApiError
200 response schema: HistoryAnalysisResponse
Top-level fields for HistoryAnalysisResponse
Field Type Required Description
base string Yes Not published
from string Yes Not published
to string Yes Not published
mode string Yes Not published
sort string No Not published
assetClass string No Not published
interval string No Not published
stats boolean Yes Not published
results array of object Yes Not published

PPP

Purchasing-power-parity factors and PPP change over time.

GET /ppp

PPP factor

A single country's purchasing-power-parity conversion factor for a year (IMF World Economic Outlook).

Auth
Bearer or x-api-key

Parameters

Parameters for GET /ppp
Name In Required Type Description
country query Yes string Country as an ISO 3166-1 alpha-3 code (e.g. IND).
year query No number Four-digit year. Defaults to the configured current PPP year (2024).

Responses

Responses for GET /ppp
Status Description Schema
200 Successful response. PppResponse
400 Invalid or missing request parameters. ApiError
401 Missing or invalid API key. ApiError
402 Billing is past due; API access is paused until payment is cleared. ApiError
403 Forbidden for this key/plan (entitlement, billing, or key-environment restriction). ApiError
404 No PPP factor is available for the requested country and year. ApiError
429 Rate limit or monthly quota exceeded. ApiError
default Unexpected error. ApiError
200 response schema: PppResponse
Top-level fields for PppResponse
Field Type Required Description
year number Yes Not published
countryCode string Yes Not published
pppFactor number Yes Not published
projected boolean Yes Not published
GET /ppp/analysis Growth and higher

PPP analysis

PPP over time: how a country's purchasing-power-parity factor changed, comparing countries, or 'movers'. Growth plan or higher.

Auth
Bearer or x-api-key

Parameters

Parameters for GET /ppp/analysis
Name In Required Type Description
countries query No string Comma-separated ISO 3166-1 alpha-3 country codes to compare, e.g. IND,DEU,USA. OMIT to rank ALL countries by PPP-factor change ('movers' mode).
from query No string Window start YEAR (e.g. 2015). Defaults to 10 years before to. See period for a shorthand.
to query No string Window end YEAR (e.g. 2024). Defaults to the current year.
period query No string Relative window shorthand for from: e.g. 10y, 20y, max. Ignored if from is given.
sort query No string Movers ranking: increased (PPP factor rose most, default) or decreased.
limit query No number Movers: how many top results to return (default 10, max 200).
stats query No boolean Include min/max/avg of the PPP factor over the window per country. Defaults to true; pass false to skip.

Responses

Responses for GET /ppp/analysis
Status Description Schema
200 Successful response. PppAnalysisResponse
400 Invalid or missing request parameters. ApiError
401 Missing or invalid API key. ApiError
402 Billing is past due; API access is paused until payment is cleared. ApiError
403 Requires the growth plan or higher. ApiError
429 Rate limit or monthly quota exceeded. ApiError
default Unexpected error. ApiError
200 response schema: PppAnalysisResponse
Top-level fields for PppAnalysisResponse
Field Type Required Description
from number Yes Not published
to number Yes Not published
mode string Yes Not published
sort string No Not published
stats boolean Yes Not published
results array of object Yes Not published

Analytics

Window metrics for volatility, correlation, drawdown, safe haven, and mean reversion.

GET /volatility Growth and higher

Volatility

Annualized volatility of a currency vs a base, or a stability ranking of the liquid currencies. Growth plan or higher.

Auth
Bearer or x-api-key

Parameters

Parameters for GET /volatility
Name In Required Type Description
currency query No string Currency to measure (3-letter ISO 4217), or a comma-separated list to compare. OMIT to RANK the liquid-currency set by stability.
base query No string Base currency to measure against (3-letter ISO 4217). Defaults to USD.
from query No string Window start YYYY-MM-DD (UTC). Defaults to 365 days before to.
to query No string Window end YYYY-MM-DD (UTC). Defaults to today; a future date clamps to today.
sort query No string Ranking direction: stable (least volatile first, default) or volatile.
universe query No string Ranking universe: liquid (default, broad set) or majors (USD/EUR/GBP/JPY/CHF/CAD/AUD/NZD). Use majors for 'most volatile major pair'.
limit query No number Ranking: how many to return (default 10, max 50).

Responses

Responses for GET /volatility
Status Description Schema
200 Successful response. VolatilityResponse
400 Invalid or missing request parameters. ApiError
401 Missing or invalid API key. ApiError
402 Billing is past due; API access is paused until payment is cleared. ApiError
403 Requires the growth plan or higher. ApiError
429 Rate limit or monthly quota exceeded. ApiError
default Unexpected error. ApiError
200 response schema: VolatilityResponse
Top-level fields for VolatilityResponse
Field Type Required Description
base string Yes Not published
from string Yes Not published
to string Yes Not published
mode string Yes Not published
sort string No Not published
universe string No Not published
basis string (always "annualized-daily") Yes Not published
results array of object Yes Not published
GET /correlation Growth and higher

Correlation

Correlation of each currency's daily returns with a base currency's, over a window. Growth plan or higher.

Auth
Bearer or x-api-key

Parameters

Parameters for GET /correlation
Name In Required Type Description
base query No string Reference currency to correlate against (3-letter ISO 4217). Defaults to USD (a non-USD base is more meaningful).
currencies query Yes string Comma-separated currencies to correlate with base, e.g. GBP,CHF,SEK.
from query No string Window start YYYY-MM-DD (UTC). Defaults to 365 days before to.
to query No string Window end YYYY-MM-DD (UTC). Defaults to today.

Responses

Responses for GET /correlation
Status Description Schema
200 Successful response. CorrelationResponse
400 Invalid or missing request parameters. ApiError
401 Missing or invalid API key. ApiError
402 Billing is past due; API access is paused until payment is cleared. ApiError
403 Requires the growth plan or higher. ApiError
429 Rate limit or monthly quota exceeded. ApiError
default Unexpected error. ApiError
200 response schema: CorrelationResponse
Top-level fields for CorrelationResponse
Field Type Required Description
base string Yes Not published
from string Yes Not published
to string Yes Not published
results array of object Yes Not published
GET /drawdown Growth and higher

Drawdown

Maximum peak-to-trough decline vs a base (with peak/trough/recovery), or a drawdown ranking. Growth plan or higher.

Auth
Bearer or x-api-key

Parameters

Parameters for GET /drawdown
Name In Required Type Description
currency query No string Currency to measure (3-letter ISO 4217), or a comma-separated list. OMIT to RANK the liquid set by drawdown.
base query No string Base currency to measure against (3-letter ISO 4217). Defaults to USD.
from query No string Window start YYYY-MM-DD (UTC). Defaults to 365 days before to.
to query No string Window end YYYY-MM-DD (UTC). Defaults to today.
sort query No string Ranking direction: deepest (largest decline first, default) or recovery (fastest recovery first).
universe query No string Ranking universe: liquid (default) or majors.
limit query No number Ranking: how many to return (default 10, max 50).

Responses

Responses for GET /drawdown
Status Description Schema
200 Successful response. DrawdownResponse
400 Invalid or missing request parameters. ApiError
401 Missing or invalid API key. ApiError
402 Billing is past due; API access is paused until payment is cleared. ApiError
403 Requires the growth plan or higher. ApiError
429 Rate limit or monthly quota exceeded. ApiError
default Unexpected error. ApiError
200 response schema: DrawdownResponse
Top-level fields for DrawdownResponse
Field Type Required Description
base string Yes Not published
from string Yes Not published
to string Yes Not published
mode string Yes Not published
sort string No Not published
universe string No Not published
results array of object Yes Not published
GET /safe-haven Growth and higher

Safe haven

Ranks currencies by a composite safe-haven score (low volatility + shallow drawdown + 2008-crisis resilience). Growth plan or higher.

Auth
Bearer or x-api-key

Parameters

Parameters for GET /safe-haven
Name In Required Type Description
currencies query No string Comma-separated currencies to score, e.g. CHF,JPY. OMIT to rank the liquid-fiat safe-haven pool (precious metals are not supported).
base query No string Base currency to measure against (3-letter ISO 4217). Defaults to USD.
from query No string Window start YYYY-MM-DD (UTC). Defaults to 2007-01-01 (spans the 2008 crisis + COVID), or to 20 years before to when that is later.
to query No string Window end YYYY-MM-DD (UTC). Defaults to today.
limit query No number How many to return (default 10, max 50).

Responses

Responses for GET /safe-haven
Status Description Schema
200 Successful response. SafeHavenResponse
400 Invalid or missing request parameters. ApiError
401 Missing or invalid API key. ApiError
402 Billing is past due; API access is paused until payment is cleared. ApiError
403 Requires the growth plan or higher. ApiError
429 Rate limit or monthly quota exceeded. ApiError
default Unexpected error. ApiError
200 response schema: SafeHavenResponse
Top-level fields for SafeHavenResponse
Field Type Required Description
base string Yes Not published
from string Yes Not published
to string Yes Not published
crisis object Yes Not published
universe string No Not published
results array of object Yes Not published
GET /mean-reversion Growth and higher

Mean reversion

Ranks currencies by how strongly they revert to their mean (crossing frequency + reversion half-life). Growth plan or higher.

Auth
Bearer or x-api-key

Parameters

Parameters for GET /mean-reversion
Name In Required Type Description
currencies query No string Comma-separated currencies to score, e.g. EUR,GBP. OMIT to rank the liquid set.
base query No string Base currency to measure against (3-letter ISO 4217). Defaults to USD.
from query No string Window start YYYY-MM-DD (UTC). Defaults to ~2 years before to.
to query No string Window end YYYY-MM-DD (UTC). Defaults to today.
limit query No number How many to return (default 10, max 50).

Responses

Responses for GET /mean-reversion
Status Description Schema
200 Successful response. MeanReversionResponse
400 Invalid or missing request parameters. ApiError
401 Missing or invalid API key. ApiError
402 Billing is past due; API access is paused until payment is cleared. ApiError
403 Requires the growth plan or higher. ApiError
429 Rate limit or monthly quota exceeded. ApiError
default Unexpected error. ApiError
200 response schema: MeanReversionResponse
Top-level fields for MeanReversionResponse
Field Type Required Description
base string Yes Not published
from string Yes Not published
to string Yes Not published
universe string No Not published
results array of object Yes Not published

Reference

Supported countries and currencies. Both paths are public.

GET /countries Public

Countries

The supported countries and their official currencies. Public, no key needed.

Auth
Public, no key

Parameters

No parameters. This endpoint takes no input.

Responses

Responses for GET /countries
Status Description Schema
200 Successful response. CountriesResponse
400 Invalid or missing request parameters. ApiError
default Unexpected error. ApiError
200 response schema: CountriesResponse

The 200 response is an array of objects.

Top-level fields for CountriesResponse
Field Type Required Description
code string Yes Not published
name string Yes Not published
currencies array of string No Not published
GET /currencies Public

Currencies

The full list of supported ISO 4217 currencies. Use it to resolve a name or symbol to its code, or to check whether a currency is supported (so a missing one fails clearly, not silently). Public, no key needed.

Auth
Public, no key

Parameters

No parameters. This endpoint takes no input.

Responses

Responses for GET /currencies
Status Description Schema
200 Successful response. CurrenciesResponse
400 Invalid or missing request parameters. ApiError
default Unexpected error. ApiError
200 response schema: CurrenciesResponse

The 200 response is an array of objects.

Top-level fields for CurrenciesResponse
Field Type Required Description
code string Yes Not published
numeric string Yes ISO 4217 numeric code, zero-padded (e.g. 840). Empty string for documented non-ISO codes (CNH, GGP, IMP, JEP).
name string Yes Not published
symbol string Yes Not published

AI

Natural-language currency questions with structured data in the response.

GET /ai

AI

Ask a natural-language currency question; the model answers using live rates.

Auth
Bearer or x-api-key

Parameters

Parameters for GET /ai
Name In Required Type Description
q query Yes string A natural-language question, e.g. "Convert 50 euro to indian rupees" or "What's the USD to EUR rate today?".

Responses

Responses for GET /ai
Status Description Schema
200 Successful response. AiResponse
400 Invalid or missing request parameters. ApiError
401 Missing or invalid API key. ApiError
402 Billing is past due; API access is paused until payment is cleared. ApiError
403 The AI endpoint is disabled globally or for this organization. ApiError
413 The question exceeds the input-size limit for your plan. ApiError
422 The question is off-topic (only currency, FX, and PPP questions are answered). ApiError
429 Rate limit or monthly quota exceeded. ApiError
503 The AI service is temporarily unavailable; retry the request later. ApiError
default Unexpected error. ApiError
200 response schema: AiResponse
Top-level fields for AiResponse
Field Type Required Description
query string Yes Not published
answer string Yes Not published
data array (item schema not published) Yes Not published
toolCalls number No Not published
byok boolean No Not published

The spec publishes data as an array without an item schema. This reference does not describe the per-item shape.

Source of truth: packages/shared/openapi.json. The same contract is published at /openapi.json and described in the OpenAPI guide.