Currencies & FX
Rate Sparklines
GET /api/rates/sparklines A year of weekly closing rates for every currency pair — about 52 points each, just enough to draw a small trend line (a sparkline) beside each row of a rates table.
Example
Rate sparklines
curl https://api.bytetree.io/api/rates/sparklines \
-H "Authorization: Bearer YOUR_API_KEY" const res = await fetch("https://api.bytetree.io/api/rates/sparklines", {
headers: { "Authorization": "Bearer YOUR_API_KEY" },
});
const body = await res.json(); import requests
res = requests.get(
"https://api.bytetree.io/api/rates/sparklines",
headers={"Authorization": "Bearer YOUR_API_KEY"},
)
body = res.json()
Response
200 Shortened to ten points per pair {
"data": {
"GBPUSD": [1.2545, 1.2567, 1.2589, 1.2601, 1.2615, 1.2631, 1.2650, 1.2680, 1.2710, 1.2731],
"EURUSD": [1.0820, 1.0845, 1.0867, 1.0890, 1.0912, 1.0935, 1.0950, 1.0970, 1.0985, 1.1002],
"JPYUSD": [0.006658, 0.006647, 0.006632, 0.006622, 0.006616, 0.006607, 0.006601, 0.006592, 0.006585, 0.006579]
}
} Query Parameters
This endpoint takes no query parameters other than format; any other parameter returns 400.
Response
| Field | Type | Description |
|---|---|---|
data |
object |
Map of pair code to array of weekly closes |
Each key is a currency pair code. Each value is an array of number values representing the closing price for that ISO week, ordered chronologically (oldest first).
Notes
- Returns approximately 52 data points per pair (one per ISO week)
- Weekend data and carry-forward records are excluded
- The last value in each array is the most recent weekly close
- Useful for rendering sparkline charts alongside a rates table