API Reference

/safe-haven Endpoint

Rank currencies by a composite safe-haven score built from low volatility, shallow drawdown, and 2008-crisis resilience.


Endpoint

GET https://api.currency-core.com/v1/safe-haven

Ranks currencies by how well they hold value in turmoil. Each result carries a transparent composite score from 0 to 100, where higher means safer, built from three components measured against base:

  • Low volatility (annualized): calmer currencies score higher.
  • Shallow maximum drawdown: a smaller worst peak-to-trough fall scores higher.
  • Crisis resilience: how the currency held up against base during the 2008 global financial crisis (positive means it held or gained value).

Each component is returned alongside the score, so the result is auditable rather than a black box. This endpoint requires the Growth plan or higher.

Plan requirement

/v1/safe-haven 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. CHF,JPY. Omit to rank the safe-haven pool. currency is accepted as an alias. Maximum 40 codes.
basestringNoUSDBase currency to measure against.
fromstringNo2007-01-01Window start YYYY-MM-DD (UTC). When 2007-01-01 would exceed the 20-year limit, the start slides forward to 20 years before to.
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. The pool is fiat only; the rate source has no precious-metal prices.

How the score is built

The score blends three clamped components:

score = 0.4 × volatility score + 0.3 × drawdown score + 0.3 × crisis score
ComponentWeightMapping
Volatility0.40% maps to 100, 20% maps to 0
Drawdown0.30% maps to 100, 50% maps to 0
Crisis return0.3+25% maps to 100, 0% maps to 50, -25% maps to 0

A missing component scores a neutral 50. The final score is rounded to one decimal place. You can recompute your own ranking from the returned components if you prefer different weights.

Reading the result

  • A high score means the currency was calm, did not fall far from its peak, and held value during the reference crisis. This is the pattern people mean by a safe haven.
  • A low score means at least one of those protections was weak. Read the components to see which one.
  • crisisReturnPct is measured over the fixed reference window returned in crisis. A positive value means the currency appreciated against base; 0 means it held flat; a negative value means it lost ground.
  • A high score is a historical description, not a guarantee. Safe-haven behavior can change with the regime, and the crisis window is fixed at 2008 by design.

Choosing a base and universe

Measure against the base your audience spends or reports in. The liquid universe is the default and is broader; majors narrows the comparison to the eight conventional majors, which is useful when you want a headline “safe haven among major currencies” answer. When you name currencies, universe is ignored and the named set is scored. A longer window includes more crises but also more regime change, so report the window with the score.

Response

{
  "base": "USD",
  "from": "2007-01-01",
  "to": "2026-06-17",
  "crisis": {
    "label": "the 2008 global financial crisis",
    "from": "2007-12-01",
    "to": "2009-06-30"
  },
  "universe": "liquid",
  "results": [
    {
      "currency": "CHF",
      "score": 69.5,
      "volatility": 6.1,
      "maxDrawdownPct": -14.2,
      "crisisReturnPct": 8.7
    },
    {
      "currency": "JPY",
      "score": 64.5,
      "volatility": 8.4,
      "maxDrawdownPct": -18.5,
      "crisisReturnPct": 12.3
    }
  ]
}

Response fields

FieldTypeDescription
basestringBase currency the metrics are measured against.
fromstringWindow start used (YYYY-MM-DD, UTC).
tostringWindow end used (YYYY-MM-DD, UTC).
crisisobjectReference crisis window with label, from, and to.
universestringUniverse ranked when no currencies were named.
resultsarrayCurrencies ordered by score, highest first.
results[].currencystringThe currency code.
results[].scorenumberComposite score from 0 to 100, higher means safer; null when there is no data.
results[].volatilitynumberAnnualized volatility in percent over the window.
results[].maxDrawdownPctnumberWorst peak-to-trough decline as a signed percent.
results[].crisisReturnPctnumberPercent change versus base during the reference crisis; positive means it held value.
results[].notestringWhy a result is null, when applicable.

Examples

Safe-haven ranking against USD:

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

Compare CHF and JPY as safe havens:

curl "https://api.currency-core.com/v1/safe-haven?currencies=CHF,JPY" \
  -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.
  • The crisis window is fixed at 2007-12-01 through 2009-06-30.
  • Each request consumes one monthly request and one per-minute rate-limit unit.

Related pages: