import requestsAPI_KEY = 'f99f4b22-...'headers = { 'X-CMC_PRO_API_KEY': API_KEY}url = 'https://pro-api.coinmarketcap.com/v1/cryptocurrency/listings/latest'r = requests.get(url, headers=headers)find_ranks = {}if r.status_code == 200: data = r.json() for d in data['data']: symbol = d['symbol'] find_ranks[symbol] = d['cmc_rank']print('BTC', find_ranks.get('BTC'))print('TRX', find_ranks.get('TRX'))
References: