Bitcoin Forum

Bitcoin => Project Development => Topic started by: dozerz on December 16, 2014, 12:31:55 PM



Title: blockchain.info ticker now not working?
Post by: dozerz on December 16, 2014, 12:31:55 PM
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.


Title: Re: blockhain.info ticker now not working?
Post by: OnkelPaul on December 16, 2014, 01:20:28 PM
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


Title: Re: blockchain.info ticker now not working?
Post by: dozerz on December 16, 2014, 01:31:02 PM
thanks have updated the subject line :)

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


Title: Re: blockchain.info ticker now not working?
Post by: IamAGentleman on December 19, 2014, 12:00:58 PM
Are you echoing the variable? Does your server have Curl?


Title: Re: blockchain.info ticker now not working?
Post by: bitspill on December 20, 2014, 07:49:19 AM
How often were you hitting the ticker? Did they rate limit you and block your ip temporarily?


Title: Re: blockchain.info ticker now not working?
Post by: dozerz on December 20, 2014, 12:11:29 PM
fyi this was fixed as blockchain updated to https, thanks for the suggestion.