API

Topic summary

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.

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

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

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?

Hi @vaibhavdhio :waving_hand:

From your post, your request doesn’t appear to be passing the limit parameter. I’d recommend reviewing this example for retrieving a list of orders, and specifying the limit to be the maximum (250) rather than the default (50). The same can be passed to the products endpoint as well. This doc for making paginated requests also has examples on how to iterate through the pages, in case you need to fetch more than 250+ orders/products.

Hope that helps!