I would like to extract specific values from a JSON object to a dedicated list. My code looks like that:
url2 = 'https://pqrsiem/api/reference_data/sets/clearsky_DOMAIN?fields=data(first_seen)'
request = urllib2.Request(url2,headers=headers)
response = urllib2.urlopen(request)
parsed_response = json.loads(response.read().decode('utf-8'))
print(json.dumps(parsed_response, indent=4))
The output looks like this:
{"data": [
{
"first_seen": 1474468912626
},
{
"first_seen": 1474468912694
},
{
"first_seen": 1474468912762
},
...
]
}
I would like to extract the values from the "first_seen"
key and put them in a list.
How can I do it?