Skip to content

Instantly share code, notes, and snippets.

@mkaz mkaz/
Created Feb 25, 2019

What would you like to do?
Script to fetch current bitcoin price
#!/usr/bin/env python3
""" Current Bitcoin price """
import requests
import json
import sys
apiurl = ''
response = requests.get(apiurl)
data = response.json()
price = data["bpi"]["USD"]["rate"]
price = price.replace(",", "")
price = float(price)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.