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
baseduring 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
| Parameter | Type | Required | Description |
|---|---|---|---|
currencies | string | No | Comma-separated currencies to score, e.g. CHF,JPY. Omit to rank the safe-haven pool. |
base | string | No | Base currency to measure against. Default USD. |
from | string | No | Window start YYYY-MM-DD (UTC). Default 2007-01-01 (spans the 2008 crisis + COVID). |
to | string | No | Window end YYYY-MM-DD (UTC). Default: today. |
limit | number | No | How 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"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"]){
"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
| Status | Code | When |
|---|---|---|
400 | invalid_input | bad base/currencies, or from after to. |
403 | forbidden | Your plan is below Growth (Free / Starter). |