I'm new to this forum and I don't know how to insert those nice code snippet boxes, but here is what I tried. It works to flatten the dictionaries, but only if there are no [ and ] brackets around the nested dictionaries, which is the way the API data is retrieved.
d = {'mid': {'h': '1.31', 'o': '1.32', 'c': '1.33', 'l': '1.34'}, 'volume': 99, 'time': '2019-02-22T21', 'complete': False} def flatten(d): def items(): for key, value in d.items(): if isinstance(value, dict): for subkey, subvalue in flatten(value).items(): yield key + "." + subkey, subvalue else: yield key, value return dict(items()) dictout = flatten(d) hi = dictout.get('mid.h') lo = dictout.get('mid.l') print("Hi= ",hi," and Lo= ",lo)So like I say, this works fine on the dictionary line at the top, but the actual API line is a List with opening and closing []. I don't know how to get around that. Suggestions?