How to get the Bitcoin price?

Step 1: Get the Bitcoin UUID

Each coin has a unique identifier (UUID) in Coinranking API. To get data for Bitcoin, you'll need to know and use its UUID in your request. Bitcoin’s UUID is Qwsogvtv82FCd. Learn how to get the UUID.

Step 2: Choose an endpoint

There are two endpoints suited for getting the Bitcoin price. These are the Get coin price and Get coin details endpoints.

Endpoint: Get coin price

https://api.coinranking.com/v2/coin/:uuid/price

Purpose: Directly retrieves the latest price of a specific cryptocurrency, such as Bitcoin.

Why use this endpoint?

If your sole requirement is to get the current price of Bitcoin quickly and without additional details about the coin, this endpoint is the most straightforward and efficient choice.

Pros

  • Can retrieve historical price
  • Fast
  • Efficient, because little data

Cons

  • No extra coin information

Endpoint: Get coin details

https://api.coinranking.com/v2/coin/:uuid

Purpose: Provides comprehensive information about a cryptocurrency, including its price, market cap, volume, supply data, and more.

Why use this endpoint?

If you need not only the price but also more detailed information about Bitcoin, like market cap, circulating supply or social links, this endpoint offers a broader set of data.

Pros

  • Extra coin information

Cons

  • Cannot retrieve historical price
  • Slightly slower

Step 3: Make a request

To make a request, you'll need to create a free API key by signing up to Coinranking API. If you already signed up, simply log in.

Copy your API key from the API key page in your account. you can make your request to one of the endpoints: