Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2018
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. GNU nano 2.9.3 space1.py
  2.  
  3. import json
  4. import requests
  5.  
  6. # Get the response from the API endpoint.
  7.  
  8.  
  9. response = requests.get('https://api.iextrading.com/1.0/stock/seed/batch?types=quote,news,chart&range=1m&last=20').json()['quote']['symbol']
  10. #response = requests.get("https://api.iextrading.com/1.0/stock/seed/batch?types=quote,news,chart&range=1m&last=20")
  11. data = response.json()
  12. #if (data["number"]) == 6:
  13. # print ("ok")
  14. (data["number"])
  15. print(data)
  16.  
  17.  
  18.  
  19. I want to be able to parse through the data this code isn't working can anyone assist
  20. how can I get the data individual print (data["symbol"] returns no key
  21.  
  22. so it's a key within the key I need to print I think
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement