Bitcoin Forum

Economy => Service Discussion => Topic started by: ptahiliani on June 25, 2013, 10:50:11 AM



Title: Bitcoin's real-time Buy and Sell price API
Post by: ptahiliani on June 25, 2013, 10:50:11 AM
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.


Title: Re: Bitcoin's real-time Buy and Sell price API
Post by: Ascension on June 25, 2013, 10:53:51 AM
They have a PHP example here --> https://en.bitcoin.it/wiki/MtGox/API/HTTP


Title: Re: Bitcoin's real-time Buy and Sell price API
Post by: BCB on June 25, 2013, 11:02:32 AM

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.


Title: Re: Bitcoin's real-time Buy and Sell price API
Post by: akipfer on December 01, 2013, 03:53:41 AM
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:


<?php
$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);

?>



<table>
<tr>
     <td>
<?php echo print_r($obj->{'data'}->{'avg'}->{'display_short'}, true);?>
</td>
</tr>
</table>
</div>



Works like a charm :D
i know this post was kinda old, but no one actually give some real answers so here is mine >.<