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:
if coin['symbol'] == 'BTC':
print(coin['symbol'], coin['quote']['USD']['price'])