import json import requests apikey = '43979f1b-f353-4842-ad8a-ecb2735f3b71' headers = { 'X-CMC_PRO_API_KEY' : apikey, 'Accepts' : 'application/json' } params = { 'start' : '1', 'limit' : '5', 'convert' : 'USD' } url = 'https://pro-api.coinmarketcap.com/v1/cryptocurrency/listings/latest' json = requests.get(url, params=params, headers=headers).json() coins = json['data'] for coin in coins: print(coin['symbol'], coin['quote']['USD']['price'])
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter