<p>You can import straight from the exchanges market API.</p>

<p>Php example</p>

<pre><code>$url = "https://api.bitfinex.com/v1/ticker/btcusd";
$json = json_decode(file_get_contents($url), true);
$price = $json["last_price"];
echo $price;
</code></pre>

<p>Javascript xml</p>

<pre><code>var xbtc = new XMLHttpRequest();
        xbtc.open('GET',         'https://api.bitcoinaverage.com/ticker/global/USD/', true);
        xbtc.onreadystatechange = function(){
        if(xbtc.readyState == 4){
            var ticker = JSON.parse(xbtc.responseText);
            var price = ticker.last;
        document.getElementById('MyDiv').innerHTML = "$" + price;
        }
        };
        xbtc.send();
</code></pre>

<p><a href="http://btcthreads.com/display-the-exchange-rate-on-your-website/" rel="nofollow noreferrer">http://btcthreads.com/display-the-exchange-rate-on-your-website/</a></p>

CC BY-SA 3.0
2016-11-11T13:32:53.860Z
2016-11-11T13:51:16.110Z
2016-11-11T13:51:16.110Z
m1xolyd1an
<p>Take a look here: <a href="https://blockchain.info/api" rel="nofollow noreferrer">https://blockchain.info/api</a></p>

<p><a href="https://blockchain.info/ticker" rel="nofollow noreferrer">https://blockchain.info/ticker</a> gives you a json-object with recent data.</p>

CC BY-SA 3.0
2016-11-11T12:32:10.453Z
2016-11-11T12:32:10.453Z
Daniel
<p>I am planning to build a webpage where a user can enter his/her stock of various cryptocurrencies, and the webpage should display the current market value (in USD) for each of the cryptocurrency he/she has chosen.</p>

<p>I was wondering from where (which website/database) I can import the live market value for cryptocurrencies, so I can use the values in my website script?</p>

<p>Thank you very much in advance.</p>

<value><market><website-integration>
From where can I import live cryptocurrency market values into my webpage?
spartan81
# From where can I import live cryptocurrency market values into my webpage?

(Asked by: username_0 on 2016-11-11)

I am planning to build a webpage where a user can enter his/her stock of various cryptocurrencies, and the webpage should display the current market value (in USD) for each of the cryptocurrency he/she has chosen.

I was wondering from where (which website/database) I can import the live market value for cryptocurrencies, so I can use the values in my website script?

Thank you very much in advance.

**Tags:** value, market, website-integration


---

## 2 answers

### Answer by username_1 on 2016-11-11. Score: 0 | Accepted answer

You can import straight from the exchanges market API.

Php example

```
$url = "https://api.bitfinex.com/v1/ticker/btcusd";
$json = json_decode(file_get_contents($url), true);
$price = $json["last_price"];
echo $price;

```

Javascript xml

```
var xbtc = new XMLHttpRequest();
        xbtc.open('GET',         'https://api.bitcoinaverage.com/ticker/global/USD/', true);
        xbtc.onreadystatechange = function(){
        if(xbtc.readyState == 4){
            var ticker = JSON.parse(xbtc.responseText);
            var price = ticker.last;
        document.getElementById('MyDiv').innerHTML = "$" + price;
        }
        };
        xbtc.send();

```

<http://btcthreads.com/display-the-exchange-rate-on-your-website/>


---

### Answer by username_2 on 2016-11-11. Score: 0

Take a look here: <https://blockchain.info/api>

<https://blockchain.info/ticker> gives you a json-object with recent data.


---

