Всем привет!
Начал разбираться в requests
написал такой код:
r = requests.get('https://api.coinmarketcap.com/data-api/v3/cryptocurrency/market-pairs/latest?slug=polkadot-new&start=1&limit=100&category=spot&sort=cmc_rank_advanced')
print(r.content)
Он выводит всю нужную мне информацию с сайта -
https://coinmarketcap.com/currencies/polkadot-new/...
вот это:
b'{"data":{"id":6636,"name":"Polkadot","symbol":"DOT","numMarketPairs":268,"marketPairs":[{"exchangeId":270,"exchangeName":"Binance","exchangeSlug":"binance","exchangeNotice":"Binance Futures Launches Monday & Tuesday Bounty! To welcome first-time users, Binance Futures will reward its users with a $5000 Bonus Jackpot every Monday and Tuesday of the week. Please check for more details [here](https://coinmarketcap.com/exchangeevents/exchangeevent/binance-futures-launches-mondays-tuesdays-bounty-promo).","outlierDetected":0,"priceExcluded":0,"volumeExcluded":0,"marketId":58416,"marketPair":"DOT/USDT","category":"spot","marketUrl":"https://www.binance.com/en/trade/DOT_USDT","marketScore":"-1.0000","marketReputation":1,"baseSymbol":"DOT","baseCurrencyId":6636,"quoteSymbol":"USDT","quoteCurrencyId":825,"price":7.000312480000000000000000 и тд...
Меня интересует только "exchangeName", "marketPair" и "price"
Можно ли как-то вывести именно эти значения по порядку, то есть должно получится примерно так:
{"exchangeName":"Binance" , "marketPair":"DOT/USDT", "price":7.000312480000000000000000}
{"exchangeName":"Coinbase Exchange" , "marketPair":"DOT/USD", "price":6.990312480000000000000000}
...