Hi y'all.
I'm trying to do something simple, and think I'm close, but getting a little tripped up. Hope someone can help?
I'm trying to use the API to pull in the list of product names that are on my Commerce site. I'm working in Python because of other data processing steps. cURL works fine in Terminal, but I'm not able to pipe the output into a pandas dataframe.
import json
import pandas as pd
import requests
headers = {
"Authorization": "Bearer xxxxxxxxxxxx",
"User-Agent": "Get all samples",
"Content-Type": "application/json",
}
response = requests.get("https://api.squarespace.com/1.0/commerce/products", headers=headers)
response.raise_for_status()
df = pd.DataFrame(response("name"))
Can anyone help with this last step? Thanks so much in advance!