Autor: n1g1channel 2021-12-05 10:45
import requests
import json
def getBtc():
try:
response = requests.get("https://www.bitstamp.net/api/v2/ticker/btcusd")
response = response.json()
return str("$"+"{:,.2f}".format(float(response["last"])))
except:
return "Algo salio mal"
print(getBtc())