Currencies & FX
FX Price History
GET /api/fx/:symbol/prices The daily closing rate of one currency pair, ready to chart. It sits alongside FX Metric History, which carries the scores and metrics.
Example
curl "https://api.bytetree.io/api/fx/EURUSD/prices?from=2026-05-04&to=2026-05-05" \
-H "Authorization: Bearer YOUR_API_KEY" const res = await fetch("https://api.bytetree.io/api/fx/EURUSD/prices?from=2026-05-04&to=2026-05-05", {
headers: { "Authorization": "Bearer YOUR_API_KEY" },
});
const body = await res.json(); import requests
res = requests.get(
"https://api.bytetree.io/api/fx/EURUSD/prices?from=2026-05-04&to=2026-05-05",
headers={"Authorization": "Bearer YOUR_API_KEY"},
)
body = res.json() 200 {
"symbol": "EURUSD",
"count": 2,
"data": [
{ "date": "2026-05-04T00:00:00.000Z", "close": 1.16720 },
{ "date": "2026-05-05T00:00:00.000Z", "close": 1.16838 }
]
} Full history
curl https://api.bytetree.io/api/fx/EURUSD/prices \
-H "Authorization: Bearer YOUR_API_KEY" With date range
curl "https://api.bytetree.io/api/fx/EURUSD/prices?from=2026-01-01&to=2026-01-31" \
-H "Authorization: Bearer YOUR_API_KEY" Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
symbol |
string |
Yes | Concatenated FX pair code (e.g. EURUSD). Case-insensitive |
Query Parameters
| Name | Type | Required | Description |
|---|---|---|---|
from |
string |
No | Inclusive ISO YYYY-MM-DD start date |
to |
string |
No | Inclusive ISO YYYY-MM-DD end date |
Dates must be real calendar dates in YYYY-MM-DD form, or the request is a 400 — see Value validation.
Response
| Field | Type | Description |
|---|---|---|
symbol |
string |
The normalised (uppercase) symbol |
count |
number |
Number of data points returned |
data |
array |
Array of daily price records, sorted ascending by date |
Each record in data:
| Field | Type | Description |
|---|---|---|
date |
string |
ISO 8601 date |
close |
number |
Daily close rate |
Errors
| Status | Description |
|---|---|
404 |
No FX records match — the symbol has none, or a known pair has none in the requested from/to range. An unknown but otherwise well-formed symbol (e.g. XYZUSD) is treated the same way. (Unlike Price History and Rate History, an empty range here is a 404, not an empty data array. FX Metric History also answers an unknown pair with 200 and an empty data array) |
Why close-only
FX rates are conventionally rendered as line series, not candlesticks — intraday OHLC isn’t meaningful for daily-fix FX, and ByteTree’s own FX charts are line-only. The endpoint reflects that convention rather than padding the row with synthetic open/high/low/volume fields.
For raw OHLC rate data (where open, high, low, close and dates do exist on the underlying record) see /api/rates/:pair.
Polymorphic equivalent
GET /api/prices/:symbol also resolves FX symbols and returns the same { date, close } shape for FX (no synthetic OHLC). Use this endpoint when the consumer is FX-only; use the polymorphic surface when iterating across mixed asset types.
Notes
- Without
from/to, returns all available history for the pair. - For computed FX metrics (ByteTrend scores, trend regimes, MA deviations) see
/api/fx/:symbol/series.