GET /api/rates/sparklines Sparklines
Returns 12 months of weekly closing prices for all FX pairs. Ideal for rendering sparkline charts or mini trend visualisations.
Request
curl https://api.bytetree.io/api/rates/sparklines
Query Parameters
| Name | Type | Required | Description |
|---|---|---|---|
format | string | No | Response format: json (default), csv, or toon |
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).
{
"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],
"USDJPY": [150.20, 150.45, 150.78, 151.02, 151.15, 151.35, 151.50, 151.70, 151.85, 152.00]
}
}
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