{
"data": {
"FirstKey": {
"SecondKey": {
"AnyKey": "something",
"AnyKey2": "something",
"AnyKey3": "something",
"Body": {
"Response": {
"Result": {
"Xxx": {
"Any": "true"
},
"Zzz": {
"Bool": "true"
},
"INeedThisDict": {
"SomeInfo": "true"
"SomeInfo2": {
"Key": "Value",
"Key2": "Value2",
},
},
"Yyy": "000",
"Ccc": "111",
"Status": "200",
"Error": "no"
}
}
}
}
}
}
def find_key(dct, key):
try:
if dct.get(key):
return dct[key]
else:
for k in dct.values():
val = find_key(k, key)
if val:
return val
except:
return
Resp = dict()
Resp["abc"] = dict()
Resp["2"] = dict()
Resp["abc"]["find"] = 1
Resp["2"]["find_1"] = 2
print(find_key(Resp, "find_1"))