Shopify API get products of custom collection pagination by page_info returned missing products

Topic summary

A REST Admin API pagination issue on a custom collection: calling /admin/api/2021-07/collections/{collection_id}/products.json for collection 284579070146 returned 408 products instead of the expected 869. With limit=250, page 1 returned 250 and page 2 returned 158; the Link response header lacked a “next” URL, implying no further pages. A specific product (ID 6982740803778) known to belong to the collection did not appear in results.

Shopify support reviewed the request (via x-request-id) and found no API error, advising verification of the collection ID and noting merchant-side changes could affect counts. They cannot access store data without merchant approval.

Merchant context: the collection was modified for a promo and a copy was created. Storefronts showed ~274 and ~290 items, while each collection’s JSON and tag-based product export reported 376—indicating inconsistent counts across views. Screenshots were provided.

Recent update: API and storefront counts now align. The users believe data was previously incorrect and requested root-cause investigation.

Next steps: Shopify directed use of the Report an Issue form to initiate an email thread and obtain merchant permission. The developer submitted the form. Status: open; cause not yet identified.

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

Our app informations:

Shopify handle: product-filter-search
Shopify api key: d4172f8181a20b56ade67cc448fac594

We are using API: /admin/api/2021-07/collections/{collection_id}/products.json to get all products of the custom collection. Specifically for store: ca.lxrco.com, custom collection: https://ca.lxrco.com/collections/shop-sale-preloved-bags.json It has 869 products in this collection, but our app using this API got only 408 products.

We are debugged for this API with a limit per page are 250 and see it only works for 2 pages: page 1 has 250 products, and page 2 has 158 products. In the response header for page 2, the field link does not have field next, which means no page info for the next, API returning 408 products, x-request-id:“192ef857-aa99-415e-bc83-67cff7094d39”

Thank in advance.

Hey @issactran - thanks for getting in touch. I can’t say why this happened, but I was able to look up the request you had made using the request ID and it doesn’t appear that there was an error with the API.

Our recommendation would be to confirm that the collection ID number you’re calling through the API is correct as it could potentially be that a different collection was returned rather than the expected one. Another possibility is that the merchant updated the collection recently and changed the amount of products in the collection. We’re unable to access merchant data without approval from the merchant on our end (and they must contact us through our merchant support channels), so I can’t confirm this, but if you are able to touch base to confirm the amount of products with your merchant and it still seems off, we can definitely take a further look into this with you.

Hope this helps with some next steps - best!

Hi,

I work at the merchant in question here. How can i confirm this?

I chatted with support, spent an hour trying to explain the problem, and at the end the agent said we should take the conversation to email and he would loop in the app devs as well.

This was before noon. It’s almost midnight here and I havent heard back.

So, how can we proceed so that someone helps us fix the issue at hand. What can i provide here?

Thanks,

Pablo / LXR

Hello @Alan_19 , We spent a lot of time figuring out this error before deciding to send a support request to Shopify, I can confirm the correct collection id is 284579070146, Shopify API returned data incorrectly. For example product with id is 6982740803778 belongs to collection 284579070146, but when using API /admin/api/2021-07/collections/{collection_id}/products.json to get all products of this collection it doesn’t return the product id 6982740803778. Can you help us check why and confirm total 408 products of collection 284579070146 returned from API is true or false?

Products count of the collection got from store front 869

Products counts of the collection got from Shopify API is 408


Thank you

To further elaborate, we switched the Sale collection because of an upcoming promo, AND created a copy collection for testing purposes.

https://ca.lxrco.com/collections/shop-sale-preloved-bags
https://ca.lxrco.com/collections/fake-sale

JSON response for both files says 376 items. Also if i go to Products > Inventory > Export the products using the tag used on those collections, I also get 376 products.

Yet when i look at them online, one is showing 274 products, the other one around 290 products.

So again, something is messing up the numbers, and we can’t continue having collections not show the real number of products they have.

@Alan_19 It seems that this error has been updated by Shopify, the current results are the same when viewing the number of products of a collection directly from the store and from the Shopify API.

We believe the data has been returned incorrectly before, please investigate it. We need answers for the customer, feel free to let me know what I can provide or help. Many thanks

Data view at the store:

Data return from Shopify API:

Hi - @issactran I wanted to reach back out here to mention our Report an Issue formhere at this link . I had been out of the office - so thank you for your patience on this.I read @lxrco 's reply and this form would be the best way forward to investigate the issue further if the issue still hasn’tbeen resolved. If you are able to fill out the fields in that form as best you can - this would provide us some information to further investigate into the issue. This form will also provide you with an email thread which you can then loop the merchant into. Here, we’d then be able to get their permission to investigate the store info itself further.

In this case, continuing our investigation into this by email would be the next best step as we will be dealing with some sensitive information that may not be suited for a public audience like our community forums.

Hope to hear from you soon - if you need help with the form itself, just reply here - I’ll make sure I am monitoring this thread for you in the meantime.

Thank you, @Alan_19
I have submitted an issue report according to the link you provided