Groups
Macro Dataset
GET /api/macro Daily figures for every group across everything ByteTree tracks — the average trend score of European assets, how many technology stocks are in each trend regime, returns and risk by country. Use it to compare regions, sectors, industries, countries and asset types.
The macro dataset is computed across every tracked asset. It is not a universe — a universe is an explicit membership (see Universes) — so it lives at its own path. Three routes, mirroring the three universe group routes exactly:
| Method | Path | Description |
|---|---|---|
GET |
/api/macro |
Latest group metrics across all five dimensions |
GET |
/api/macro/:dimension |
Groups within one dimension |
GET |
/api/macro/:dimension/:group |
Time series for one group |
Example
curl https://api.bytetree.io/api/macro/region \
-H "Authorization: Bearer YOUR_API_KEY" const res = await fetch("https://api.bytetree.io/api/macro/region", {
headers: { "Authorization": "Bearer YOUR_API_KEY" },
});
const body = await res.json(); import requests
res = requests.get(
"https://api.bytetree.io/api/macro/region",
headers={"Authorization": "Bearer YOUR_API_KEY"},
)
body = res.json() 200 {
"count": 7,
"smallOmitted": 0,
"dimension": "macro/region",
"data": [
{
"dimension": "macro/region",
"group": "Africa",
"date": "2026-10-09T00:00:00.000Z",
"assetCount": 32,
"avgByteTrendLocal200w": 2.5625,
"avgByteTrendLocal30d": 1.3125,
"avgByteTrendCapr200w": 1.6563,
"avgByteTrendCapr30d": 0.875,
"byteTrendBins": {
"local200w": [3, 2, 12, 8, 3, 4],
"local30d": [16, 6, 3, 2, 1, 4],
"capr200w": [9, 8, 4, 8, 2, 1],
"capr30d": [23, 2, 1, 2, 2, 2]
},
"avgReturnUsd1M": -0.104,
"avgReturnUsd12M": 0.1101,
"avgVolatility30w": 0.3618,
"avgSharpe52w": 0.221,
"...": "..."
}
]
} All five dimensions, latest date
curl https://api.bytetree.io/api/macro \
-H "Authorization: Bearer YOUR_API_KEY" Sector groups, time series
curl "https://api.bytetree.io/api/macro/sector?from=2026-01-01&to=2026-03-01" \
-H "Authorization: Bearer YOUR_API_KEY" One group's history
curl "https://api.bytetree.io/api/macro/region/Europe?from=2026-01-01" \
-H "Authorization: Bearer YOUR_API_KEY" Selective fields
curl "https://api.bytetree.io/api/macro/region?fields=avgByteTrendLocal200w%2CavgByteTrendCapr30d%2CtotalMarketCapUsd" \
-H "Authorization: Bearer YOUR_API_KEY" Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
dimension |
string |
No | One of the five global dimensions: region, sector, industry, type, or country — see Dimensions. Any other value returns 400 |
group |
string |
No | Group label within that dimension (e.g. Europe, Technology, Banks - Diversified). Requires dimension |
Query Parameters
| Name | Type | Required | Description |
|---|---|---|---|
from |
string |
No | Start date YYYY-MM-DD. Returns a time series when provided. On /api/macro/:dimension/:group, leaving out from and to returns the group’s whole daily history, back to 2005 |
to |
string |
No | End date YYYY-MM-DD |
fields |
string |
No | Comma-separated metric fields to include |
includeSmall |
boolean |
No | true to include groups with fewer than 5 assets, hidden by default — see Small-group floor. Applies to the /api/macro and /api/macro/:dimension listings; the single-group route is unaffected. |
Response
Each route returns the same envelope as its universe-group counterpart, with macro in place of a universe slug:
| Route | Envelope | Schema |
|---|---|---|
/api/macro |
{ universe: "macro", count, smallOmitted, data: { region, sector, industry, type, country } } |
Universe Groups |
/api/macro/:dimension |
{ count, smallOmitted, dimension: "macro/<dimension>", data: [...] } |
Dimension Groups |
/api/macro/:dimension/:group |
{ count, dimension, group, data: [...] } |
Group History |
The /api/macro and /api/macro/:dimension listings apply the small-group floor — groups with fewer than 5 assets are omitted by default and smallOmitted reports how many; pass includeSmall=true to include them. The single-group route is unaffected.
Group metric objects carry the identification, ByteTrend aggregate, byteTrendBins histogram, trend-distribution, return and risk fields documented on Universe Groups.
Macro vs universes
/api/universes/:universe aggregates only that universe’s members. /api/macro aggregates the whole tracked set. macro is never accepted where a universe slug is expected — /api/universes/macro, ?universe=macro and every path below them answer 400 with a pointer to this endpoint. See the Changelog for the cutover.
Errors
| Status | When |
|---|---|
400 |
macro passed as a universe slug on any /api/universes/… path or universe parameter. The body points here |
400 |
A :dimension that isn’t one of the five, or format=csv on /api/macro (one table per dimension; the /:dimension and /:dimension/:group reads do offer CSV) — see Where csv is available |
401 |
Missing or invalid API key |
403 |
Key lacks the api+mcp capability |