I'm trying to get an API response from https://www.loves.com/api/sitecore/StoreSearch/SearchStores into a Pandas Dataframe. Specifically, I'm trying to load the 'Points' array into the data frame. I've seen other posts indicate that I should perhaps use json_normalize, and I've played around with that for a day but haven't made any progress.
import json
import requests
def get(url):
response = requests.get(url)
parsed = json.loads(response.text)
return json.dumps(parsed, indent=4, sort_keys=True)
from pandas.io.json import json_normalize
df = json_normalize(get(lovesLocator), 'Points')
The error I keep receiving is:
TypeError: string indices must be integers