How can I request more than 250 pieces of order data

kaipengliu
New Member
14 0 0

hey,

    guys!

When I request the following api (/admin/api/2021-04/orders.json?status=any). to query the order list。

I found that only 250 results can be queried at most

But I saw that the api request parameter table contains such a parameter 'since_id'

Then, no matter what value I pass to since_id. I always get the same result. It seems that it has no effect on the request

Except since_id, I did not find more useful parameters from the request parameter list to achieve my purpose:'request more than 250 pieces of order data'

 

Do you have any good suggestions or ideas?

thanks 

Your suggestions are very important to me. This will be of great help to my work

 

 

Replies 3 (3)
Jason
Shopify Expert
10882 190 2179

Have you looked at using pagination via the link data in the header response?
https://shopify.dev/tutorials/make-paginated-requests-to-rest-admin-api

 

★ I jump on these forums in my free time to help and share some insights. Not looking to be hired, and not looking for work. http://freakdesign.com.au ★
kaipengliu
New Member
14 0 0

 

thank you for your help @ Jason

But I still ran into problems. When I use the following api path to request server resources

This is the URL path I used : 'admin/api/2021-04/orders.json?status=any&limit=50&page_info=1'

This is the url path of my complete request : 'https://keyouyun.myshopify.com/admin/api/2021-04/orders.json?status=any&limit=50&page_info=1'

However, the server returned me an error message like this : {"page_info": "Invalid value."}

I understand page_info means current_page_number

So, am I doing something wrong

Kuldeepsaini
New Member
1 0 0

If you are using REST API then you will get the link of next page in the response header of your first request. have a look in below screenshot of response header.

Link Field is have the page_info value for next page

Kuldeepsaini_0-1650137044820.png