API Reference
/rates Endpoint
Fetch the full exchange-rate snapshot for a date, or rebased to any base currency.
Endpoints
GET https://api.currency-core.com/v1/rates
GET https://api.currency-core.com/v1/rates/:base
/v1/rates returns the full snapshot with USD as the base. /v1/rates/:base
returns the same snapshot re-expressed against any base currency — handy when
your product thinks in EUR, INR, or anything other than USD. Neither endpoint
converts a specific amount; for that, use /v1/convert.
Parameters
| Parameter | In | Description |
|---|---|---|
:base | path | Base currency (3-letter ISO 4217), e.g. USD, EUR. |
date | query | YYYY-MM-DD. Defaults to the latest available date. |
Rates for a base currency
Every value is units of that currency per 1 unit of the base — the base
itself is always 1.
curl "https://api.currency-core.com/v1/rates/EUR?date=2024-11-01" \
-H "Authorization: Bearer cc_live_your_key"const res = await fetch("https://api.currency-core.com/v1/rates/EUR?date=2024-11-01", {
headers: { Authorization: "Bearer cc_live_your_key" },
});
const { rates } = await res.json();
console.log(rates.USD); // USD per 1 EURimport requests
res = requests.get(
"https://api.currency-core.com/v1/rates/EUR",
params={"date": "2024-11-01"},
headers={"Authorization": "Bearer cc_live_your_key"},
)
print(res.json()["rates"]["USD"])req, _ := http.NewRequest("GET",
"https://api.currency-core.com/v1/rates/EUR?date=2024-11-01", nil)
req.Header.Set("Authorization", "Bearer cc_live_your_key")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
var data struct {
Rates map[string]float64 `json:"rates"`
}
json.NewDecoder(res.Body).Decode(&data)
fmt.Println(data.Rates["USD"])HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.currency-core.com/v1/rates/EUR?date=2024-11-01"))
.header("Authorization", "Bearer cc_live_your_key")
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());<?php
$ch = curl_init("https://api.currency-core.com/v1/rates/EUR?date=2024-11-01");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ["Authorization: Bearer cc_live_your_key"]);
echo curl_exec($ch);
curl_close($ch);{
"base": "EUR",
"date": "2024-11-01",
"rates": {
"EUR": 1,
"USD": 1.0861,
"INR": 91.62,
"GBP": 0.835
}
}
Rebasing is exact: units-per-base = (units-per-USD) / (base-units-per-USD).
Errors
| Status | Code | When |
|---|---|---|
400 | invalid_input | Base isn’t a 3-letter code. |
400 | unknown_currency | The base currency isn’t in the snapshot. |
404 | rate_not_found | No rates for the requested date. |