Skip to content

Instantly share code, notes, and snippets.

@ChadThackray
Last active August 13, 2024 19:25
Show Gist options
  • Save ChadThackray/fdf60454aa674d999862796b2b32a9f4 to your computer and use it in GitHub Desktop.
Save ChadThackray/fdf60454aa674d999862796b2b32a9f4 to your computer and use it in GitHub Desktop.
Get live cryptocurrency prices in python
# Licensed under the MIT License. See comment below for full licence information.
import requests
import json
bob = requests.get("https://api.coingecko.com/api/v3/simple/price?ids=bitcoin&vs_currencies=gbp", headers = {"accept":"application/json"})
print("The price of bitcoin is currently £" + str(bob.json()["bitcoin"]["gbp"]))
@rdivyaraj1011
Copy link

hiii can you give a licence

@ChadThackray
Copy link
Author

hiii can you give a licence

It's written above

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment