How to display specific parts of json?
<p>Can someone help me with this python api calling program? </p>

<pre><code>import json
from pprint import pprint
import requests
weather = requests.get('http://api.openweathermap.org/data/2.5/weather?    
q=London&amp;APPID=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx')
pprint(weather.json())

wjson = weather.read()
wjdata = json.load(weather)
print (wjdata['temp_max'])
</code></pre>

<p>So with this piece of code I'm trying to get information from the weather api it prints it properly but when I want to select certain values only I get this error.</p>

<pre><code>Traceback (most recent call last):
  File "gawwad.py", line 7, in &lt;module&gt;
    wjson = weather.read()
AttributeError: 'Response' object has no attribute 'read'
</code></pre>

<p><a href="http://docs.python-requests.org/en/master/user/quickstart/#json-response-content"><code>.json()</code></a> is a built into <code>requests</code> JSON decoder, no need to parse JSON separately:</p>

<pre><code>import requests

weather = requests.get('http://api.openweathermap.org/data/2.5/weather?q=London&amp;APPID=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx')
wjdata = weather.json()
print (wjdata['temp_max'])
</code></pre>

python json api