Skip to content

Instantly share code, notes, and snippets.

@makzan
Created December 1, 2021 08:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save makzan/4b4cf8fcc097147ddc22e99acef3c6f7 to your computer and use it in GitHub Desktop.
Save makzan/4b4cf8fcc097147ddc22e99acef3c6f7 to your computer and use it in GitHub Desktop.
import requests
from datetime import datetime
url = "https://api.coingecko.com/api/v3/simple/price?ids=osmosis,likecoin&vs_currencies=usd"
res = requests.get(url)
data = res.json()
like_usd = data["likecoin"]["usd"]
osmo_usd = data["osmosis"]["usd"]
now = datetime.today().isoformat()[:16].replace("T", " ")
result = f"LIKE: {like_usd}\nOSMO: {osmo_usd}\n({now})"
print(result)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment