I have straggling with this API request /admin/collects.json?collection_id=$keys&page=$i&limit=100

New Member
4 0 0

There are more then 1,00,000 preoducts with this collections and shopify api doesn't support this /admin/collects.json?collection_id=$keys&page=$i&limit=100 as per api https://help.shopify.com/en/api/reference/rest-admin-api-rate-limits

 

As per below 

 

There is an additional rate limit for GET requests. When the value of the page parameter results in an offset of over 100,000 of the requested resource, a 429 Too Many Requests error is returned. For example, a request to GET /admin/collects.json?limit=250&page=401 would generate an offset of 100,250 (250 x 401 = 100,250) and return a 429 response.

 

 

How can i fetch this kind of collects ?

 

 

0 Likes
Community Manager
Community Manager
618 45 81

Hi @dharaq_dhara,

 

Incorporating the since_id filter will help lower the pages of your requests. Instead of paging through results, you would fetch all results since_id=1. Make the query again replacing the since_id=1 with the last id the previous request returned. Keep doing this until you receive all your results.

 

You can also use pagination alongside since_id, but you will eventually run into the same issue. Using since_id without pagination is also going to be more performant for you.

 

 

0 Likes
New Member
4 0 0

Shopify support suggested since_id approach and I used that approach as well but for one of the collection, it is always giving 503 error admin/collects.json?collection_id=64658702451&since_id=1&limit=100   and still didn't get any solution to this problem. 

0 Likes
Highlighted
Community Manager
Community Manager
618 45 81

I see what you mean. I'm experiencing the same issue with that query. I've brought it up with our dev team who is looking into it. I'll make a follow-up post once we've pinpointed the issue and the required fix.

 

Cheers

0 Likes