Is there anyway to get current rate of BRL = BTC.
current 1BTC= how much BRL
Thanks in advance!
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:
- Python 2.7+
- grep + cut + tr
This is a simple way to print 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; ?>
Try this currency converter site, they might have updated rates for BRL = BTC
You could start by parsing the JSON here:
wget --no-check-certificate https://www.mercadobitcoin.com.br/api/ticker/
returns data that can be parsed relatively easily.