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
baseduring 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
| Parameter | Type | Required | Default | Notes |
|---|---|---|---|---|
currencies | string | No | none | Comma-separated currencies to score, e.g. CHF,JPY. Omit to rank the safe-haven pool. currency is accepted as an alias. Maximum 40 codes. |
base | string | No | USD | Base currency to measure against. |
from | string | No | 2007-01-01 | Window start YYYY-MM-DD (UTC). When 2007-01-01 would exceed the 20-year limit, the start slides forward to 20 years before to. |
to | string | No | Today (UTC) | Window end YYYY-MM-DD (UTC). Future dates clamp to today. |
universe | string | No | liquid | Universe to rank when currencies is omitted: liquid or majors. |
limit | number | No | 10 | How 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
| Component | Weight | Mapping |
|---|---|---|
| Volatility | 0.4 | 0% maps to 100, 20% maps to 0 |
| Drawdown | 0.3 | 0% maps to 100, 50% maps to 0 |
| Crisis return | 0.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.
crisisReturnPctis measured over the fixed reference window returned incrisis. A positive value means the currency appreciated againstbase;0means 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
| Field | Type | Description |
|---|---|---|
base | string | Base currency the metrics are measured against. |
from | string | Window start used (YYYY-MM-DD, UTC). |
to | string | Window end used (YYYY-MM-DD, UTC). |
crisis | object | Reference crisis window with label, from, and to. |
universe | string | Universe ranked when no currencies were named. |
results | array | Currencies ordered by score, highest first. |
results[].currency | string | The currency code. |
results[].score | number | Composite score from 0 to 100, higher means safer; null when there is no data. |
results[].volatility | number | Annualized volatility in percent over the window. |
results[].maxDrawdownPct | number | Worst peak-to-trough decline as a signed percent. |
results[].crisisReturnPct | number | Percent change versus base during the reference crisis; positive means it held value. |
results[].note | string | Why 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"const res = await fetch("https://api.currency-core.com/v1/safe-haven?base=USD&limit=5", {
headers: { Authorization: "Bearer cc_live_your_key" },
});
console.log((await res.json()).results);import requests
res = requests.get(
"https://api.currency-core.com/v1/safe-haven",
params={"base": "USD", "limit": 5},
headers={"Authorization": "Bearer cc_live_your_key"},
)
print(res.json()["results"])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
| Status | Code | When |
|---|---|---|
400 | invalid_input | Bad base, currencies, or universe; more than 40 currencies; 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
- Up to 40 named currencies per request.
- Ranking
limitis capped at 50. - The window cannot exceed 20 years.
- The crisis window is fixed at
2007-12-01through2009-06-30. - Each request consumes one monthly request and one per-minute rate-limit unit.
Related pages:
/v1/volatilityfor volatility alone/v1/drawdownfor drawdown alone/v1/mean-reversionfor reversion behavior- Pricing for Growth access
- Rate limits for per-minute limits