Inspect your dict! It’s all right there. First print the keys of routes (print(routes.keys()), then go further from there, e.g. print(routes['routes'] etc.
Sorry that I don’t give you the exact answer, but I find it’s better to help people to help themselves.
I deleted your JSON post, it doesn’t add any benefit…
# recursivejson.py
def extract_values(obj, key):
"""Pull all values of specified key from nested JSON."""
arr = []
def extract(obj, arr, key):
"""Recursively search for values of key in JSON tree."""
if isinstance(obj, dict):
for k, v in obj.items():
if isinstance(v, (dict, list)):
extract(v, arr, key)
elif k == key:
arr.append(v)
elif isinstance(obj, list):
for item in obj:
extract(item, arr, key)
return arr
results = extract(obj, arr, key)
return results