There is the Bitcoin Market API, it is extremely simple and lightweight works with JSON. It's publish does not need authenticity for prices
https://www.mercadobitcoin.net/api/BTC/ticker/
Returns
{"ticker":
{"high": "17770.00000000",
"low": "17420.00000000",
"vol": "316.44974311",
"last": "17430.90199000",
"buy": "17430.90199000",
"sell": "17487.00000000",
"date": 1508016142
}
}
Now to make a function look very simple with python
import json
import urllib2
def get_btc():
response = urllib2.urlopen('https://www.mercadobitcoin.net/api/BTC/ticker/')
json_str = response.read()
btc_data = json.loads(json_str)
return btc_data['ticker']
btc_ticker = def get_btc()
print "O preco do Bitcoin agora e: R$ {:.2f}".format(float(btc_ticker['last']))