Created
January 1, 2018 09:03
-
-
Save LinuxPhreak/475e61e4efa4c833a91fb58b2bb41c96 to your computer and use it in GitHub Desktop.
Quick Little Python 3 Script For Coinmarket Cap
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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