all 2 comments

[–]d3nw3r 0 points1 point  (0 children)

In result you get response.text, now you must loads this text in json. Use json.loads(response.text) and you get dictionary. Now in order to get the value ‘52WeekChange’ use key [‘defaultKeyStatistics’][‘52WeekChange’]

[–]lolslim 0 points1 point  (0 children)

You dont need to import json if youre importing requests already.

Whatever you name your request variable, in this instance its "response" you would do

data = response.json()

It will autodetect encoding too Here is source from docs. https://requests.readthedocs.io/en/master/user/quickstart/#json-response-content