ByteTree API documentation

Latest Metrics

Everything ByteTree has worked out about one asset as of the latest day: its four ByteTrend scores, its trend regime, and its risk and return figures. The full record has around a hundred fields, but most people need only a handful — the fields most people need are listed first, and the complete reference follows.

Currency pairs work too (EURUSD): when no asset metrics exist for a pair, the endpoint answers from exchange-rate data. For currency-only work, Get FX Pair is the dedicated endpoint; for every asset in one call, use Latest Metrics — All Assets.

Request

curl https://api.bytetree.io/api/metrics/AAPL/latest

# Crypto
curl https://api.bytetree.io/api/metrics/BTCUSD/latest

The fields most people need

FieldWhat it tells you
closeUsdLatest closing price, in US dollars
byteTrendCapr200wLong-term (Weekly) trend score against the world market, 0–5 — the headline score
byteTrendLocal200wLong-term (Weekly) trend score of the asset’s own price, 0–5
byteTrendCapr30d / byteTrendLocal30dThe same two scores on the shorter-term (Daily) timescale
confirmedRegimeCapr200wThe trend label — Leading Trend, Emerging Trend, Weakening Trend, Bear Trend or Neutral — once it has held for five days in a row
returnUsd1M / returnUsd12MReturn over the last month / 12 months, as a decimal (0.05 is 5%)
volatility30wHow much the price swings, annualised, as a decimal — higher means bumpier
drawdown52wHow far the price sits below its 52-week high, as a decimal (0 or below)

Key Concepts explains the scores and labels in plain terms. Every field is described in full under Response.

Path Parameters

NameTypeRequiredDescription
symbolstringYesTicker symbol (e.g. AAPL, BTCUSD). Case-insensitive.

Response

FieldTypeDescription
symbolstringThe normalised (uppercase) symbol
dataobject | nullLatest metrics record, or null if no computed data exists

The data object contains date, close, and all computed metric fields at the top level (see below).

All numeric fields default to adjusted close (split- and dividend-adjusted). Every time-series metric (MAs, slopes, rolling highs/lows, ByteTrend scores, deviations, drawdowns, returns, risk) and the quoted-state fields under Valuation (closeUsd, capr, marketCapUsd) are all computed on adjusted close. Three explicit raw counterparts (closeRawUsd, caprRaw, marketCapRawUsd) are available for forensic / market-printed-price views. See the Data Model page for the exact adjustment contract and the Changelog for cutover history.

ByteTrend Scores (0–5)

Four scores — two ways of measuring, each on two timescales:

FieldUI LabelWindowsDescription
byteTrendLocal200wLocal (Weekly)200w / 30w / 20w on closeWeekly ByteTrend on local price
byteTrendLocal30dLocal (Daily)200d / 30d / 20d on closeDaily ByteTrend on local price
byteTrendCapr200wCAPR (Weekly)200w / 30w / 20w on CAPRWeekly ByteTrend on CAPR
byteTrendCapr30dCAPR (Daily)200d / 30d / 20d on CAPRDaily ByteTrend on CAPR

Each score has companion fields that share the same suffix:

Full set per score, e.g. for Local (Weekly): byteTrendLocal200w, byteTrendLocal200wRules, changeLocal200w, trendRegimeLocal200w, consecLocal200w5, consecLocal200w0. Three equivalent sets exist for Local30d, Capr200w, Capr30d.

Moving Averages

Long/short SMAs for each dimension and window. Every suffix denotes the actual window of that field. Slopes measure day-over-day MA change (trend acceleration).

FieldDescription
localMaLong200w / localMaShort30w200-week / 30-week SMA of local close
localMaLong200d / localMaShort30d200-day / 30-day SMA of local close
caprMaLong200w / caprMaShort30w200-week / 30-week SMA of CAPR
caprMaLong200d / caprMaShort30d200-day / 30-day SMA of CAPR
localMaLong200wSlope / localMaShort30wSlopeDay-over-day slope of Weekly Local MAs
caprMaLong200wSlope / caprMaShort30wSlopeDay-over-day slope of Weekly CAPR MAs
localMaLong200dSlope / localMaShort30dSlopeDay-over-day slope of Daily Local MAs
caprMaLong200dSlope / caprMaShort30dSlopeDay-over-day slope of Daily CAPR MAs

Rolling Highs & Lows

Two daily windows (used by Daily score regime classification and lastTouchMax rule respectively) and two weekly windows (the 20-week rolling high/low and 200-week trend context).

FieldDescription
localMax20d / localMin20d20-day rolling high/low on local close (used by Daily score’s lastTouchMax rule)
caprMax20d / caprMin20d20-day rolling high/low on CAPR
localMax30d / localMin30d30-day rolling high/low on local close (used by Daily score regime classification)
caprMax30d / caprMin30d30-day rolling high/low on CAPR
localMax20w / localMin20w20-week rolling high/low on local close
caprMax20w / caprMin20w20-week rolling high/low on CAPR
localMax200w200-week rolling high on local close
caprMax200w200-week rolling high on CAPR

Deviations

