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.
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.
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
8 years old, but for the record:
- 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.
- 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.