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

NameTypeRequiredDescription
typestringNoFilter by asset type: stock, crypto, etf, index, or commodity. Returns all types if omitted.
regionstringNoFilter by region code (e.g. US, GB)
sectorstringNoFilter by sector name (e.g. Technology)

Response

FieldTypeDescription
dataobjectMap 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