Skip to content

Instantly share code, notes, and snippets.

@LinuxPhreak
Created January 1, 2018 09:03
Show Gist options
  • Select an option

  • Save LinuxPhreak/475e61e4efa4c833a91fb58b2bb41c96 to your computer and use it in GitHub Desktop.

Select an option

Save LinuxPhreak/475e61e4efa4c833a91fb58b2bb41c96 to your computer and use it in GitHub Desktop.
Quick Little Python 3 Script For Coinmarket Cap
#!/bin/python3
import urllib.request, json
with urllib.request.urlopen("https://api.coinmarketcap.com/v1/ticker/bitcoin/") as url:
data = json.loads(url.read().decode())
for item in data:
name = item.get("0")
btcPrice = item.get("price_usd")
print(btcPrice)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment