6

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.

3
  • For which exchange? 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. 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
    Apr 18, 2017 at 23:01

5 Answers 5

9

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.

2
  • 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
    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. Jan 14, 2016 at 7:56
0

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

https://blog.quandl.com/getting-started-with-the-quandl-api

https://bitcoinaverage.com/en/api-collections

1
0

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

0

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.

-2

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

https://github.com/coinconvert/crypto-convert

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.

1
  • 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
    Feb 6, 2021 at 22:19

Your Answer

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

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