Hello,
I am making API calls that return json data like this -
{
"basicServiceSets": [
{
"ssidName": "My SSID",
"ssidNumber": 0,
"enabled": true,
"band": "2.4 GHz",
"bssid": "8A:15:04:00:00:00",
"channel": 11,
"channelWidth": "20 MHz",
"power": "18 dBm",
"visible": true,
"broadcasting": true
},
{
"ssidName": "My SSID",
"ssidNumber": 0,
"enabled": true,
"band": "5 GHz",
"bssid": "8A:15:14:00:00:00",
"channel": 64,
"channelWidth": "40 MHz",
"power": "18 dBm",
"visible": true,
"broadcasting": true
},
{
"ssidName": "My SSID",
"ssidNumber": 0,
"enabled": true,
"band": "6 GHz",
"bssid": "8A:15:24:00:00:00",
"channel": 145,
"channelWidth": "80 MHz",
"power": "18 dBm",
"visible": true,
"broadcasting": true
}
]
}
I want to extract all the “bssid” key/values but I am getting “value doesnt exist” or a blank return.
I realize the issue is that I am searching the “basicservicesets” dictionary for the key rather than the nested dictionary where the key actually is.
I think the syntax for looking into the nested ones is something like this
print(myfamily["child2"]["name"])
however the nested dictionaries in the api data dont appear to have names so I cant specify them
How do I get into the nested dictionaries if they have no names?
Thanks!