Skip to content

Instantly share code, notes, and snippets.

@sgobotta
Created June 21, 2022 19:16
Show Gist options
  • Save sgobotta/f387e404ff855fe485e2d0d6bb9505b0 to your computer and use it in GitHub Desktop.
Save sgobotta/f387e404ff855fe485e2d0d6bb9505b0 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
import requests
URL = 'https://www.dolarsi.com/api/api.php?type=valoresprincipales'
json = requests.get(URL).json()
print()
print(' 💵 | compra | venta')
print('----|--------|-------')
for index, emoji in enumerate(('🟢', '🔵')):
compra = json[index]['casa']['compra'][:-1]
venta = json[index]['casa']['venta'][:-1]
print(f" {emoji} | {compra} | {venta}")
print()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment