Advertisement
Guest User

Untitled

a guest
Sep 24th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. {
  2. "region_metadata": [ {..many dictionaries here..
  3.  
  4. ],
  5. "items": [
  6. {
  7. "timestamp": "2017-09-24T14:00:00+08:00",
  8. "update_timestamp": "2017-09-24T14:06:18+08:00",
  9. "readings": {
  10. "pm25_one_hourly": {
  11. "west": 19,
  12. "east": 18,
  13. "central": 17,
  14. "south": 13,
  15. "north": 23
  16. }
  17. }
  18. }
  19. ],
  20. "api_info": {
  21. "status": "healthy"
  22. }
  23. }
  24.  
  25. resp = requests.get(url, headers=h)
  26.  
  27. binary = resp.content
  28. output = json.loads(binary)
  29.  
  30. for key, value in output.items():
  31. if key == "items":
  32. print (value)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement