Holiday Sale! Get over 30% off when you subscribe to an annual plan!

Bitcoin API

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

Available endpoints:

(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
274ms315ms365ms580ms979ms

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


/v1/bitcoin GET

https://api.api-ninjas.com/v1/bitcoin

Returns the latest Bitcoin price in USD and 24-hour market data. For historical price data, see /v1/bitcoinhistorical.

Headers

  • X-Api-Key  required

    API Key associated with your account.

Response

  • price

    The price of Bitcoin in USD.

  • timestamp

    The timestamp of the price in Unix format (in seconds).

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

Sample Request Live Demo!

Try this API endpoint with all available parameters in our API playground

https://api.api-ninjas.com/v1/bitcoin

Headers

X-Api-KeyLog in or sign up to get your API Key

Sample Response

JSON

Code Examples

1 2 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.


/v1/bitcoinhistorical GET 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, defaults to 24 hours ago.

  • 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

  • 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