bitcoinTicker.php. A PHP script that helps you grab the latest bitcoin prices (in USD) from top exchanges.
Include the following line somewhere in your php script.
include_once 'path/to/bitcoinTicker.php';
Each of the following functions returns the latest USD value of one Bitcoin on the given exchange or price index. The functions are named after the excanhges, be careful of exchanges with similar sounding names.
- coindeskBPI()
- btcChina()
- OKCoin()
- bitfinex()
- coinbase()
- btce()
- bitStamp()
- campBX()
- kraken()
- crypto_trade()
The following is a simple script that includes the bitcoinTicker.php and then prints the latest Coindesk Bitcoin Price Index
<?php
// Include the bitcoinTicker file
include_once('bitcoinTicker.php');
// Print the coindeskBPI
print_r(coindeskBPI());
?>
Output:
621.55