Gets the realtime price of Ethereum

PHOTO EMBED

Thu Mar 17 2022 14:51:14 GMT+0000 (UTC)

Saved by @Taylor #python #get #requests

import json
import requests

eth = requests.get(
    "https://api.coingecko.com/api/v3/simple/price?ids=ethereum&vs_currencies=usd")

print(eth.json()["ethereum"]["usd"])
content_copyCOPY

https://realpython.com/python-requests/