with this code:
import pandas as pd
import requests
import json
url = 'https://www.loves.com/api/sitecore/StoreSearch/SearchStores'
#get the data from url
response = requests.get(url).json()
df = pd.read_json(url)
df1 = pd.json_normalize(response)
This is what the response looks like
How to get normal pandas dataframe?
CodePudding user response:
Try it like this
import pandas as pd
import requests
import json
url = 'https://www.loves.com/api/sitecore/StoreSearch/SearchStores'
#get the data from url
response = requests.get(url).json()
df1 = pd.json_normalize(response, record_path=['Points'])
CodePudding user response:
I found the answer, this made the trick
df1 = pd.json_normalize(response, record_path=['Points'])