API Reference

/correlation Endpoint

Measure how currencies move together with a base using Pearson correlation of daily returns, with sign and magnitude guidance.


Endpoint

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

Measures how currencies move together: the Pearson correlation of each currency’s daily returns with a reference base currency’s, over a window. A value of +1 means the two move in lockstep, 0 means no linear relationship, and -1 means they move in opposite directions. This endpoint requires the Growth plan or higher.

Plan requirement

/v1/correlation uses the same historical-analytics entitlement as /history/analysis. Free and Starter keys receive HTTP 403 forbidden. Live keys require a paid plan.

Query parameters

ParameterTypeRequiredDefaultNotes
currenciesstringYesnoneComma-separated currencies to correlate with base, e.g. GBP,CHF,SEK. currency is accepted as an alias. Maximum 25 codes.
basestringNoUSDReference currency (3-letter ISO 4217). A non-USD base is usually more meaningful.
fromstringNo365 days before toWindow start YYYY-MM-DD (UTC). Must be a real date.
tostringNoToday (UTC)Window end YYYY-MM-DD (UTC). Future dates clamp to today.

The base currency itself is removed from the compared list. With base=USD, the base series is constant, so correlations come back null with a note explaining that a non-USD base is required.

How it is calculated

Daily returns are computed for the base and for each compared currency against the stored USD numeraire, then aligned by date. The result is the Pearson correlation of those overlapping daily returns over the window. observations is the number of overlapping returns used.

A result can be null when there is no history for the currency or when there are too few overlapping observations. note explains which case applied.

Choosing a base

Use a base that is economically meaningful for the question. If you are studying European currencies, base=EUR is more informative than base=USD, because every series is then measured against a common European reference. Against USD, USD crosses are often dominated by the dollar leg, which can make unrelated currencies look similar.

What null means

A null correlation is not zero correlation. It means the figure could not be computed: the currency had no history in the window, there were too few overlapping observations, or the base was USD and the base series is therefore constant. Read note to tell these cases apart. A genuine zero would come back as a number close to 0, not null.

A note on daily returns

Correlation is computed on daily returns, not on price levels. Two currencies can both trend upward over a year and still have a low correlation if their day-to-day moves are unrelated. This is why the endpoint is useful for co-movement questions and not for “do these two charts look similar” questions.

Reading the sign and magnitude

The sign tells you direction; the magnitude tells you strength. Correlation is not causation, and a high reading in one window can fade in another.

CorrelationRough reading
0.8 to 1.0Strong positive: they tend to move together
0.4 to 0.8Moderate positive
-0.4 to 0.4Weak or no clear linear relationship
-0.8 to -0.4Moderate negative
-1.0 to -0.8Strong negative: they tend to move opposite

These labels are interpretive, not API-defined thresholds. Compare readings measured over the same window and base.

Response

{
  "base": "EUR",
  "from": "2025-06-17",
  "to": "2026-06-17",
  "results": [
    { "currency": "GBP", "correlation": 0.94, "observations": 365 },
    { "currency": "CHF", "correlation": 0.88, "observations": 365 },
    { "currency": "SEK", "correlation": 0.81, "observations": 365 }
  ]
}

Response fields

FieldTypeDescription
basestringReference currency.
fromstringWindow start used (YYYY-MM-DD, UTC).
tostringWindow end used (YYYY-MM-DD, UTC).
resultsarrayOne entry per compared currency.
results[].currencystringThe compared currency.
results[].correlationnumberPearson correlation of daily returns versus base, from -1 to 1; null when undefined.
results[].observationsnumberNumber of overlapping daily returns used.
results[].notestringWhy correlation is null, when applicable.

Example

Correlation of GBP, CHF, and SEK with EUR over the last year:

curl "https://api.currency-core.com/v1/correlation?base=EUR&currencies=GBP,CHF,SEK" \
  -H "Authorization: Bearer cc_live_your_key"

A longer window:

curl "https://api.currency-core.com/v1/correlation?base=EUR&currencies=GBP,CHF,SEK&from=2021-01-01" \
  -H "Authorization: Bearer cc_live_your_key"

Errors

StatusCodeWhen
400invalid_inputcurrencies is missing; a currency code is invalid; more than 25 currencies; bad base; from after to; span over 20 years; or the base has no history in the window.
401unauthorizedThe API key is missing or invalid.
403forbiddenThe plan is below Growth, the key is disabled, or billing is past due.
429rate_limitedThe per-minute rate limit was exceeded. Honor Retry-After.
  • currencies is required; this endpoint has no all-currencies ranking mode.
  • Up to 25 compared currencies per request.
  • The window cannot exceed 20 years.
  • Each request consumes one monthly request and one per-minute rate-limit unit.

Related pages: