# /correlation Endpoint

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

Canonical: https://currency-core.com/docs/correlation-endpoint/
Updated: 2026-11-10
Published: 2026-06-17

---
## 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

| Parameter | Type | Required | Default | Notes |
|---|---|---|---|---|
| `currencies` | string | Yes | none | Comma-separated currencies to correlate with `base`, e.g. `GBP,CHF,SEK`. `currency` is accepted as an alias. Maximum 25 codes. |
| `base` | string | No | `USD` | Reference currency (3-letter ISO 4217). A non-USD base is usually more meaningful. |
| `from` | string | No | 365 days before `to` | Window start `YYYY-MM-DD` (UTC). Must be a real date. |
| `to` | string | No | Today (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.

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

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

## Response

```json
{
  "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

| Field | Type | Description |
|---|---|---|
| `base` | string | Reference currency. |
| `from` | string | Window start used (`YYYY-MM-DD`, UTC). |
| `to` | string | Window end used (`YYYY-MM-DD`, UTC). |
| `results` | array | One entry per compared currency. |
| `results[].currency` | string | The compared currency. |
| `results[].correlation` | number | Pearson correlation of daily returns versus `base`, from `-1` to `1`; `null` when undefined. |
| `results[].observations` | number | Number of overlapping daily returns used. |
| `results[].note` | string | Why correlation is `null`, when applicable. |

## Example

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

<CodeTabs>
<Fragment slot="curl">

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

</Fragment>
<Fragment slot="js">

```js
const res = await fetch(
  "https://api.currency-core.com/v1/correlation?base=EUR&currencies=GBP,CHF,SEK",
  { headers: { Authorization: "Bearer cc_live_your_key" } },
);
console.log((await res.json()).results);
```

</Fragment>
<Fragment slot="python">

```python

res = requests.get(
    "https://api.currency-core.com/v1/correlation",
    params={"base": "EUR", "currencies": "GBP,CHF,SEK"},
    headers={"Authorization": "Bearer cc_live_your_key"},
)
print(res.json()["results"])
```

</Fragment>
</CodeTabs>

**A longer window:**

```bash
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

| Status | Code | When |
|---|---|---|
| `400` | `invalid_input` | `currencies` 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. |
| `401` | `unauthorized` | The API key is missing or invalid. |
| `403` | `forbidden` | The plan is below Growth, the key is disabled, or billing is past due. |
| `429` | `rate_limited` | The per-minute rate limit was exceeded. Honor `Retry-After`. |

## Limits and related

- `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:

- [`/v1/volatility`](/docs/volatility-endpoint/) to measure how much each currency moves
- [`/v1/drawdown`](/docs/drawdown-endpoint/) for downside moves
- [`/v1/safe-haven`](/docs/safe-haven-endpoint/) for a combined safety ranking
- [Pricing](/pricing/) for Growth access
- [Rate limits](/docs/authentication/) for per-minute limits
