Author

Topic: Bitcoin's real-time Buy and Sell price API (Read 2270 times)

sr. member
Activity: 294
Merit: 250
November 30, 2013, 11:53:41 PM
#4
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.
use this, its the easiest way to do that ->


Code:


$c curl_init();
curl_setopt($cCURLOPT_RETURNTRANSFER1);
curl_setopt($cCURLOPT_HTTPHEADER, array('Accept: application/json''Content-Type: application/json'));
curl_setopt($cCURLOPT_URL'http://data.mtgox.com/api/2/BTCUSD/money/ticker');
$data curl_exec($c);
curl_close($c);
$obj json_decode($data);

?>





    


echo print_r($obj->{'data'}->{'avg'}->{'display_short'}, true);?>





Works like a charm Cheesy
i know this post was kinda old, but no one actually give some real answers so here is mine >.<
BCB
vip
Activity: 1078
Merit: 1002
BCJ

BTC-e.com
Crypty.com

All share the same API as MtGox.com and have examples in PHP and other languages under the API section of their respective websites.
sr. member
Activity: 457
Merit: 250
They have a PHP example here --> https://en.bitcoin.it/wiki/MtGox/API/HTTP
newbie
Activity: 8
Merit: 0
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.
Jump to: