Last active
February 6, 2021 20:59
-
-
Save ozment/d3a9126c3512d2b8bbaa79e009b28b26 to your computer and use it in GitHub Desktop.
BTC PRICE NABBER via Bitstamp API
This file contains 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
# python3 | |
# @ozment | |
# uses Bitstamps API to retrieve current price per BTC | |
import json | |
from urllib.request import urlopen | |
def dagnabtc(btc): | |
fiat = float(json.loads(urlopen('https://www.bitstamp.net/api/ticker/').read())['last']) | |
if btc > 0: | |
# priceless = float(json.loads(urlopen('https://www.bitstamp.net/api/ticker/').read())['last']) | |
# print(priceless) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment