Cale Sweeney Cale Sweeney -4 years ago 150
JSON Question

Accessing a json object nested in a json array with Python 3.x

Given the json payload below, how do I get the value of 'hotspot' using Python 3.x? The top level seems to be a a dict with one key value pair. 'Recs' is the key and the value is a Python list. I have loaded the json payload into the Python class using


json payload:

'Recs': [{
'eSrc': 'big-a1',
'reqPs': {
'srcIP': ''
'a1': {
'a1Ver': '1.0',
'obj': {
'eTag': '38f028e',
'sz': 1217,
'seq': '02391D2',
'hotspot': 'web/acme/srv/dev/8dd'
'confId': 'acme-contains',
'pipe': {
'name': '',
'oId': {
'pId': 'BDAD'

Answer Source

{ indicates a dict, [ indicates a list so hotspot is at:

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download