FieldDescription
devFromLocalMaLong200w% deviation from 200-week local MA
devFromCaprMaLong200w% deviation from 200-week CAPR MA
devFromLocalHigh30d / devFromLocalLow30d% below 30-day high / above 30-day low (local)
devFromCaprHigh30d / devFromCaprLow30d30-day CAPR equivalents
devFromLocalHigh30w / devFromLocalHigh200w% below 30-week / 200-week high (local)
devFromLocalLow30w% above 30-week low (local)
devFromCaprHigh30w / devFromCaprHigh200w / devFromCaprLow30wCAPR equivalents

Trend Regime

Trend regimes classify assets by combining their ByteTrend score with whether the price — or, for the CAPR variants, the asset’s performance against MSCI World — is at its recent high or low: the 30-week high or low for the Weekly (200w) variants, the 30-day high or low for the Daily (30d) variants. This is more informative than the score alone: it captures whether a trend is making new highs or sitting at its lows.

FieldTypeDescription
trendRegimeLocal200w / trendRegimeLocal30dstringTrend regime for Weekly / Daily Local score
trendRegimeCapr200w / trendRegimeCapr30dstringTrend regime for Weekly / Daily CAPR score
confirmedRegimeCapr200wstringWeekly CAPR regime (trendRegimeCapr200w) that has persisted for ≥ 5 consecutive days (absorbs short flip-flops)
pendingRegimeCapr200wstring | nullCandidate Weekly CAPR regime waiting on the 5-day confirmation threshold; null once it promotes to confirmedRegimeCapr200w
pendingRegimeCount200wnumberDays the current pendingRegimeCapr200w has been pending
trendAge200wnumberDays since confirmedRegimeCapr200w last changed
consecLocal200w5 / consecLocal200w0numberConsecutive days at Weekly Local score 5 or 0
consecLocal30d5 / consecLocal30d0numberConsecutive days at Daily Local score 5 or 0
consecCapr200w5 / consecCapr200w0numberConsecutive days at Weekly CAPR score 5 or 0
consecCapr30d5 / consecCapr30d0numberConsecutive days at Daily CAPR score 5 or 0

Possible trend regime values — the same labels for all four scores, where “high” and “low” mean the 30-week extreme for Weekly variants and the 30-day extreme for Daily ones:

RegimeCondition
Leading TrendScore = 5 AND at its high
Emerging TrendScore > 0 AND at its high (but not 5)
Weakening TrendScore > 0 AND at its low
Bear TrendScore = 0 AND at its low
NeutralAll other states

Trend Quality & Conviction

FieldTypeDescription
divergenceLocalnumberDaily Local − Weekly Local divergence (positive = Daily stronger)
divergenceCaprnumberDaily CAPR − Weekly CAPR divergence
scoreVelocity5d200wnumber5-day average change in byteTrendLocal200w
volumeConfirmation30dnumberCurrent volume / 30-day average volume (null for indices)
cumulHighs12wnumberCount of new highs within trailing 12-week window

Historical divergence values — before the 2026-04-22 cutover divergenceLocal / divergenceCapr compared the Daily score against a VWAP-weighted weekly score. They now compare Daily against the true 200w-window weekly score. Keys and units are unchanged, but values pre- and post-cutover are not directly comparable in historical series.

Risk Metrics

FieldTypeDescription
volatility30wnumberAnnualised 30-week volatility (√252 stocks, √365 crypto)
sharpe52wnumberRolling 52-week Sharpe ratio (configurable risk-free rate, default 3.5%)
beta52wnumberRolling 52-week beta vs MSCI World benchmark
returnVolRationumber12-month return / 30-week volatility (risk-adjusted momentum)

Drawdown

FieldTypeDescription
drawdown52wnumberCurrent % below 52-week high (always ≤ 0)
drawdownATHnumberCurrent % below adjusted-close all-time high (always ≤ 0)
allTimeHighAdjUsdnumberRunning all-time high in USD on adjusted close (post split/dividend adjustments)
maxDrawdown30wnumberWorst peak-to-trough in trailing 30 weeks
maxDrawdown52wnumberWorst peak-to-trough in trailing 52 weeks

Performance Returns (USD)

FieldDescription
returnUsd1W / returnUsd1M / returnUsd3M / returnUsd6M / returnUsd12MBackward-looking returns as decimals (0.05 = 5%)
returnFwdUsd1DForward 1-day return (filled retroactively for backtesting)
returnFwdUsd3DForward 3-day return
returnFwdUsd1WForward 1-week return
returnFwdUsd1MForward 1-month return
returnFwdUsd3MForward 3-month return
returnFwdUsd6MForward 6-month return
returnFwdUsd12MForward 12-month return

Relative Strength (vs MSCI World)

FieldDescription
relStrengthRaw1M / relStrengthRaw3M / relStrengthRaw12MAsset return / benchmark return (unbounded)
relStrengthCapped1M / relStrengthCapped3M / relStrengthCapped12MLog-scaled version for display

Valuation

The default trio represents the latest quoted state on adjusted close — matching the basis used by every time-series metric on this page. The *Raw trio exposes the same values on raw close for forensic or audit consumers; see Data Model.

FieldTypeDescription
closeUsdnumberAdjusted close price in USD
caprnumberCurrency-Adjusted Price Relative — adjusted USD close ÷ MSCI World adjusted close
marketCapUsdnumber | nullMarket cap in USD on adjusted close
closeRawUsdnumberRaw market-printed USD close (no split or dividend adjustment)
caprRawnumberRaw close ÷ MSCI World raw close
marketCapRawUsdnumber | nullMarket cap in USD on raw close

Notes