Bitcoin Halving API
Free Bitcoin halving API with no key: era, block reward, blocks into the era and blocks until the next halving for any block height. Tested example and live response.
Endpoint tested and returned HTTP 200 on 2026-08-21
What is the Bitcoin Halving API?
The Bitcoin halving API returns the halving schedule arithmetic for any block height as free JSON with no key: which era the height falls in, the block subsidy at that point, and how many blocks remain until the next halving.
Bitcoin's issuance schedule is fixed arithmetic — the subsidy halves every 210,000 blocks from an initial 50 BTC — but implementing it correctly means getting integer division, era indexing and the eventual reward floor right. This endpoint does that for any height you pass, including heights far in the future, which makes it useful as a reference implementation as much as a data source.
The important thing is what it is not: deterministic schedule arithmetic, not chain state. It does not tell you the current height, and `blocksUntilNextHalving` is a block count rather than a duration. Converting that count into a date needs an assumed block interval — nominally ten minutes, but the real average varies with hash rate and difficulty adjustment, so any countdown built from it is an estimate and should say so. Pair it with a chain-state API if you need the live height.
Quick facts
- Base URL
https://why21million.com/api- Authentication
- No key or registration required.
- Rate limit
- No published limit. The response for a given height never changes, so cache it permanently.
- Pricing
- Free.
- CORS
- Enabled — callable directly from browser JavaScript
- Official docs
- Read the docs
How to use the Bitcoin Halving API
Every request below was executed against the live API on 2026-08-21, and the response shown is the real body it returned — not an illustration.
1. Halving schedule at block height 850,000
GET https://why21million.com/api/halving/850000
curl 'https://why21million.com/api/halving/850000'const res = await fetch("https://why21million.com/api/halving/850000");
if (!res.ok) throw new Error(`Request failed: ${res.status}`);
const data = await res.json();
console.log(data);import requests
res = requests.get("https://why21million.com/api/halving/850000", timeout=20)
res.raise_for_status()
print(res.json()){
"height": 850000,
"era": 5,
"rewardBtc": 3.125,
"blocksIntoEra": 10000,
"blocksUntilNextHalving": 200000,
"nextHalvingBlock": 1050000,
"source": "https://why21million.com/book/halving-schedule/"
}Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
/halving/{height} | path | Required | Block height to evaluate. Any non-negative integer works, including future heights. 850000 |
Response fields
heightinteger- The height you asked about, echoed back.
erainteger- Which halving era the height falls in, counting from 1 for the original 50 BTC subsidy.
rewardBtcnumber- Block subsidy in BTC at that height. Excludes transaction fees, which are separate.
blocksIntoErainteger- How far into the current era the height sits.
blocksUntilNextHalvinginteger- Blocks remaining to the next halving — a count, not a duration.
nextHalvingBlockinteger- The exact height at which the next halving occurs.
sourcestring- Link to the schedule reference the arithmetic follows.
What you can build with the Bitcoin Halving API
- Build a halving countdown widget from a current block height
- Show the block subsidy applicable at a historical height
- Verify your own halving arithmetic against a reference implementation
- Explain issuance in educational content about Bitcoin
Common errors and how to fix them
400 on the height
A non-integer or negative height was supplied.
Fix: The path segment must be a non-negative integer with no separators.
Countdown drifts
The block count was converted using a fixed ten-minute interval.
Fix: Real block intervals vary with hash rate and difficulty. Present any date estimate as approximate.
Reward excludes fees
`rewardBtc` is the subsidy only.
Fix: Miner revenue is subsidy plus transaction fees. This endpoint models issuance, not total reward.
Bitcoin Halving API — frequently asked questions
Is the Bitcoin halving API free?
Yes. It requires no key or registration and returns permissive CORS headers, so browser code can call it directly.
Does it tell me the current block height?
No. It performs schedule arithmetic for a height you supply. Pair it with a chain-state API if you need a live height to feed in.
How often does Bitcoin halve?
Every 210,000 blocks, which averages roughly four years at a nominal ten-minute block interval. The exact date drifts because real block times vary with hash rate.
Is rewardBtc what a miner earns?
It is the block subsidy only. Total miner revenue also includes the transaction fees in the block, which this endpoint does not model.
Tools that pair with this API
JSON Formatter
Format, beautify and minify JSON online with 2-space, 4-space or tab indentation. Sort keys alphabetically and catch syntax errors instantly — free and private.
Days Until Date Calculator
Count down from today to any future date: see the exact number of days, plus a weeks and a years/months/days breakdown. Free, instant and private.
Percentage Calculator
Calculate what X% of a number is, what percent one number is of another, and percentage increase or decrease between two values — instantly and free.
Bitcoin Halving API is an independent third-party service and is not affiliated with ByteTools or ByteVancer. Details on this page were verified on 2026-08-21; always check the official documentation before relying on this API in production, as terms and limits can change.