<p>There's nothing wrong with your PHP syntax or blockchain.info. The Bitcoin value is always changing. It is traded 365 days a year, 24 hours a day on a multiple exchanges around the globe. </p>

CC BY-SA 3.0
2017-03-11T17:12:11.703Z
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
CC BY-SA 3.0
2017-03-08T01:45:19.867Z
2017-03-08T01:45:19.867Z
m1xolyd1an
<p>I am trying to use Blockchain.info Ticker API (<a href="https://blockchain.info/ticker" rel="nofollow noreferrer">https://blockchain.info/ticker</a>) to get current BTC price in USD.</p>

<p>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) <a href="https://blockchain.info/ticker" rel="nofollow noreferrer">https://blockchain.info/ticker</a>, but on the script it changes on every nth refresh of the page.</p>

<p>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.</p>

<p>Why this is happening and how to get a stable price every 15mins as their API should provide it?</p>

<p>The script I use:</p>

<pre><code>$api = "https://blockchain.info/ticker";
$json = file_get_contents($api);
$data = json_decode($json, TRUE);
$rate = $data["USD"]["sell"];
echo $rate;
</code></pre>

<blockchain.info><exchange-rate><php>
Why Bitcoinchain.info Ticker API is not stable?
Simon
# Why Bitcoinchain.info Ticker API is not stable?

(Asked by: username_0 on 2017-03-07)

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;

**Tags:** blockchain.info, exchange-rate, php


---

## 1 answers

### Answer by username_1 on 2017-03-08. Score: 1

There's nothing wrong with your PHP syntax or blockchain.info. The Bitcoin value is always changing. It is traded 365 days a year, 24 hours a day on a multiple exchanges around the globe.

> **Comments:**
> **username_0**: 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.  

---

