Skip to content

Instantly share code, notes, and snippets.

View MiloDavis's full-sized avatar

Milo Davis MiloDavis

  • London, UK
View GitHub Profile
#!/usr/bin/env python
import requests
import json
from forex_python.bitcoin import BtcConverter
def get_price(symbol):
currency = json.loads(requests.get("https://coinmarketcap-nexuist.rhcloud.com/api/" + symbol).text)
return currency['price']['usd']
b = BtcConverter()
import requests
import json
tzusd = json.loads(requests.get("https://api.hitbtc.com/api/2/public/ticker/XTZUSD").text)
last_price = tzusd['last']
num_tez = 763306929.69
print "${:,.2f}\t{:,.2f}\t${:,.2f}".format(float(last_price), float(num_tez), num_tez * float(last_price))