API Reference

/mean-reversion Endpoint

Rank currencies by how strongly they revert to their window mean, using crossing frequency, half-life, and current deviation.


Endpoint

GET https://api.currency-core.com/v1/mean-reversion

Ranks currencies by how strongly they return to their mean (“fair value”) over the window. Each result carries a composite score from 0 to 100, where higher means more mean-reverting, built from two transparent components measured against base:

  • Crossing frequency: how often the rate crosses its window mean. More crossings mean the rate oscillates around fair value rather than trending.
  • Reversion half-life: the estimated time for a deviation to halve, derived from an AR(1) fit of the demeaned series. A shorter half-life means faster reversion.

Each result also reports the current deviation from the mean, so you can see which currencies are stretched right now. This endpoint requires the Growth plan or higher.

Plan requirement

/v1/mean-reversion 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
currenciesstringNononeComma-separated currencies to score, e.g. EUR,GBP. Omit to rank the universe. currency is accepted as an alias. Maximum 40 codes.
basestringNoUSDBase currency to measure against.
fromstringNoAbout 2 years 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.
universestringNoliquidUniverse to rank when currencies is omitted: liquid or majors.
limitnumberNo10How many to return when ranking. Maximum 50.

There is no sort parameter. Results are ordered by score from highest to lowest, in both named and ranking modes.

How the score is built

The score is a 50/50 blend of two clamped components:

  • Crossing score: crossing frequency scaled so 0.5 crossings per observation reaches 100 and 0 reaches 0.
  • Speed score: 100 minus the half-life in days, clamped to 0 to 100. A half-life of 0 days contributes 100; a half-life of 100 days or more contributes 0.

The final score is rounded to one decimal place. A null half-life, which means the series did not revert, contributes a speed score of zero rather than a negative value.

Reading the score and half-life

  • A high score means the rate crossed its mean often and deviations decayed quickly. That is the pattern mean-reversion strategies look for.
  • A low score means the rate trended or wandered instead of snapping back.
  • halfLifeDays is the estimated time for a deviation to shrink by half. Shorter is faster. It is null when the fit does not imply reversion, which is not the same as a zero half-life.
  • deviationPct is the current signed distance from the window mean. A positive value means the rate is above its mean; a negative value means it is below.

Mean reversion is a statistical description of the window, not a prediction. A currency can score high in one window and low in the next, and a pegged currency can look mean-reverting because it is held near a fixed level.

Response

{
  "base": "USD",
  "from": "2024-06-17",
  "to": "2026-06-17",
  "universe": "liquid",
  "results": [
    {
      "currency": "EUR",
      "score": 72.8,
      "deviationPct": -1.2,
      "reversionFrequency": 0.32,
      "halfLifeDays": 18.4
    },
    {
      "currency": "GBP",
      "score": 65.0,
      "deviationPct": 0.8,
      "reversionFrequency": 0.27,
      "halfLifeDays": 24.1
    }
  ]
}

Response fields

FieldTypeDescription
basestringBase currency the mean is measured against.
fromstringWindow start used (YYYY-MM-DD, UTC).
tostringWindow end used (YYYY-MM-DD, UTC).
universestringUniverse ranked when no currencies were named.
resultsarrayCurrencies ordered by score, highest first.
results[].currencystringThe currency code.
results[].scorenumberComposite 0 to 100 score, higher means more mean-reverting; null when there is no data.
results[].deviationPctnumberCurrent deviation from the window mean as a signed percent.
results[].reversionFrequencynumberMean crossings per observation, from 0 to 1.
results[].halfLifeDaysnumberEstimated half-life of a deviation in days; null when the series is non-reverting.
results[].notestringWhy a result is null, when applicable.

Example

Most mean-reverting currencies against USD:

curl "https://api.currency-core.com/v1/mean-reversion?base=USD&limit=5" \
  -H "Authorization: Bearer cc_live_your_key"

Score a named set over a 5-year window:

curl "https://api.currency-core.com/v1/mean-reversion?currencies=EUR,GBP,JPY&from=2021-01-01" \
  -H "Authorization: Bearer cc_live_your_key"

Errors

StatusCodeWhen
400invalid_inputBad base, currencies, or universe; more than 40 currencies; 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.
  • Up to 40 named currencies per request.
  • Ranking limit is capped at 50.
  • The window cannot exceed 20 years.
  • Each request consumes one monthly request and one per-minute rate-limit unit.

Related pages: