JSON from an API request stores as a single key:value how do I convert it to a dictionary?

Solution 1:

Have you looked at the data? You have a dictionary with a single key, "drugMemberGroup", which itself contains a single key, "drugMember". THAT key contains list, and I suspect it is that list that you want to process. Something like this:

df = pd.json_normalize(data['drugMemberGroup']['drugMember]') 

By the way, you should use the excellent jq tool for looking at JSON data. Among its other uses, it prints JSON in a pretty structured format.