What is the API to get Bitcoin's real-time Buy price and sell price on my site? and how can get it from to implement in my website developed in PHP.

  • For which exchange? Commented Jun 25, 2013 at 17:35
  • I do not need form a particular exchange, I want to get a global price for buy and sell for bitcoins, so I can decide my exchange rate. Commented Jun 26, 2013 at 6:07
  • 2
    @JagdishRam fact is there is no single global price because different exchanges have different prices. If you want an index or average price then there is the coindesk index, the bitpay one and the winkdex. They all have APIs that you can use. However if you want the price for purposes of trading then it makes no sense to use an indexed price. Use the price of the exchange you will actually use.
    – Abdussamad
    Commented Apr 18, 2017 at 23:01

5 Answers 5


Bitcoin does not have one single buy and sell price. Bitcoins are exchanged on many different exchanges, each keeping track of their own market price.

However, BitcoinCharts.com has a useful API that summarises many of the largest exchanges according to their trading volume. You could use that to display the Bitcoin price on your website.

  • Thanks for the info, but I'm trying to add Bitcoin payments to a website and create a BTC invoice based on the current exchange rate and the USD price, I don't know how often people are going to want to pay via BTC and BitcoinCharts has this announcement on their api info page: Don't query more often than once every 15 minutes!, is there any other API or way to get the current exchange rate, thanks
    – user31889
    Commented Jan 13, 2016 at 19:34
  • 1
    That reply is quite old. Currently, CoinDesk has a pretty decent price API that takes multiple exchanges into account. Or you can just pick a single exchange and use their price. Commented Jan 14, 2016 at 7:56

Other interesting Bitcoin Price APIs that you might consider are those currently provided by Quandl and BitcoinAverage.




Check out 1Forge, they provide a free JSON API for several cryptocurrencies (Bitcoin, Etherium, LiteCoin, Ripple, Dash, and Bitcoin Cash). They also provide data for several standard Forex pairs + gold and silver.

Have a look at their documentation here: https://1forge.com/forex-data-api/api-documentation

If you’re using JavaScript/Node.JS, PHP, Python or Ruby then you can quickly bring in one of their libraries: https://1forge.com/forex-data-api/libraries


8 years old, but for the record:

  1. indices are usually (always?) a mid-market price; you probably want a real spot trade buy or sell price. Most likely you can only see that spread on the exchange you want to use.
  2. Unless you actually check the order book volumes, you can't be sure the price you see will not slip as you buy/sell with volume.

Those differences may make up as much as a couple percent even for small volumes.


Here is an open-source one i found, and the most simple one:


Instantly convert cryptocurrency and get price information.

  • Top 100 Crypto Currencies Supported

  • Top 30 Fiats Supported Price &

  • Ticker information updated on a configurable interval from multiple secure sources (Binance, Bitfinex, OKEx)

  • Any pair can be converted, be it Crypto -> Crypto or Fiat -> Crypto.

  • The asker is looking for a source for the Bitcoin price. It's not clear to me why you think that a fullblown trading tool is a fitting answer here. In case this is your project, please note that we require users to disclose when they recommend their own products. If you are looking to advertise your project here, you're probably here for the wrong reason.
    – Murch
    Commented Feb 6, 2021 at 22:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.