Currencies & FX
Rate History
GET /api/rates/:pair The daily history of one exchange rate — for example, how many US dollars one British pound bought on each day. Ask for a date range with from and to, or leave them out for everything on record.
Example
Rate history
curl "https://api.bytetree.io/api/rates/GBPUSD?from=2026-01-01&to=2026-01-31" \
-H "Authorization: Bearer YOUR_API_KEY" const res = await fetch("https://api.bytetree.io/api/rates/GBPUSD?from=2026-01-01&to=2026-01-31", {
headers: { "Authorization": "Bearer YOUR_API_KEY" },
});
const body = await res.json(); import requests
res = requests.get(
"https://api.bytetree.io/api/rates/GBPUSD?from=2026-01-01&to=2026-01-31",
headers={"Authorization": "Bearer YOUR_API_KEY"},
)
body = res.json()
Response
200 {
"pair": "GBPUSD",
"count": 31,
"data": [
{
"date": "2026-01-02T00:00:00.000Z",
"open": 1.2520,
"high": 1.2560,
"low": 1.2510,
"close": 1.2545
},
{
"date": "2026-01-03T00:00:00.000Z",
"open": 1.2545,
"high": 1.2590,
"low": 1.2535,
"close": 1.2567
}
]
} More requests
Full history
curl https://api.bytetree.io/api/rates/GBPUSD \
-H "Authorization: Bearer YOUR_API_KEY" Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
pair |
string |
Yes | Currency pair code (e.g. GBPUSD, EURUSD). Case-insensitive. |
Query Parameters
| Name | Type | Required | Description |
|---|---|---|---|
from |
string |
No | Start date in YYYY-MM-DD format. Inclusive. |
to |
string |
No | End date in YYYY-MM-DD format. Inclusive. |
Dates must be real calendar dates in YYYY-MM-DD form, or the request is a 400 — see Value validation.
Response
| Field | Type | Description |
|---|---|---|
pair |
string |
The normalised (uppercase) pair code |
count |
number |
Number of data points returned |
data |
array |
Array of daily OHLC objects |
Each data point:
| Field | Type | Description |
|---|---|---|
date |
string |
ISO 8601 date |
open |
number | null |
Opening price |
high |
number | null |
Day high |
low |
number | null |
Day low |
close |
number |
Closing price |
Notes
- The
pairparameter is case-insensitive (gbpusdandGBPUSDboth work) - Without
from/to, returns all available history for the pair - Data is sorted chronologically (oldest first)
- Dates with no feed row — weekends, holidays, or a day the feed missed — are filled with carry-forward rows: open, high, low and close all equal the previous close. This endpoint does not return
source; Latest Rates does, for the latest row - Returns an empty
dataarray if the pair code is not found