Orders data using Python

Topic summary

Issue: Fetching Shopify order data via Python from a private store to later manipulate by date.

  • Approach: Uses a loop with since_id pagination, limit=250, and fulfillment_status=unfulfilled; builds a DataFrame from response.json()[‘Order’] and concatenates pages.
  • Error: KeyError: ‘Order’ occurs when accessing the JSON response, indicating the expected ‘Order’ key isn’t present in the returned data structure.

Context: The error prevents extraction of orders and subsequent date-based operations.

Outcome: The original poster confirmed the issue was resolved (“Got it Thank you”). No specific fix or changes were documented.

Status: Resolved, with no further action items or open questions shared.

Summarized with AI on February 7. AI used: gpt-5.

I am trying to get ORDER data from shopify. I have created a private store, I have the api credentials in my code but,

def get_all_orders():
last=0
orders=pd.DataFrame()
while True:
url = [email removed]
response = requests.request(“GET”, url)

df=pd.DataFrame(response.json()[‘Order’])
orders=pd.concat([orders,df])
last=df[‘id’].iloc[-1]
if len(df)<=250:
break
return(orders)

df=get_all_orders()
df.head()

KeyError: 'Order'

I want to extract data by manipulating ‘date’ but it seems like the code is unable to fetch ‘order’ attribute from the store. Need Help! Thanks.

Got it Thank you