NewConnect Claude, Gemini, ChatGPT, and other AI agents to API Ninjas via our MCP server

Bitcoin API

The Bitcoin API provides access to the latest Bitcoin price and market data.

Available endpoints:

Premium members have access to live prices. Free users receive the price as of the top of the current hour, updated once per hour.

Online
(4.8)

From 9,829 users

2,500+

Applications using this API

API Status

Online - All Systems Operational

API Response Times

Average
P50
P75
P90
P95
247ms265ms287ms683ms1173ms

Didn't find what you were looking for? Suggest an improvement

2 endpoints

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-Key  required

    API Key associated with your account.

Response

A JSON object with the following fields or an error if the request is unsuccessful.

  • price

    The price of Bitcoin in USD.

  • timestamp

    The 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_change

    The price change of Bitcoin in USD over the last 24 hours.

  • 24h_price_change_percent

    The price change percentage of Bitcoin over the last 24 hours.

  • 24h_high

    The highest price of Bitcoin in USD over the last 24 hours.

  • 24h_low

    The lowest price of Bitcoin in USD over the last 24 hours.

  • 24h_volume

    The volume of Bitcoin traded over the last 24 hours.

Live Demo

Live demo · no API key required

Get a free API key to get started — no credit card required.

Headers
X-Api-KeyLog in or sign up to get your API key
GET
https://api.api-ninjas.com/v1/bitcoin
Sample response
{
"price": "94962.21000000",
"timestamp": 1736824504,
"24h_price_change": "849.92000000",
"24h_price_change_percent": "0.903",
"24h_high": "95222.00000000",
"24h_low": "89438.45000000",
"24h_volume": "26.39660000"
}

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

  • interval  optional

    Time interval between data points. Valid values are: 1m, 5m, 15m, 30m, 1h, 4h, 1d. Default is 5m.

  • start  optional

    Start timestamp in Unix format (in seconds). If not provided, the most recent limit data points are returned.

  • end  optional

    End timestamp in Unix format (in seconds). If not provided, defaults to current time.

  • limit  optional

    Maximum number of data points to return. Default is 100, maximum is 1000.

Headers

  • X-Api-Key  required

    API Key associated with your account.

Response

A JSON object with the following fields or an error if the request is unsuccessful.

  • price

    The price of Bitcoin in USD.

  • timestamp

    The 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=10

Sample Response

JSON
[
    {
      timestamp:1637812799,
      price:"57713.69000000"
    },
    {
      timestamp:1637816399,
      price:"57258.49000000"
    },
    {
      timestamp:1637819999,
      price:"57120.91000000"
    },
    {
      timestamp:1637823599,
      price:"57253.15000000"
    },
    {
      timestamp:1637827199,
      price:"57652.55000000"
    },
    {
      timestamp:1637830799,
      price:"57563.02000000"
    },
    {
      timestamp:1637834399,
      price:"57773.22000000"
    },
    {
      timestamp:1637837999,
      price:"57997.06000000"
    },
    {
      timestamp:1637841599,
      price:"57990.62000000"
    },
    {
      timestamp:1637845199,
      price:"58646.55000000"
    }
]

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

  • ticker  optional

    Stock ticker of the filer (e.g. MSTR). Private filers have no ticker — use cik.

  • cik  optional

    SEC Central Index Key of the filer, with or without leading zeros.

  • name  optional

    Case-insensitive substring match on the filer name. Requires a Business or Professional subscription.

  • entity_type  optional

    OPERATING for a company holding crypto on its balance sheet, ETP for an exchange-traded product whose holdings are the fund itself, or PRIVATE for a filer with no listed ticker.

  • period  optional

    Reporting period end as YYYY-MM-DD, or latest. Defaults to the most recent period. How far back you may query depends on your subscription tier.

  • include_unverified  optional

    Include 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.

  • limit  optional

    Maximum results to return. Capped at 5 on Free, 50 on Developer, and 250 on Business and Professional.

  • offset  optional

    Number of results to skip, for pagination. Default is 0, maximum is 10000.

Headers

  • X-Api-Key  required

    API Key associated with your account.

Response

A JSON object with the following fields or an error if the request is unsuccessful.

  • results  array

    Matching treasury positions.

  • entity_name  string

    Filer name as it appears in EDGAR.

  • ticker  string

    Stock ticker, or null for private filers.

  • cik  string

    SEC Central Index Key, zero-padded to 10 digits.

  • entity_type  string

    OPERATING, ETP or PRIVATE.

  • asset  string

    Canonical asset name, for example BITCOIN.

  • units  number

    Coins held at the period end. Fractional holdings are returned as filed.

  • fair_value_usd  number

    Value of this asset position. null when the filer holds several assets and did not break the value out per asset — use entity_total_crypto_fair_value_usd instead.

  • cost_usd  number

    Cost basis as reported, or null where the filer did not disclose it.

  • entity_total_crypto_fair_value_usd  number

    The filer's total crypto fair value across all assets.

  • entity_holds_multiple_assets  boolean

    True when the filer reported more than one crypto asset for this period.

  • period_end  string

    Reporting period end as YYYY-MM-DD.

  • calendar_year  integer

    Calendar year of the reporting period. Not the filer's fiscal year.

  • calendar_quarter  string

    Calendar quarter, Q1 to Q4. Not the filer's fiscal quarter.

  • accession  string

    SEC accession number of the source filing.

  • sec_filing_url  string

    Link to the source filing on EDGAR.

  • attribution  object

    How 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_usd and market_price_at_period_end_usd.

  • disclosure  object

    Data 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

  • 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.
  • Sign up for a free account to instantly get your API key, then pass it in the X-Api-Key header on every request. The documentation above includes ready-to-run examples in cURL, Python, JavaScript, Node.js, and more.
  • 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.
  • 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.
  • That is a different question from who holds bitcoin directly, and a different endpoint: /v1/institutionalownership?ticker=IBIT returns 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, ARKB and BITB work the same way. See the Institutional Holdings API.
  • Call /v1/bitcointreasury for SEC-reported bitcoin positions ranked by bitcoin held, covering both operating companies and spot bitcoin ETFs; the largest include Strategy and iShares Bitcoin Trust. Use entity_type=ETP for funds only or entity_type=OPERATING for 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.
  • 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.
  • 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 carries period_end so the as-of date is explicit. For live prices use /v1/bitcoin instead.
  • The API has two endpoints: /v1/bitcoin returns the latest Bitcoin price and 24-hour market data, and /v1/bitcoinhistorical returns historical price data. The historical endpoint is Premium only, and to get prices for other coins you can use the Crypto Price API.
  • Each response is a JSON object containing price (USD), timestamp (Unix seconds), 24h_price_change, 24h_price_change_percent, 24h_high, 24h_low, and 24h_volume, or an error if the request is unsuccessful. For equity or commodity pricing, see the Stock Price API and Commodity Price API.
  • On the /v1/bitcoinhistorical endpoint, pass start and end as Unix timestamps (seconds), set the interval (one of 1m, 5m, 15m, 30m, 1h, 4h, or 1d, defaulting to 5m), and use limit to cap results (default 100, maximum 1000). This endpoint requires a Premium plan.
  • 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. The timestamp field 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.