<p>BitPay have a JSON API on <a href="https://bitpay.com/api/rates" rel="nofollow">https://bitpay.com/api/rates</a><br>
You can get BRL value with this command and calculate, (this API update every 1 minute)</p>

<pre><code>curl -ks https://bitpay.com/api/rates | python -m json.tool | grep -iA 1 'Brasilian Real' | grep -i 'rate' | cut -f2 -d ':' | tr -d ' '
</code></pre>

<hr>

<p>You will need:<br>
- CURL<br>
- Python 2.7+<br>
- grep + cut + tr  </p>

CC BY-SA 3.0
2015-02-05T18:31:20.260Z
2015-02-05T18:31:20.260Z
Thiago Pereira
<p>This is a simple way to <a href="http://php.net/manual/en/function.print.php" rel="nofollow">print</a> the value of 1 BTC in BRL with PHP.</p>

<p>You could manipulate the string containing the value for 1 BTC in BRL further if you need.</p>

<pre><code>&lt;?php

$jsnsrc = "https://blockchain.info/ticker";
$json = file_get_contents($jsnsrc);
$json = json_decode($json);
$one_Btc_To_Brl = $json-&gt;BRL-&gt;last;

print "1 BTC = " . $one_Btc_to_Brl;
?&gt;
</code></pre>

CC BY-SA 3.0
2016-10-26T16:16:48.347Z
why Thiago Pereira answer requires so many additional setup but yours just plain PHP?
4 Leave Cover
CC BY-SA 3.0
2015-02-05T23:48:24.747Z
2015-02-05T23:48:24.747Z
Dhuum
<p>You could start by parsing the JSON here:</p>

<p><a href="https://bitpay.com/bitcoin-exchange-rates" rel="nofollow">https://bitpay.com/bitcoin-exchange-rates</a></p>

CC BY-SA 3.0
2014-04-03T00:49:13.753Z
2014-04-03T00:49:13.753Z
Avram
<p>Try this <a href="http://www.converterhub.com" rel="nofollow">currency converter</a> site, they might have updated rates for BRL = BTC</p>

CC BY-SA 3.0
2014-01-02T20:25:02.243Z
2014-01-02T20:25:02.243Z
Arnold
<p>wget --no-check-certificate <a href="https://www.mercadobitcoin.com.br/api/ticker/" rel="nofollow">https://www.mercadobitcoin.com.br/api/ticker/</a></p>

<p>returns data that can be parsed relatively easily.</p>

CC BY-SA 3.0
2014-06-02T02:55:54.530Z
2014-06-02T02:55:54.530Z
Felipe Voloch
<p>Is there anyway to get current rate of BRL = BTC.</p>

<p>I saw the <a href="https://blockchain.info/ticker" rel="nofollow">blockchiain ticker</a>. But the value for BRL currency is not updated 
As listed <a href="http://preev.com/btc/brl" rel="nofollow">here in preev</a>.
I want to get the</p>

<pre><code> current 1BTC= how much BRL
</code></pre>

<p>Thanks in advance!</p>

CC BY-SA 3.0
2013-05-13T15:25:48.053Z
What do you mean that it's not updated?
Nick ODell
CC BY-SA 3.0
2013-05-14T09:48:12.440Z
@NickODell as the bitcoin value keep fluctuating, accordingly the value of the BRL currency also changing so this  value is not shown as it changes.
sandip
CC BY-SA 3.0
2014-03-04T02:01:04.577Z
There are actually a couple of Brazilian exchanges that publish rates, but what they're not doing is providing an API. That's going to make it more difficult to curl in.
Yitzhak
CC BY-SA 3.0
2014-03-04T02:02:36.140Z
Something you could do is use the btc-e api to get the bitcoin to dollars or euros price, and find a forex api that does dollars or euros to Real, and mash the whole thing together.
Yitzhak
CC BY-SA 3.0
2014-06-02T13:08:14.310Z
@DoctorEvil Bitcoin is overcharged in Brazil, so your procedure won't return the actual price there. Mercado Bitcoin now has an API, see my answer.
Felipe Voloch
<api><exchange-rate>
How to get current BTC rate for BRL(real) using php cURL or javascript
sandip
# How to get current BTC rate for BRL(real) using php cURL or javascript

(Asked by: username_0 on 2013-05-13)

Is there anyway to get current rate of BRL = BTC.

I saw the [blockchiain ticker](https://blockchain.info/ticker). But the value for BRL currency is not updated
As listed [here in preev](http://preev.com/btc/brl).
I want to get the

```
 current 1BTC= how much BRL

```

Thanks in advance!

**Tags:** api, exchange-rate

> **Comments:**
> **username_1**: What do you mean that it's not updated?  
> **username_0**: @username_1 as the bitcoin value keep fluctuating, accordingly the value of the BRL currency also changing so this  value is not shown as it changes.  
> **username_2**: There are actually a couple of Brazilian exchanges that publish rates, but what they're not doing is providing an API. That's going to make it more difficult to curl in.  
> **username_2**: Something you could do is use the btc-e api to get the bitcoin to dollars or euros price, and find a forex api that does dollars or euros to Real, and mash the whole thing together.  
> **username_3**: @DoctorEvil Bitcoin is overcharged in Brazil, so your procedure won't return the actual price there. Mercado Bitcoin now has an API, see my answer.  

---

## 5 answers

### Answer by username_4 on 2015-02-05. Score: 2

BitPay have a JSON API on <https://bitpay.com/api/rates>  
You can get BRL value with this command and calculate, (this API update every 1 minute)

```
curl -ks https://bitpay.com/api/rates | python -m json.tool | grep -iA 1 'Brasilian Real' | grep -i 'rate' | cut -f2 -d ':' | tr -d ' '

```

---

You will need:  
- CURL  
- Python 2.7+  
- grep + cut + tr


---

### Answer by username_5 on 2015-02-05. Score: 1

This is a simple way to [print](http://php.net/manual/en/function.print.php) the value of 1 BTC in BRL with PHP.

You could manipulate the string containing the value for 1 BTC in BRL further if you need.

```
<?php

$jsnsrc = "https://blockchain.info/ticker";
$json = file_get_contents($jsnsrc);
$json = json_decode($json);
$one_Btc_To_Brl = $json->BRL->last;

print "1 BTC = " . $one_Btc_to_Brl;
?>

```

> **Comments:**
> **username_6**: why username_4 username_4 answer requires so many additional setup but yours just plain PHP?  

---

### Answer by username_7 on 2014-04-03. Score: 0

You could start by parsing the JSON here:

<https://bitpay.com/bitcoin-exchange-rates>


---

### Answer by username_8 on 2014-01-02. Score: 0

Try this [currency converter](http://www.converterhub.com) site, they might have updated rates for BRL = BTC


---

### Answer by username_3 on 2014-06-02. Score: 0

wget --no-check-certificate <https://www.mercadobitcoin.com.br/api/ticker/>

returns data that can be parsed relatively easily.


---

