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

Inflation by Timeframe

Retrieve inflation rates for all tracked cryptocurrencies—or a single coin—over a selected timeframe.

This endpoint computes an annual inflation rate from smoothed supply (as in inflationbycoin) and derives the timeframe inflation by dividing the annual percentage by periods-per-year (d=365, w=52, m=12, y=1).

Endpoint

GET /inflationbytimeframe.php

See your API Access Tiers and Usage Limits for plan details.

Description

Returns inflation data aggregated to a chosen timeframe for each tracked coin.
Internally, circulating supply is fetched and smoothed; an annual factor is computed (YoY, or since-genesis for younger assets), then converted to the requested timeframe:
timeframe % = (annual % / periods_per_year).

Timeframe mapping

  • d (daily) → 365
  • w (weekly) → 52
  • m (monthly) → 12
  • y (yearly/annual) → 1

Query parameters

NameTypeRequiredDefaultDescription
timeframestringNod*One of d, w, m, y, or words daily/weekly/monthly/yearly/annual. If both timeframe and frequency are sent, timeframe wins.
frequencystringNoSame accepted values as timeframe. Used only if timeframe is absent.
coinstringNoLimit to a single coin by exact table/id (must exist in proxy list).
typestringNoLimit to a single coin by id or symbol or name (case-insensitive). Ignored if coin is provided.
window / supply_windowintNo70Centered SMA window for supply smoothing (1 = off).
sma / supply_trailing_windowintNo1Extra trailing SMA on supply after centered SMA (1 = off).
inflation_window / annual_factor_window / acwintNo100Trailing SMA window for annual factor smoothing.

* If neither timeframe nor frequency is sent, the service defaults to daily (d).

Response

Top-level object

FieldTypeDescription
Timestampstring (ISO 8601, UTC)Response generation time.
FrequencystringEffective timeframe code: d, w, m, or y.
supply_windowintegerCentered SMA window used for supply.
supply_trailing_windowintegerTrailing SMA window used for supply.
inflation_windowintegerTrailing SMA window used for annual factor.
dataarrayOne item per coin (or a single item if scoped).

Per-coin item

FieldTypeDescription
IDstringCoin ID (table name from proxy list).
CoinstringCoin display name.
SymbolstringCoin symbol.
FrequencystringTimeframe code for this record.
FromYYYY-MM-DDInterval start date (context only).
ToYYYY-MM-DDLatest date in series.
Basisyoy | since_genesisAnnual basis used (YoY if age ≥ 365 days, else since first positive smoothed supply).
AnnualInflationPercentstring (decimal)Annual % (from smoothed factor).
InflationPercentRawstring (decimal)Timeframe % = raw annual % ÷ periods_per_year.
InflationPercentstring (decimal)Timeframe % = smoothed annual % ÷ periods_per_year.
PeriodsPerYearinteger365 / 52 / 12 / 1 depending on timeframe.

Notes

  • Numeric fields are returned as strings with fixed decimals (e.g., percents to 4 dp; factors, when present elsewhere, to 6 dp).
  • Dates are UTC and formatted YYYY-MM-DD (per-coin) or YYYY-MM-DDThh:mm:ssZ (top-level Timestamp).

Example requests

Daily (timeframe wins):

GET /inflationbytimeframe.php?timeframe=d

Weekly via frequency:

GET /inflationbytimeframe.php?frequency=weekly

One coin by symbol, custom smoothing:

GET /inflationbytimeframe.php?type=btc&timeframe=m&window=90&sma=3&inflation_window=150

Example response (truncated)

{
  "Timestamp": "2025-07-17T23:13:01Z",
  "Frequency": "d",
  "supply_window": 70,
  "supply_trailing_window": 1,
  "inflation_window": 100,
  "data": [
    {
      "ID": "bitcoin",
      "Coin": "Bitcoin",
      "Symbol": "btc",
      "Frequency": "d",
      "From": "2025-06-20",
      "To": "2025-06-21",
      "Basis": "yoy",
      "AnnualInflationPercent": "1.0100",
      "InflationPercentRaw": "0.0028",
      "InflationPercent": "0.0028",
      "PeriodsPerYear": 365
    }
  ]
}

Caching

  • Server caches results per scope/timeframe/parameters for 2 hours.
  • If a cached response is served, header X-Cache-Hit: true is included.

Errors

  • 400 — Invalid timeframe/frequency or invalid coin format.
  • 403 — Access denied (origin/header checks failed).
  • 404 — Coin not found in proxy list (when coin/type is used).
  • 500 — Database connection issues.
  • 502 — Proxy list fetch failed or returned no valid coins.

Calculation details (for transparency)

  1. Fetch daily supply series and apply a centered SMA (supply_window).
  2. Optionally apply an additional trailing SMA to the smoothed supply (sma).
  3. Compute the annual factor per day:
      • If coin age ≥ 365 days: A(t) / A(t−365) (YoY).
      • Else: A(t) / A(genesis) (first positive smoothed supply).
  4. Smooth the annual factor with a trailing SMA (inflation_window).
  5. Annual % = (factor_smoothed − 1) × 100.
  6. Timeframe % = Annual % / periods_per_year.

How can we help?