I can't figure out how to print a specific key/value from a string of JSON data after using requests.get. My understanding is that, when using request.get, the data is formatted as a dictionary by Python. As such, I thought I would be able to print any key/value I wanted by treating it like a normal dictionary: x = thisdict["brand"]. So far I've only managed to get it to print the full JSON string, which isn't what I need.
import requests
# Pulling ISS position data as json string.
r = requests.get('http://api.open-notify.org/iss-now.json?print=pretty')
r.json()
# Printing
print (r.text)
How would I print the current key/value ('message': 'status') from the json string?