Skip to content

Instantly share code, notes, and snippets.

@iannase
Created May 25, 2018 16:05
Show Gist options
  • Save iannase/5342d4c3daf0408c2d3cf6a8b407afb0 to your computer and use it in GitHub Desktop.
Save iannase/5342d4c3daf0408c2d3cf6a8b407afb0 to your computer and use it in GitHub Desktop.
import json
import requests
from datetime import datetime
listings_url = 'https://api.coinmarketcap.com/v2/listings/'
request = requests.get(listings_url)
results = request.json()
# print(json.dumps(results, sort_keys=True, indent=4))
data = results['data']
print()
for currency in data:
rank = currency['id']
name = currency['name']
symbol = currency['symbol']
print(str(rank) + ': ' + name + ' (' + symbol + ')')
print()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment