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
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
timeframe | string | No | d* | One of d, w, m, y, or words daily/weekly/monthly/yearly/annual. If both timeframe and frequency are sent, timeframe wins. |
frequency | string | No | — | Same accepted values as timeframe. Used only if timeframe is absent. |
coin | string | No | — | Limit to a single coin by exact table/id (must exist in proxy list). |
type | string | No | — | Limit to a single coin by id or symbol or name (case-insensitive). Ignored if coin is provided. |
window / supply_window | int | No | 70 | Centered SMA window for supply smoothing (1 = off). |
sma / supply_trailing_window | int | No | 1 | Extra trailing SMA on supply after centered SMA (1 = off). |
inflation_window / annual_factor_window / acw | int | No | 100 | Trailing SMA window for annual factor smoothing. |
* If neither timeframe nor frequency is sent, the service defaults to daily (d).
Response
Top-level object
| Field | Type | Description |
|---|---|---|
Timestamp | string (ISO 8601, UTC) | Response generation time. |
Frequency | string | Effective timeframe code: d, w, m, or y. |
supply_window | integer | Centered SMA window used for supply. |
supply_trailing_window | integer | Trailing SMA window used for supply. |
inflation_window | integer | Trailing SMA window used for annual factor. |
data | array | One item per coin (or a single item if scoped). |
Per-coin item
| Field | Type | Description |
|---|---|---|
ID | string | Coin ID (table name from proxy list). |
Coin | string | Coin display name. |
Symbol | string | Coin symbol. |
Frequency | string | Timeframe code for this record. |
From | YYYY-MM-DD | Interval start date (context only). |
To | YYYY-MM-DD | Latest date in series. |
Basis | yoy | since_genesis | Annual basis used (YoY if age ≥ 365 days, else since first positive smoothed supply). |
AnnualInflationPercent | string (decimal) | Annual % (from smoothed factor). |
InflationPercentRaw | string (decimal) | Timeframe % = raw annual % ÷ periods_per_year. |
InflationPercent | string (decimal) | Timeframe % = smoothed annual % ÷ periods_per_year. |
PeriodsPerYear | integer | 365 / 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) orYYYY-MM-DDThh:mm:ssZ(top-levelTimestamp).
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: trueis 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/typeis used). - 500 — Database connection issues.
- 502 — Proxy list fetch failed or returned no valid coins.
Calculation details (for transparency)
- Fetch daily supply series and apply a centered SMA (
supply_window). - Optionally apply an additional trailing SMA to the smoothed supply (
sma). - 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). - Smooth the annual factor with a trailing SMA (
inflation_window). - Annual % =
(factor_smoothed − 1) × 100. - Timeframe % =
Annual % / periods_per_year.
