There is the Bitcoin Market API, it is extremely simple and lightweight works with JSON. It is public does not need authentication 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
}
}
Already to make a function becomes 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']))
Speaks @Matheusgrossi! The question is wide open. Can you show what you tried? Or narrow the question to a specific API?
– vinibrsl
So, I’m trying to make a script in Python that checks the Bitcoin quotation in real time, so that later I use this information for other purposes, however at first the intention is just to check how much this is worth at the time the script is executed...
– Matheus Grossi
What API have you used? You can show the part that is doing the query in this script?
– vinibrsl
Initially I used one called Bitcoin-Python, and regarding the script I did several "drafts" of this, however none of them presented me the desired result, so these were deleted without the possibility of recovery.
– Matheus Grossi