1. Home
  2. Docs
  3. API documentation
  4. GET
  5. Emission by Timeframe

Emission by Timeframe

Retrieve the latest per-period emission (supply increase) for each tracked coin at a chosen timeframe, plus the coin’s average USD price over that period and the USD value of the emission.

Internally, the service:

  • aggregates per-coin daily average price and last daily market cap from MySQL,
  • fetches daily supply,
  • applies trailing SMA smoothing to supply,
  • builds rolling intervals by your requested frequency,
  • estimates annualized emission from a dynamic baseline (≤365 days; YoY where possible), smooths it,
  • then converts to per-period emission by dividing by periods-per-year.

Endpoint

GET /emissionbytimeframe.php

This endpoint does not enforce subscription tiers.

Query parameters

NameTypeRequiredDefaultDescription
frequencystringYesdOne of d, w, m, y. Controls the reporting period and the divisor for per-period emission.
supply_windowintNo365Trailing SMA window (days) applied to the daily supply series.
emission_windowintNo183Trailing SMA window applied to the annualized emission series (nulls ignored).
yoy_min_daysintNo30Minimum history (days) required to compute the dynamic baseline; otherwise the interval is skipped.
activation_daysintNo30For the first N days after first non-zero supply, per-period emission is forced to 0 (stability gate).
debug1/trueNo0When enabled, includes _debug diagnostics while still writing the normal payload.

Periods per year: d → 365, w → 52, m → 12, y → 1.

Response

Top level

FieldTypeDescription
Timestampstring (ISO 8601, UTC)Response generation time.
FrequencystringEffective timeframe: d, w, m, or y.
supply_windowintegerSupply smoothing window used.
emission_windowintegerAnnual emission smoothing window used.
yoy_min_daysintegerMinimum baseline days used.
activation_daysintegerActivation gate used.
TierstringEchoed subscription tier (not enforced).
dataarrayOne latest record per coin for the chosen timeframe.

Each data[] item

FieldTypeDescription
IDstringCoin id (exact table id from proxy list).
CoinstringCoin display name.
SymbolstringCoin symbol.
SmoothedAnnualEmissionSupplystring (decimal)Annualized emission (supply units/year) after smoothing.
PerPeriodEmissionSupplystring (decimal)Emission scaled to the selected period = annual / periods_per_year.
AvgPriceUSDstring (2 dp)Average USD price over the latest interval.
EmissionUSDstring (2 dp)PerPeriodEmissionSupply × AvgPriceUSD.
FromYYYY-MM-DDStart date of the latest interval.
ToYYYY-MM-DDEnd date of the latest interval.

Notes

  • Numeric values are strings: supplies to 8 dp; prices and USD values to 2 dp.
  • Dates are UTC and use YYYY-MM-DD.

Calculation details (per coin)

  1. Daily aggregation: load daily series (price, market cap, supply).
  2. Trim near-zero head (launch artifacts) relative to the latest supply.
  3. Supply smoothing: trailing SMA of length supply_window.
  4. Build intervals: walk backward from the latest day using the chosen frequency.
  5. Dynamic annualization: for each interval end t, set L = min(365, t − firstNonZeroDay) in days. If L ≥ yoy_min_days, compute
    annual_raw = (S(t) − S(t−L)) × 365 / L.
  6. Annual smoothing: trailing SMA of length emission_window (nulls ignored).
  7. Per-period: per_period = annual_smoothed / periods_per_year.
  8. Activation gate: if To ≤ firstNonZeroDay + activation_days and an annual value exists, set per_period = 0.
  9. Pricing: average price over the same latest interval; EmissionUSD = per_period × AvgPriceUSD.

Example requests

Daily (default smoothing)

GET /emissionbytimeframe.php?frequency=d

Weekly, gentler supply smoothing and longer emission smoothing

GET /emissionbytimeframe.php?frequency=w&supply_window=180&emission_window=270

Monthly with stricter baselining and longer activation gate

GET /emissionbytimeframe.php?frequency=m&yoy_min_days=60&activation_days=45

Example response (truncated)

{
  "Timestamp": "2025-07-17T23:19:17Z",
  "Frequency": "d",
  "supply_window": 365,
  "emission_window": 183,
  "yoy_min_days": 30,
  "activation_days": 30,
  "Tier": "basic",
  "data": [
    {
      "ID": "bitcoin",
      "Coin": "Bitcoin",
      "Symbol": "BTC",
      "SmoothedAnnualEmissionSupply": "398100.00000000",
      "PerPeriodEmissionSupply": "1090.68493151",
      "AvgPriceUSD": "63700.00",
      "EmissionUSD": "69482956.78",
      "From": "2025-06-20",
      "To": "2025-06-21"
    }
  ]
}

(Values are illustrative.)

Caching

  • File cache per frequency and parameter set for2 hours.
  • When a cached response is served, header X-Cache-Hit: true is included.

Errors

  • 400 — Invalid frequency.
  • 403 — Access denied (Origin/Referer/header checks failed).
  • 500 — Database connection error.
  • 502 — Failed to fetch coin list from proxy.php or list malformed.

Practical tips

  • The endpoint returns only the latest interval per coin for the chosen frequency.
  • Increase supply_window / emission_window for smoothing; decrease for responsiveness.
  • Early zeros often come from the activation gate; adjust activation_days if needed.

How can we help?