GET /api/prices/sparklines Price Sparklines
Returns 12 months of weekly closing prices for every tracked asset of the given type. Ideal for rendering sparkline charts in a prices table.
Request
# All assets
curl https://api.bytetree.io/api/prices/sparklines
# Stocks only
curl "https://api.bytetree.io/api/prices/sparklines?type=stock"
# Crypto sparklines
curl "https://api.bytetree.io/api/prices/sparklines?type=crypto"
Query Parameters
| Name | Type | Required | Description |
|---|---|---|---|
type | string | No | Filter by asset type: stock, crypto, etf, index, or commodity. Returns all types if omitted. |
region | string | No | Filter by region code (e.g. US, GB) |
sector | string | No | Filter by sector name (e.g. Technology) |
Response
| Field | Type | Description |
|---|---|---|
data | object | Map of symbol to array of weekly closes |
Each key is a ticker symbol. Each value is an array of number values representing the closing price for that ISO week, ordered chronologically (oldest first).
{
"data": {
"AAPL": [185.20, 187.45, 190.10, 188.30, 192.50, 195.00, 198.20, 201.50, 220.10, 226.84],
"MSFT": [390.50, 395.20, 400.10, 398.75, 405.30, 410.80, 412.50, 415.00, 416.20, 417.15],
"BTCUSD": [42000, 43500, 45200, 44800, 47100, 50200, 55000, 60000, 64000, 66149]
}
}
Notes
- Returns approximately 52 data points per symbol (one per ISO week)
- The last value in each array is the most recent weekly close
regionandsectorfilters resolve against the asset registry- Symbols with no price data in the last 12 months are excluded from the response