BYTETOOLS

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.

No API key requiredCORS enabledHTTPSFree tier

Endpoint tested and returned HTTP 200 on 21 Aug 2026

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 21 Aug 2026, 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
curl 'https://why21million.com/api/halving/850000'
JavaScript (fetch)
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);
Python (requests)
import requests

res = requests.get("https://why21million.com/api/halving/850000", timeout=20)
res.raise_for_status()
print(res.json())
Response — HTTP 200
{
  "height": 850000,
  "era": 5,
  "rewardBtc": 3.125,
  "blocksIntoEra": 10000,
  "blocksUntilNextHalving": 200000,
  "nextHalvingBlock": 1050000,
  "source": "https://why21million.com/book/halving-schedule/"
}

Parameters

ParameterTypeRequiredDescription
/halving/{height}pathRequiredBlock 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

Alternatives to Bitcoin Halving API

If Bitcoin Halving API does not fit, these finance & crypto apis cover similar ground. Every one was called before publishing, and each links to its own reference page with a working curl command and the response it returned.

APIWhat it doesAuthCORSLast verified
CoinGeckoFree cryptocurrency price API covering 10,000+ coins. Live prices, market cap and volume in any currency, no API key on the public tier. Tested curl example.No keyYes19 Aug 2026
Binance Public APIBinance public market data API needs no API key: live ticker prices, order books, klines and 24h stats for every trading pair. Tested curl example and response.No keyYes19 Aug 2026
Coinbase Exchange RatesCoinbase public exchange rates API with no key: convert any cryptocurrency to 100+ fiat currencies in a single request. Tested curl example and live JSON.No keyYes19 Aug 2026
FrankfurterFree currency exchange rate API with no key, built on European Central Bank data. Latest and historical rates, time series and conversion. Tested curl example.No keyYes19 Aug 2026
BitfinexFree Bitfinex public API with no key: real-time ticker, order book, trades and candles for crypto and forex pairs. Tested curl example and live response.No keyNo21 Aug 2026
BitstampFree Bitstamp public API with no key: 24-hour ticker with VWAP, open, high, low, volume and percent change for every trading pair. Tested example and live response.No keyNo21 Aug 2026
All Finance & Crypto APIs

Bitcoin Halving API is an independent third-party service and is not affiliated with ByteTools or ByteVancer. Details on this page were verified on 21 Aug 2026; always check the official documentation before relying on this API in production, as terms and limits can change.