A Python function is used to fetch orders/products from the Shopify Admin REST API but only returns 50 records per request.
Cause identified: the request URL does not include the limit query parameter, so the API returns its default of 50 items per page.
Recommended actions:
Add limit=250 to the orders and products endpoints to retrieve the maximum per page.
Implement pagination to iterate through pages if more than 250 records are needed, following Shopify’s paginated request examples.
Key terms:
“limit” parameter: a query option that sets the maximum number of items returned per page (default 50, max 250).
“Pagination”: handling multi-page responses by repeatedly requesting subsequent pages until all records are fetched.
Resources: official Shopify docs were referenced for order/product retrieval and REST pagination examples. The provided code snippet is central to understanding the issue.
Status: No confirmation of resolution; guidance provided, discussion likely ongoing.
df=pd.DataFrame(response.json()[resource])
orders=pd.concat([orders,df])
last=df[‘id’].iloc[-1]
if len(df)<250:
break
return(orders)
df = get_all_orders()
@All members, I’m using above function to get the orders and products data from website but I’m only able to get 50 records for each, Is there any changes required?