Ive got a script written to fetch data from an API, and return it, but now i need to parse that data, this is an example of what the json data looks like, with some of the dicti
It sounds like you want something like this:
def call():
payload = {'apikey':'my_apikey', 'zip':'74120'}
bas_url = 'http://openstates.org/api/v1//legislators/?state=ok'
r = requests.get(bas_url, params = payload)
grab = r.json()
jsonData = grab["results"]
return [{key: value for key, value in result.items() if key in ("twitter_id", "office")} for result in jsonData]