Python Accessing Nested JSON Data

I’m trying to get the zip code for a particular city using zippopotam.us. I have the following code which works, except when I try to access the post code key which returns TypeError: expected string or buffer r = requests.get('http://api.zippopotam.us/us/ma/belmont') j = r.json() data = json.loads(j) print j['state'] print data['places']['latitude'] Full JSON output: { "country … Read more