Getting Started
The ByteTree API provides real-time and historical data for FX rates, global stocks, crypto assets, and computed ByteTrend metrics.
Base URL
All endpoints are served from:
https://api.bytetree.io
Authentication
Every endpoint except GET /api/health requires an API key, sent as a bearer token:
curl https://api.bytetree.io/api/assets \
-H "Authorization: Bearer YOUR_API_KEY"
See Authentication for how to obtain a key and the full scope and error model.
Response Format
All endpoints return JSON by default. You can request alternative formats using the format query parameter:
| Format | Content-Type | Description |
|---|---|---|
json | application/json | Default. Standard JSON. |
csv | text/csv | Comma-separated values (RFC 4180). |
toon | text/toon | TOON — compact, token-efficient encoding ideal for LLM consumers. |
# CSV
curl "https://api.bytetree.io/api/rates?format=csv"
# TOON
curl "https://api.bytetree.io/api/rates?format=toon"
Unsupported format values return 400 Bad Request.
Response Conventions
Paginated list envelope
List endpoints that support consumer-driven pagination return:
{
"count": 10,
"total": 4287,
"limit": 10,
"offset": 0,
"data": [ /* records on this page */ ]
}
| Field | Description |
|---|---|
count | Length of the returned data array (records on this page). |
total | Full match count for the same filter, ignoring limit and offset. Computed in parallel with the paged query. |
limit / offset | Echoed input. Consumers paginate by advancing offset until offset + count >= total. |
data | Array of records for this page. |
Endpoints currently on this envelope: GET /api/assets.
Other list endpoints (rates, prices, metrics, universes) are bounded reads and ship the legacy {count, data} shape — they will adopt the full envelope if/when they need consumer-driven pagination.
Compatibility: the envelope is additive. Callers that read only count and data are unaffected. See the Changelog for the cutover note.
Single-record reads
Single-record endpoints — e.g. GET /api/assets/:id, GET /api/rates/:pair — return { data: ... } and may include the lookup key as a sibling field (e.g. { pair, count, data } for symbol-scoped reads). They are not paginated.
Available Endpoints
| Method | Path | Description |
|---|---|---|
GET | /api/health | Health check |
GET | /api/currencies | Currency code to name mapping |
GET | /api/rates | Latest rates for all FX pairs |
GET | /api/rates/sparklines | 12-month weekly closes per pair |
GET | /api/rates/:pair | Daily time series for one pair |
GET | /api/assets | List assets with optional filters |
GET | /api/assets/:id | Single asset by ID or symbol |
GET | /api/prices | Latest price per symbol |
GET | /api/prices/sparklines | 12-month weekly closes per symbol |
GET | /api/prices/:symbol | Daily price time series for one symbol |
GET | /api/fx | Tracked FX pairs with latest scores and trend regime |
GET | /api/fx/:symbol | Latest computed metrics for one FX pair |
GET | /api/fx/:symbol/series | Daily metric time series for one FX pair |
GET | /api/fx/:symbol/prices | Close-only price series for one FX pair |
GET | /api/metrics/latest | Latest metrics across all symbols |
GET | /api/metrics/:symbol/latest | Latest computed metrics snapshot |
GET | /api/metrics/:symbol | Computed metrics time series |
GET | /api/metrics/distribution | Cross-sectional metric distributions |
GET | /api/metrics/regime-transitions | Trend-regime transition event log |
GET | /api/summary | Single-screen dataset overview |
GET | /api/universes | Available universes and dimension configs |
GET | /api/universes/:universe | Latest group metrics across all dimensions |
GET | /api/universes/:universe/:category | Groups within a dimension |
GET | /api/universes/:universe/:category/:group | Time series for one group |
GET | /api/universes/:universe/:category/config | Grouping config for a dimension |
Data Sources
All market data is sourced from institutional-grade data providers and updated daily. FX pairs are quoted as XXXUSD (e.g. GBPUSD = 1.27 means 1 GBP buys 1.27 USD).
Quick Example
Fetch the latest rate for GBP/USD:
curl https://api.bytetree.io/api/rates/GBPUSD
{
"pair": "GBPUSD",
"count": 365,
"data": [
{
"date": "2025-02-17T00:00:00.000Z",
"open": 1.2580,
"high": 1.2620,
"low": 1.2560,
"close": 1.2601
}
]
}