0
I am trying to use Blockchain.info Ticker API (https://blockchain.info/ticker) to get current BTC price in USD.
The interesting thing is that script not every time returns the same value. When you visit this page directly, none of the values never changes (well just every 15mins) https://blockchain.info/ticker, but on the script it changes on every nth refresh of the page.
Something similar happens if you go to blockchain.info/ticker? with at least a question mark added. Just refresh it a lot and you will see.
Why this is happening and how to get a stable price every 15mins as their API should provide it?
The script I use:
$api = "https://blockchain.info/ticker";
$json = file_get_contents($api);
$data = json_decode($json, TRUE);
$rate = $data["USD"]["sell"];
echo $rate;
I understand that mate. It just seems strange that it changes to the same value over and over again. For example if it's 1200$ in that ~15minutes period it sometimes changes to something value-10, like in this case to 1190$ while refreshing. – Simon – 2017-03-11T17:12:11.703