API

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!