Historical exchange rates API reference
Request stored exchange rates by base, quotes, and date range.
The history operation returns the current accepted stored series in oldest-first order. It uses the same Narwhal key and shared credit as current FX and Economics requests.
Request
curl --request GET \
--url "https://api.narwhalapi.com/v1/fx/rates/USD/observations?currencies=EUR,NZD&start_date=2026-08-20&end_date=2026-08-28&limit=100" \
--header "Authorization: Bearer $NARWHAL_API_KEY"| Parameter | Rule |
|---|---|
base | Uppercase circulating ISO 4217 currency in the path. |
currencies | Required comma-separated list of 1–64 unique quote currencies. The base cannot appear. |
start_ | Required. Inclusive date on or after 1971-01-01. |
end_ | Required. Inclusive date on or after the start and not in the future. |
limit | Observation dates per page. Default 100; maximum 366. |
cursor | Opaque value from the previous page. Reuse it only with the same filters. |
The MCP tool is fx_. Its currencies input is a JSON array; every other field has the same meaning.
Response
{
"base": "USD",
"observations": [
{
"date": "2026-08-20",
"rates": [
{ "currency": "EUR", "rate": "0.85609" },
{ "currency": "NZD", "rate": "1.681" }
]
},
{
"date": "2026-08-21",
"rates": [
{ "currency": "EUR", "rate": "0.85477" },
{ "currency": "NZD", "rate": "1.6714" }
]
},
{
"date": "2026-08-24",
"rates": [{ "currency": "EUR", "rate": "0.85734" }]
}
],
"next_cursor": null
}Each rate is a decimal string. One unit of base equals the returned amount of currency on that observation date.
start_ and end_ are returned only when Narwhal changes the requested dates.
Pagination
limit counts dates, so a page never splits one date's currency records. When next_ is not null, pass it back with the same base, currencies, start date, and end date. The cursor is tied to these filters. Changing them returns 400 invalid_.
There is no overall date-span cap. Full-history backfills use the same bounded page repeatedly until next_ is null.
Missing dates and currencies are not fabricated
Only genuine stored observation dates appear. Weekends, holidays, and other missing publication dates are omitted. Narwhal does not forward-fill them.
A date can contain only a subset of the requested currencies. In the example, NZD has no record on August 24 while EUR does. That is a truthful sparse observation, not a partial-response error.
Price bars
GET / returns closed bars with open, high, low and close for one currency pair. MCP tool: fx_.
curl --request GET \
--url "https://api.narwhalapi.com/v1/fx/rates/USD/bars?currency=EUR&interval=1h&start=2026-10-08T00:00:00Z&end=2026-10-08T03:00:00Z" \
--header "Authorization: Bearer $NARWHAL_API_KEY"| Parameter | Rule |
|---|---|
base | The currency one unit of which is priced, for example USD or EUR. A pair we cannot serve returns 404 currency_. |
currency | The currency the price is in, such as JPY. |
interval | 1m, 5m, 15m, 1h, 4h or 1d (default). |
start / | Both required. UTC times on interval boundaries (4h at 00, 04, 08 and so on; 1d at midnight). Start is inclusive; end is exclusive. |
limit / | Default 100, at most 500. Reuse next_ with the same query. |
function | Optional. One technical indicator to add to each daily bar: sma, ema, wma, rsi, macd, bbands, atr, stochastic, adx, dmi, cci, sar or stochrsi. Needs interval=1d. |
period | Optional settings of the indicator, with the names and defaults of the stock technicals route: period, fast_, slow_, signal_, fast_, slow_, slow_, fast_, acceleration and maximum. Each needs function. |
Each bar has timestamp (bar start) and open, high, low and close in units of currency per one base. We never fill gaps: missing bars stay missing. We keep 1m and 5m bars for 30 days and 15m, 1h, 4h and 1d bars indefinitely. A range outside retention returns an empty bars list, not an error.
start and end are returned only when Narwhal changes the requested range.
A request may span at most 3 days of 1m bars, 14 days of 5m bars, 60 days of 15m bars; a longer range returns 400 invalid_. Wider intervals have no cap.
Cross pairs
A pair we hold no bars for, with USD on neither side, such as EUR and JPY, is computed from the two currencies' bars against USD. Each bar has timestamp and close only: the close of currency divided by the close of base, both against USD, to 6 significant digits. A time that either currency has no bar for is left out.
curl --request GET \
--url "https://api.narwhalapi.com/v1/fx/rates/EUR/bars?currency=JPY&interval=1d&start=2026-11-18T00:00:00Z&end=2026-11-20T00:00:00Z" \
--header "Authorization: Bearer $NARWHAL_API_KEY"{
"base": "EUR",
"currency": "JPY",
"bars": [
{ "timestamp": "2026-11-18T00:00:00Z", "close": "174.906" },
{ "timestamp": "2026-11-19T00:00:00Z", "close": "175.193" }
],
"next_cursor": null
}Indicators on daily bars
With function, each bar carries indicator and the answer carries indicator_: the function, the settings used and methodology_. We compute each value from every daily bar up to that bar, with the formulas of the stock technicals route. Bars before the function has enough history have no indicator.
A computed cross pair has no high or low, so atr, stochastic, adx, dmi, cci and sar answer 400 invalid_ for it. A pair with too few daily bars for the function answers 404 not_.
Errors
400 invalid_for invalid currencies, dates, or page size.query 400 invalid_for malformed or filter-mismatched pagination state.cursor 401 invalid_for a missing or invalid Bearer key.api_ key 404 currency_when the selected currency is unavailable.not_ supported 404 not_A computed cross pair with no bar in the range asked for. The call is not charged.found 404 not_A pair with too few daily bars for the indicator asked for.covered 429 rate_when the short-window limit is reached; wait forlimit_ exceeded Retry-Afterbefore retrying.402 insufficient_when your balance does not cover the call.credits 503 upstream_when the accepted historical data cannot be read safely.unavailable
See the errors and limits guide for both rate-limit header families and retry behavior.
Coverage and limits
Coverage begins at different dates by currency. The earliest supported stored series begins in 1971; most daily coverage begins in 1999 or 2000. Coverage can expand without changing this contract.
This Interface returns the current accepted historical series, not every earlier publication vintage. It omits source, provider, licence, derivation, staleness, and market-session fields. Read the FX methodology for the public data policy and the FX product page for all live operations.
Start with a free key
Free $10 credits every month, no card.Free $10 credits a month, no card.
Was this page helpful?