Bitcoin Forum
May 11, 2024, 08:25:24 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: blockchain.info ticker now not working?  (Read 946 times)
dozerz (OP)
Legendary
*
Offline Offline

Activity: 2215
Merit: 1057



View Profile
December 16, 2014, 12:31:55 PM
Last edit: December 16, 2014, 01:28:13 PM by dozerz
 #1

i have the following code running that has suddenly stopped working yesterday to get btc price in usd

$file = file_get_contents("http://blockchain.info/ticker");
    $vars = json_decode($file, true);
    $usd = $vars['USD']['15m'];

has something recently changed in the api? offering a bounty to fix this.

space for rent, shilling for sats
1715459124
Hero Member
*
Offline Offline

Posts: 1715459124

View Profile Personal Message (Offline)

Ignore
1715459124
Reply with quote  #2

1715459124
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715459124
Hero Member
*
Offline Offline

Posts: 1715459124

View Profile Personal Message (Offline)

Ignore
1715459124
Reply with quote  #2

1715459124
Report to moderator
1715459124
Hero Member
*
Offline Offline

Posts: 1715459124

View Profile Personal Message (Offline)

Ignore
1715459124
Reply with quote  #2

1715459124
Report to moderator
OnkelPaul
Legendary
*
Offline Offline

Activity: 1039
Merit: 1004



View Profile
December 16, 2014, 01:20:28 PM
 #2

Don't know why it's not working for you, so I can't fix that.
The data returned from http://blockchain.info/ticker looks ok, I can't run it through your PHP code at the moment but that shouldn't matter since you didn't change it.
I noticed that the data contains unicode chars for currency symbols, but I don't think that is new, so it should just work. But you might want to run a simple PHP test program to check for that.

I can offer one fix for your subject line, though: it's blockchain.info, not blockhain.info. Do I get a bounty now? (just kidding)

Onkel Paul

dozerz (OP)
Legendary
*
Offline Offline

Activity: 2215
Merit: 1057



View Profile
December 16, 2014, 01:31:02 PM
 #3

thanks have updated the subject line Smiley

the next line is below but is now returning nothing, are you interested in fixing this?

$net_usd = number_format((($usd) * (100 - Settings::fee)) / 100, 2);

space for rent, shilling for sats
IamAGentleman
Full Member
***
Offline Offline

Activity: 134
Merit: 100


View Profile
December 19, 2014, 12:00:58 PM
 #4

Are you echoing the variable? Does your server have Curl?
bitspill
Legendary
*
Offline Offline

Activity: 2058
Merit: 1015



View Profile
December 20, 2014, 07:49:19 AM
 #5

How often were you hitting the ticker? Did they rate limit you and block your ip temporarily?

{ BitSpill }
dozerz (OP)
Legendary
*
Offline Offline

Activity: 2215
Merit: 1057



View Profile
December 20, 2014, 12:11:29 PM
 #6

fyi this was fixed as blockchain updated to https, thanks for the suggestion.

space for rent, shilling for sats
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!