Bitcoin API
The Bitcoin API provides access to the latest Bitcoin price and market data.
Available endpoints:
- /v1/bitcoin - Get the latest Bitcoin price and market data
- /v1/bitcoinhistorical - Get historical Bitcoin price data
- /v1/bitcointreasury - SEC-reported bitcoin holdings of companies and funds
Premium members have access to live prices. Free users receive the price as of the top of the current hour, updated once per hour.
From 9,829 users
Applications using this API
API Status
API Response Times
Average | P50 | P75 | P90 | P95 |
|---|---|---|---|---|
| 247ms | 265ms | 287ms | 683ms | 1173ms |
Similar APIs
Didn't find what you were looking for? Suggest an improvement
https://api.api-ninjas.com/v1/bitcoin
Returns the latest Bitcoin price in USD and 24-hour market data. Premium members have access to live prices. Free users receive the price as of the top of the current hour, updated once per hour. For historical price data, see /v1/bitcoinhistorical.
Headers
X-Api-KeyrequiredAPI Key associated with your account.
Response
A JSON object with the following fields or an error if the request is unsuccessful.
priceThe price of Bitcoin in USD.
timestampThe timestamp of the price in Unix format (in seconds). On paid plans this is the moment the price was read. On the free plan it is the top of the current hour — the price is the close of the last completed hour, so every request within the same hour returns the same price and the same timestamp.
24h_price_changeThe price change of Bitcoin in USD over the last 24 hours.
24h_price_change_percentThe price change percentage of Bitcoin over the last 24 hours.
24h_highThe highest price of Bitcoin in USD over the last 24 hours.
24h_lowThe lowest price of Bitcoin in USD over the last 24 hours.
24h_volumeThe volume of Bitcoin traded over the last 24 hours.
Live Demo
Get a free API key to get started — no credit card required.
Code Examples
curl -X GET "https://api.api-ninjas.com/v1/bitcoin" \
-H "X-Api-Key: YOUR_API_KEY"If your programming language is not listed in the Code Example above, you can still make API calls by using a HTTP request library written in your programming language and following the above documentation.
Premium only
https://api.api-ninjas.com/v1/bitcoinhistorical
Returns historical price data for Bitcoin in USD.
Parameters
intervaloptionalTime interval between data points. Valid values are:
1m,5m,15m,30m,1h,4h,1d. Default is5m.startoptionalStart timestamp in Unix format (in seconds). If not provided, the most recent
limitdata points are returned.endoptionalEnd timestamp in Unix format (in seconds). If not provided, defaults to current time.
limitoptionalMaximum number of data points to return. Default is 100, maximum is 1000.
Headers
X-Api-KeyrequiredAPI Key associated with your account.
Response
A JSON object with the following fields or an error if the request is unsuccessful.
priceThe price of Bitcoin in USD.
timestampThe timestamp of the price in Unix format (in seconds).
Sample Request
https://api.api-ninjas.com/v1/bitcoinhistorical?interval=1h&start=1637809196&end=1637895596&limit=10Sample Response
Code Examples
curl -X GET "https://api.api-ninjas.com/v1/bitcoinhistorical?interval=1h&start=1637809196&end=1637895596&limit=10" \
-H "X-Api-Key: YOUR_API_KEY"New
https://api.api-ninjas.com/v1/bitcointreasury
Returns bitcoin positions that companies, funds and private filers report to the SEC — both operating companies and spot bitcoin ETFs — ranked by value. Use entity_type=ETP for funds only. For holdings in other crypto assets, see /v1/cryptotreasury.
This endpoint covers bitcoin held by the filer. For who holds the spot bitcoin ETFs themselves — the institutional managers reporting IBIT, FBTC or GBTC positions on Form 13F — use /v1/institutionalownership.
Positions come from SEC XBRL crypto-asset disclosures filed under ASU 2023-08, so this is a record of SEC-reported positions rather than a complete list of every bitcoin holder. Holders listed only outside the US are not included, and some US-listed holders are missing. These are quarterly balance-sheet figures, not a live feed: each result carries a period_end, and filings usually arrive one to three months after it. History starts in 2024 but is sparse before the fourth quarter of 2025, when most filers began reporting. SEC filings are public domain, so you may store, redistribute and display these results commercially.
Parameters
tickeroptionalStock ticker of the filer (e.g.
MSTR). Private filers have no ticker — usecik.cikoptionalSEC Central Index Key of the filer, with or without leading zeros.
nameoptionalCase-insensitive substring match on the filer name. Requires a Business or Professional subscription.
entity_typeoptionalOPERATINGfor a company holding crypto on its balance sheet,ETPfor an exchange-traded product whose holdings are the fund itself, orPRIVATEfor a filer with no listed ticker.periodoptionalReporting period end as
YYYY-MM-DD, orlatest. Defaults to the most recent period. How far back you may query depends on your subscription tier.include_unverifiedoptionalInclude filings whose unit count does not reconcile with their own reported fair value. Excluded by default; when included they are reproduced exactly as filed and carry a warning.
limitoptionalMaximum results to return. Capped at 5 on Free, 50 on Developer, and 250 on Business and Professional.
offsetoptionalNumber of results to skip, for pagination. Default is
0, maximum is10000.
Headers
X-Api-KeyrequiredAPI Key associated with your account.
Response
A JSON object with the following fields or an error if the request is unsuccessful.
resultsarrayMatching treasury positions.
entity_namestringFiler name as it appears in EDGAR.
tickerstringStock ticker, or
nullfor private filers.cikstringSEC Central Index Key, zero-padded to 10 digits.
entity_typestringOPERATING,ETPorPRIVATE.assetstringCanonical asset name, for example
BITCOIN.unitsnumberCoins held at the period end. Fractional holdings are returned as filed.
fair_value_usdnumberValue of this asset position.
nullwhen the filer holds several assets and did not break the value out per asset — useentity_total_crypto_fair_value_usdinstead.cost_usdnumberCost basis as reported, or
nullwhere the filer did not disclose it.entity_total_crypto_fair_value_usdnumberThe filer's total crypto fair value across all assets.
entity_holds_multiple_assetsbooleanTrue when the filer reported more than one crypto asset for this period.
period_endstringReporting period end as
YYYY-MM-DD.calendar_yearintegerCalendar year of the reporting period. Not the filer's fiscal year.
calendar_quarterstringCalendar quarter,
Q1toQ4. Not the filer's fiscal quarter.accessionstringSEC accession number of the source filing.
sec_filing_urlstringLink to the source filing on EDGAR.
attributionobjectHow the figure was derived, so you can audit it. Contains
asset_source,units_basis,units_facts_reconciled,recovered_from_instance_document,quality,implied_unit_price_usdandmarket_price_at_period_end_usd.disclosureobjectData source, your redistribution rights, and a not-investment-advice notice.
Code Examples
curl -X GET "https://api.api-ninjas.com/v1/bitcointreasury?limit=5" \
-H "X-Api-Key: YOUR_API_KEY"Frequently Asked Questions
Can I use the Bitcoin API for commercial purposes?
Yes, but you must have a premium subscription. Commercial use of the Bitcoin API is not permitted on the free tier. See our pricing page to choose a plan that fits your needs.How do I get an API key and start using the Bitcoin API?
Sign up for a free account to instantly get your API key, then pass it in theX-Api-Keyheader on every request. The documentation above includes ready-to-run examples in cURL, Python, JavaScript, Node.js, and more.What happens if I exceed my quota for the month?
Your API requests will simply be denied once you hit your monthly quota — you will never be charged more than the plan you signed up for. To increase your quota, you can upgrade your plan any time on our pricing page.What happens if a request to the Bitcoin API fails?
The API responds with a standard HTTP status code and a JSON error message describing the problem. See our error codes reference for the full list of codes and how to resolve each one, or contact support if you need help.Who owns the spot bitcoin ETFs themselves?
That is a different question from who holds bitcoin directly, and a different endpoint:/v1/institutionalownership?ticker=IBITreturns the institutional managers reporting a position in the fund on Form 13F — well over a thousand holders of iShares Bitcoin Trust, with quarterly changes.FBTC,GBTC,ARKBandBITBwork the same way. See the Institutional Holdings API.Which companies and ETFs hold the most bitcoin?
Call/v1/bitcointreasuryfor SEC-reported bitcoin positions ranked by bitcoin held, covering both operating companies and spot bitcoin ETFs; the largest include Strategy and iShares Bitcoin Trust. Useentity_type=ETPfor funds only orentity_type=OPERATINGfor companies. Coverage is limited to SEC filers, so holders listed only outside the US are not included, and each position is as of the filer's latest quarterly report. For holdings in other crypto assets, use /v1/cryptotreasury.Where does the bitcoin treasury data come from, and can I redistribute it?
Every figure comes from SEC XBRL crypto-asset disclosures filed under ASU 2023-08, cited by accession number with a link to the filing on EDGAR. SEC filing data is a U.S. Government work in the public domain under 17 U.S.C. 105, so unlike most crypto data vendors we grant you the right to store, redistribute and display it commercially. See pricing.How current are the treasury holdings?
They are quarterly balance-sheet disclosures, so a position is as of the filer's reported period end and can be several months old — a 10-Q lands weeks after the quarter closes, and late filers and amendments keep arriving for months. Every result carriesperiod_endso the as-of date is explicit. For live prices use/v1/bitcoininstead.What endpoints does the Bitcoin API provide?
The API has two endpoints:/v1/bitcoinreturns the latest Bitcoin price and 24-hour market data, and/v1/bitcoinhistoricalreturns historical price data. The historical endpoint is Premium only, and to get prices for other coins you can use the Crypto Price API.What fields are included in the live /v1/bitcoin response?
Each response is a JSON object containingprice(USD),timestamp(Unix seconds),24h_price_change,24h_price_change_percent,24h_high,24h_low, and24h_volume, or an error if the request is unsuccessful. For equity or commodity pricing, see the Stock Price API and Commodity Price API.How do I query a specific historical time range?
On the/v1/bitcoinhistoricalendpoint, passstartandendas Unix timestamps (seconds), set theinterval(one of1m,5m,15m,30m,1h,4h, or1d, defaulting to5m), and uselimitto cap results (default 100, maximum 1000). This endpoint requires a Premium plan.How fresh is the Bitcoin price data?
Premium members get live prices. Free users get the price as of the top of the current hour — the price, and the 24-hour statistics alongside it, are all measured at the close of the last completed hour and update once per hour. Thetimestampfield always gives the exact moment the data was measured, so on the free plan every request within the same hour returns the same values. Browse other available data in the full API catalog.
Explore API integration use cases for recommended APIs and workflow examples.