Bitcoin Forum
July 07, 2024, 10:32:04 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Mt gox ticker  (Read 403 times)
BitvoinVender (OP)
Newbie
*
Offline Offline

Activity: 46
Merit: 0


View Profile
April 16, 2013, 08:53:45 PM
 #1

if anyone is looking for an easy MTgox price ticker in PHP, After digging around I found one that still works

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);

echo 
print_r($obj->{'data'}->{'avg'}->{'display_short'}."\n"true);

?>


edit got it
last price
Code:
<?php echo print_r($obj->{'data'}->{'last'}->{'display_short'}."\n"true?>
noah977
Newbie
*
Offline Offline

Activity: 17
Merit: 0



View Profile WWW
May 01, 2013, 08:06:30 AM
 #2

There are much better tools in Python for MtGox.
curtisbigs
Newbie
*
Offline Offline

Activity: 13
Merit: 0


View Profile
May 01, 2013, 08:16:30 AM
 #3

thanks for the share, this will definitely come in handy
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!