GET /v1/fx/time_series
GET /v1/fx/time_series
Returns recent and historical FX rates for one or more currency pairs. The endpoint is intended for currency conversion in portfolio totals and multi-currency reports.
Request
GET /v1/fx/time_series?pair=USD/EUR HTTP/1.1Host: api.oneapi.financeAuthorization: Bearer oa_live_<your_key>Query parameters
| Param | Type | Required | Notes |
|---|---|---|---|
pair | string | one of | Single pair, e.g. USD/EUR. The slash is significant. |
pairs | string | one of | Comma-separated pairs, max 10. e.g. USD/EUR,GBP/JPY. |
start_date | ISO date | no | Inclusive lower bound. |
end_date | ISO date | no | Inclusive upper bound. Default now. |
outputsize | int | no | Default 30. Cap 5,000. |
Response
{ "rates": { "USD/EUR": { "pair": "USD/EUR", "current": 0.9241, "previous": 0.9215, "history": [ { "datetime": "2026-05-02T00:00:00Z", "open": 0.9215, "high": 0.9251, "low": 0.9202, "close": 0.9241 }, { "datetime": "2026-05-01T00:00:00Z", "open": 0.9201, "high": 0.9226, "low": 0.9189, "close": 0.9215 } ] } }}Field reference
Top level:
| Field | Type | Notes |
|---|---|---|
rates | object | Map of pair to per-pair object. |
Per-pair object:
| Field | Type | Notes |
|---|---|---|
pair | string | Echo of the request. |
current | number | null | Most recent close rate. |
previous | number | null | Close rate from the prior day. |
history | array | null | Daily OHLC bars, descending. Null if you did not request a window. |
History entry:
| Field | Type | Notes |
|---|---|---|
datetime | string | ISO 8601 UTC. |
open | number | null | |
high | number | null | |
low | number | null | |
close | number | null |
The wire-format model is
oneapi_core.responses.fx.FxResponse.
What “rate” means
USD/EUR is the price of 1 USD in EUR. To convert a USD amount to EUR,
multiply by the rate. To convert EUR to USD, divide.
amount_eur = amount_usd * rates["USD/EUR"]["current"]amount_usd = amount_eur / rates["USD/EUR"]["current"]We always quote BASE/QUOTE directly. The reverse direction (EUR/USD) is a
separate pair you can also request, but using 1 / rate of the forward pair
gives the same answer to ~5 decimal places.
Examples
# Current rate onlycurl -H "Authorization: Bearer oa_live_..." \ "https://api.oneapi.finance/v1/fx/time_series?pair=USD/EUR&outputsize=1"
# 90 days of history for two pairscurl -H "Authorization: Bearer oa_live_..." \ "https://api.oneapi.finance/v1/fx/time_series?pairs=USD/EUR,GBP/JPY&outputsize=90"import httpx, os
def convert(amount: float, base: str, quote: str) -> float: r = httpx.get( "https://api.oneapi.finance/v1/fx/time_series", params={"pair": f"{base}/{quote}", "outputsize": 1}, headers={"Authorization": f"Bearer {os.environ['ONEAPI_KEY']}"}, timeout=10.0, ) r.raise_for_status() rate = r.json()["rates"][f"{base}/{quote}"]["current"] return amount * rate
print(f"100 USD = {convert(100, 'USD', 'EUR'):.2f} EUR")async function convert(amount, base, quote) { const r = await fetch( `https://api.oneapi.finance/v1/fx/time_series?pair=${base}/${quote}&outputsize=1`, { headers: { Authorization: `Bearer ${process.env.ONEAPI_KEY}` } }, ); const body = await r.json(); const rate = body.rates[`${base}/${quote}`].current; return amount * rate;}Errors
| Status | code | When |
|---|---|---|
| 400 | bad_request | Malformed pair (missing slash), or both pair and pairs. |
| 401 | unauthenticated | Missing or invalid API key. |
| 404 | not_found | Pair not supported. |
| 429 | rate_limit | See rate limits. |
See also
- Currency handling recipe — sub-units (GBX, ILA, ZAC).
- Conventions — currency code list.