ByteTree API documentation

Macro Dataset

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:

MethodPathDescription
GET/api/macroLatest group metrics across all five dimensions
GET/api/macro/:dimensionGroups within one dimension
GET/api/macro/:dimension/:groupTime series for one group

Request

# All five dimensions, latest date
curl https://api.bytetree.io/api/macro

# Sector groups, time series
curl "https://api.bytetree.io/api/macro/sector?from=2026-01-01&to=2026-03-01"

# One group's history
curl "https://api.bytetree.io/api/macro/region/Europe?from=2026-01-01"

# Selective fields
curl "https://api.bytetree.io/api/macro/region?fields=avgByteTrendLocal200w,avgByteTrendCapr30d,totalMarketCapUsd"

Path Parameters

NameTypeRequiredDescription
dimensionstringNoOne of the five global dimensions: region, sector, industry, type, or country — see Dimensions
groupstringNoGroup label within that dimension (e.g. Europe, Technology, Banking & Lending). Requires dimension

Query Parameters

NameTypeRequiredDescription
fromstringNoStart date YYYY-MM-DD. Returns a time series when provided
tostringNoEnd date YYYY-MM-DD
fieldsstringNoComma-separated metric fields to include

Response

Each route returns the same envelope as its universe-group counterpart, with macro in place of a universe slug:

RouteEnvelopeSchema
/api/macro{ universe: "macro", count, data: { region, sector, industry, type, country } }Universe Groups
/api/macro/:dimension{ count, dimension: "macro/<dimension>", data: [...] }Dimension Groups
/api/macro/:dimension/:group{ count, dimension, group, data: [...] }Group History

Group metric objects carry the identification, ByteTrend aggregate, byteTrendBins histogram, trend-distribution, return and risk fields documented on Universe Groups.

{
  "count": 7,
  "dimension": "macro/region",
  "data": [
    {
      "dimension": "macro/region",
      "group": "Africa",
      "date": "2026-09-09T00:00:00.000Z",
      "assetCount": 5,
      "avgByteTrendLocal200w": 3.4,
      "avgByteTrendLocal30d": 3.8,
      "avgByteTrendCapr200w": 2.6,
      "avgByteTrendCapr30d": 4,
      "byteTrendBins": {
        "local200w": [0, 1, 0, 2, 0, 2],
        "local30d": [1, 0, 0, 0, 1, 3],
        "capr200w": [1, 0, 1, 1, 2, 0],
        "capr30d": [1, 0, 0, 0, 0, 4]
      },
      "avgReturnUsd1M": 0.0358,
      "avgReturnUsd12M": 0.3676,
      "avgVolatility30w": 0.4281,
      "avgSharpe52w": 0.785,
      "...": "..."
    }
  ]
}

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

StatusWhen
400macro passed as a universe slug on any /api/universes/… path or universe parameter. The body points here
401Missing or invalid API key
403Key lacks the api+mcp capability