API Reference

/safe-haven Endpoint

Ranks currencies by a composite safe-haven score combining 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. A transparent composite score (0-100, higher = safer) built from three components measured vs base:

  • low volatility (annualized): calm currencies score higher,
  • shallow max drawdown: a smaller worst peak-to-trough fall scores higher,
  • crisis resilience: how it held up vs base during the 2008 global financial crisis (positive = appreciated/held value).

Each component is returned alongside the score, so it’s auditable, not a black box. The default pool is liquid fiat; the rate source has no precious-metal prices.

Plan requirement

/v1/safe-haven is available on the Growth plan and higher. Free / Starter keys receive HTTP 403 forbidden.

Query parameters

ParameterTypeRequiredDescription
currenciesstringNoComma-separated currencies to score, e.g. CHF,JPY. Omit to rank the safe-haven pool.
basestringNoBase currency to measure against. Default USD.
fromstringNoWindow start YYYY-MM-DD (UTC). Default 2007-01-01 (spans the 2008 crisis + COVID).
tostringNoWindow end YYYY-MM-DD (UTC). Default: today.
limitnumberNoHow many to return (default 10, max 50).

Scoring

score = 0.4·volScore + 0.3·drawdownScore + 0.3·crisisScore, each component clamped to 0-100 (volatility 0%→100, 20%→0; drawdown 0%→100, −50%→0; crisis return +25%→100, 0→50, −25%→0). Reasonable, documented weights; tune your own ranking from the returned components if you prefer.

Examples

Safe-haven ranking (vs USD):

curl "https://api.currency-core.com/v1/safe-haven?base=USD&limit=5" \
  -H "Authorization: Bearer cc_live_your_key"
{
  "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" },
  "results": [
    { "currency": "CHF", "score": 82.4, "volatility": 6.1, "maxDrawdownPct": -14.2, "crisisReturnPct": 8.7 },
    { "currency": "JPY", "score": 71.2, "volatility": 8.4, "maxDrawdownPct": -18.5, "crisisReturnPct": 12.3 }
  ]
}

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 from after to.
403forbiddenYour plan is below Growth (Free / Starter).