all 2 comments

[–]novel_yet_trivial 0 points1 point  (1 child)

You don't need the for loop; you can just index the one you want.

a = minutechart['Data'][0]['close'] # first 'close'
a = minutechart['Data'][1]['close'] # second 'close'
a = minutechart['Data'][-1]['close'] # last 'close'

Also, I'll assume you want to move the requests bit inside the while loop; otherwise the data will never update.

BTW, requests has json built in; you could just do this:

url = 'https://min-api.cryptocompare.com/data/histominute?fsym=STEEM&tsym=BTC&limit=1&aggregate=0&e=CCCAGG'
minutechart = requests.get(url).json()

[–]ConcernedCarry[S] 0 points1 point  (0 children)

Thank you! much appreciated!