Skip to content

Instantly share code, notes, and snippets.

@MiloDavis
Created September 1, 2017 11:25
Show Gist options
  • Save MiloDavis/0d89a95a8db079ae5c68b924f6f67e44 to your computer and use it in GitHub Desktop.
Save MiloDavis/0d89a95a8db079ae5c68b924f6f67e44 to your computer and use it in GitHub Desktop.
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))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment