You need to get the json response back when working with an API
Can now get data want bye doing ordinary dictionary call or loops.
import requests req = requests.get('https://api.kraken.com/0/public/Ticker?pair=ADAUSD,BTCUSD,DOGEUSD,DOTUSD,ETHUSD,LTCUSD,SHIBUSD,XMRUSD,XRPUSD,SOLUSD') json_data = req.json()Now it's a Python dictionary as Requests has build in json decoder.
Can now get data want bye doing ordinary dictionary call or loops.
>>> json_data['result']['ADAUSD'] {'a': ['0.876931', '8000', '8000.000'], 'b': ['0.876606', '1900', '1900.000'], 'c': ['0.876637', '56.20427900'], 'h': ['0.902161', '0.910294'], 'l': ['0.862667', '0.862667'], 'o': '0.901642', 'p': ['0.878015', '0.885684'], 't': [4687, 5890], 'v': ['6684590.94553137', '10562996.17641575']} >>> json_data['result']['ADAUSD']['a'] ['0.876931', '8000', '8000.000'] >>> json_data['result']['XXMRZUSD']['h'] ['179.00000000', '179.00000000']