API Reference
/history Endpoint
Fetch a dense day-by-day time series of one currency's exchange rate over a date range.
Endpoint
GET https://api.currency-core.com/v1/history
Returns a daily time series for one currency against a base, as a dense
date→rate map, one entry per calendar day in the range. For a single date’s full
snapshot use /v1/rates; to convert a specific amount
use /v1/convert.
For trends, comparisons and movers, see /history/analysis.
Plan requirement
/v1/history is available on the Growth plan and higher. Keys on the Free
and Starter plans receive HTTP 403 forbidden:
{ "error": "forbidden", "message": "The /v1/history endpoint requires the Growth plan or higher." }
Query parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
currency | string | Yes | A single 3-letter ISO 4217 code, e.g. INR. One currency per call, call again for more. |
from | string | No | Start date YYYY-MM-DD (UTC, inclusive). Defaults to to minus 7 days. |
to | string | No | End date YYYY-MM-DD (UTC, inclusive). Defaults to today. Future dates clamp to today. |
base | string | No | Base currency (3-letter ISO 4217). Defaults to USD. |
interval | string | No | daily (default), weekly, monthly, or yearly. Coarser intervals average the daily rates per bucket. |
All dates are UTC calendar dates, so results don’t shift with the caller’s
local timezone. When from and to are both omitted you get the trailing
8 days (today and the 7 days before it).
Response
rates is a dense map: every calendar day in [from, to] is present, even
weekends, holidays, and non-trading days. Each value is units of currency
per 1 base. Gaps are filled by carrying the most recent earlier rate forward,
and today is always included with the live rate.
{
"currency": "INR",
"base": "USD",
"interval": "daily",
"from": "2026-06-09",
"to": "2026-06-16",
"rates": {
"2026-06-09": 83.10,
"2026-06-10": 83.14,
"2026-06-11": 83.21,
"2026-06-12": 83.18,
"2026-06-13": 83.18,
"2026-06-14": 83.18,
"2026-06-15": 83.30,
"2026-06-16": 83.42
}
}
Here 2026-06-13 and 2026-06-14 (a weekend) carry 2026-06-12’s rate forward,
and 2026-06-16 is today’s live rate.
Response fields
| Field | Type | Description |
|---|---|---|
currency | string | The currency you requested, echoed back. |
base | string | The base currency used (defaults to USD). |
interval | string | The aggregation interval applied (daily / weekly / monthly / yearly). |
from | string | Start date of the range actually returned (YYYY-MM-DD, UTC). |
to | string | End date of the range actually returned (YYYY-MM-DD, UTC). |
rates | object | For daily, a dense date → rate map (one entry per calendar day). For coarser intervals, a period → average rate map. Each rate is units of currency per 1 base. |
Aggregation (interval)
By default (interval=daily) you get one entry per calendar day. Pass weekly,
monthly, or yearly to average the daily rates within each bucket, useful
for charts and long ranges. Partial buckets at the edges of the range average
only the days that fall inside [from, to]. Bucket keys:
interval | Key format | Example key |
|---|---|---|
daily | YYYY-MM-DD (the day) | 2026-06-16 |
weekly | YYYY-MM-DD (the week’s Monday, UTC) | 2026-06-15 |
monthly | YYYY-MM (the month) | 2026-06 |
yearly | YYYY (the year) | 2026 |
curl "https://api.currency-core.com/v1/history?currency=INR&from=2024-01-01&to=2026-06-16&interval=monthly" \
-H "Authorization: Bearer cc_live_your_key"
{
"currency": "INR",
"base": "USD",
"interval": "monthly",
"from": "2024-01-01",
"to": "2026-06-16",
"rates": { "2024-01": 82.97, "2024-02": 83.04, "2026-06": 83.25 }
}
Example requests
A one-week series for INR against USD:
curl "https://api.currency-core.com/v1/history?currency=INR&from=2026-06-09&to=2026-06-16&base=USD" \
-H "Authorization: Bearer cc_live_your_key"const res = await fetch(
"https://api.currency-core.com/v1/history?currency=INR&from=2026-06-09&to=2026-06-16&base=USD",
{ headers: { Authorization: "Bearer cc_live_your_key" } },
);
const { rates } = await res.json();
console.log(rates["2026-06-16"]); // INR per 1 USDimport requests
res = requests.get(
"https://api.currency-core.com/v1/history",
params={"currency": "INR", "from": "2026-06-09", "to": "2026-06-16", "base": "USD"},
headers={"Authorization": "Bearer cc_live_your_key"},
)
print(res.json()["rates"]["2026-06-16"])req, _ := http.NewRequest("GET",
"https://api.currency-core.com/v1/history?currency=INR&from=2026-06-09&to=2026-06-16&base=USD", 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["2026-06-16"])HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.currency-core.com/v1/history?currency=INR&from=2026-06-09&to=2026-06-16&base=USD"))
.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/history?currency=INR&from=2026-06-09&to=2026-06-16&base=USD");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ["Authorization: Bearer cc_live_your_key"]);
echo curl_exec($ch);
curl_close($ch);Trailing 8 days (defaults), rebased to EUR:
curl "https://api.currency-core.com/v1/history?currency=INR&base=EUR" \
-H "Authorization: Bearer cc_live_your_key"
Errors
| Status | Code | When |
|---|---|---|
400 | invalid_input | currency is missing or not a 3-letter code, base isn’t a 3-letter code, or a date isn’t a valid YYYY-MM-DD. |
400 | unknown_currency | currency or base isn’t a known currency. |
403 | forbidden | Your plan is below Growth (Free / Starter). |