Get daily data related to the bitcoin S2F (Stock-to-Flow) model, including the bitcoin price and the number of days until the next halving. Useful for studying bitcoin’s supply and price in the context of halving cycles.
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
Available on all API plans: Hobbyist Startup Standard Professional Enterprise
Response Data
data is an array; each element is one day of data, sorted by date from oldest to newest, starting from 2010-08-18 and running up to the date on which next_halving next reaches 0 (2028-05-04 when called on 2026-10-22). Dates that do not have a price yet (the day of the call and later) only have timestamp and next_halving and do not return the price field, so check whether it exists before reading it. The example lists only the earliest day, the most recent day with a price and the day after it. This endpoint has no request parameters and returns the full history on every call.
200 · application/json · See the response example in the right panel.
| Field | Type | Always Returned | Description |
|---|---|---|---|
code | string | Yes | Business status code; "0" means success |
msg | string | No | Result message; not returned by this endpoint on success |
data | array of object | Yes | Daily data, sorted by date from oldest to newest |
data[].timestamp | integer (int64) | Yes | Date, timestamp in milliseconds of 00:00 UTC on that day |
data[].price | number | No | Bitcoin price for the day, in USD; this field is not returned for the day of the call and later dates |
data[].next_halving | integer | Yes | Number of days until the next halving as given by the endpoint; after counting down to 0 it starts counting again; the dates on which it is 0 do not exactly match bitcoin’s actual halving dates; see the FAQ |
API Plans
All API plans can call this endpoint. For the price of each plan, see API Plans.
| API Plan | Access |
|---|---|
| Hobbyist | ✅ Yes |
| Startup | ✅ Yes |
| Standard | ✅ Yes |
| Professional | ✅ Yes |
| Enterprise | ✅ Yes |
Use This Endpoint with AI
Pick a task and click Open in ChatGPT or Open in Claude: the AI reads this page first and then gives you the result. You can also click Copy and paste the full prompt into the AI tool you use.
This endpoint provides data through the REST API. Use the prompts above to have AI write the request code. For the tools available through MCP, see CoinGlass MCP.
Use Cases
| Scenario | Description |
|---|---|
| Study Halving Cycles | Use next_halving to align prices by the halving cycles given by the endpoint and compare price action at the same stage of different cycles. The boundaries of these cycles differ from the actual halving dates; for precise research, rely on block height. |
| Create S2F Charts | Combine the price and the halving countdown to create research charts on the relationship between bitcoin’s supply and price. |
| Halving Countdown Dashboard | Show the halving countdown given by the endpoint; when you need the exact halving date, rely on block height. |
| Cross-Check Multiple Indicators | Use it together with indicators related to miner revenue and supply, such as Puell Multiple. |
Related Endpoints
| Endpoint | How It Differs |
|---|---|
| Puell Multiple | Looks at the bitcoin cycle from the perspective of miner revenue |
| 2-Year MA Multiplier | Uses the 2-year moving average and 5× that average to spot cycle highs and lows |
| Bitcoin Rainbow Chart | Uses multiple colored price bands to gauge the long-term price position |
FAQ
What does next_halving mean?
It is the number of days until the next halving as given by the endpoint; it decreases by 1 each day, and after counting down to 0 it starts counting again. For example, 2010-08-18 has 834; 834 days later is 2012-11-29, whose next_halving is 0, and on the next day it becomes 1378.
Is the date on which next_halving is 0 the bitcoin halving date?
Not exactly. In the returned data, the dates on which next_halving is 0 are, in order, 2012-11-29, 2016-09-08, 2020-05-04, 2024-04-21 and 2028-05-04; bitcoin’s actual halvings took place at blocks 210000, 420000, 630000 and 840000, on 2012-11-28, 2016-07-09, 2020-05-11 and 2024-04-20 (UTC) respectively, with a gap of about two months in 2016. Do not use next_halving to determine actual halving dates; when you need exact dates, rely on block height. 2028-05-04 is a date given by the endpoint and does not represent a confirmed date for the next halving.
Why do the most recent records have no price?
The data runs up to the date on which next_halving next reaches 0, and dates that have not yet arrived have no price. For the day of the call and later dates, only timestamp and next_halving are returned, without the price field. Before calculating with prices or plotting, filter out the records without price first.
Is the timestamp in seconds or milliseconds?
Milliseconds (UTC), a 13-digit number; e.g., 1282089600000 is 2010-08-18 00:00 (UTC). Treat it as milliseconds when converting to dates.
Can I query ETH or other coins?
No. This endpoint has no request parameters and only returns data for bitcoin (BTC).
Learn More: Bitcoin Stock-to-Flow (S2F) Model
What Is the Stock-to-Flow (S2F) Ratio?
Stock-to-flow ratio = existing circulating supply (stock) ÷ new annual production (flow); the higher the value, the scarcer the asset. This metric is commonly used to measure the scarcity of precious metals such as gold, and starting in 2019, PlanB and others used it to build a bitcoin price model.
How Do Halvings Relate to S2F?
Bitcoin halves roughly every 4 years; after each halving, new production is cut in half and the S2F ratio roughly doubles as a result. The S2F model therefore holds that halvings increase bitcoin’s scarcity.
What Are the Limitations of the S2F Model?
The model considers only supply, not demand, interest rates, regulation or other factors, and in recent years bitcoin’s actual price has at times deviated significantly from the model’s valuation. It is better suited as a reference for understanding changes in supply than as a price prediction tool.
