FROM CACHE - en_header

Get total products in a collection rest api

Shopify Partner
13 0 1

Is There any wayto get total number of products in a collection via API. Collection can be custom or smart , but I just want to retrieve total number of products in a collection.
My concern is that I want to get all empty collections on store, whether it be custom or smart, all collections with zero number of products in them.

Thanks in advance.

Replies 3 (3)
Shopify Partner
45 10 10

Yes, you can use the collects count endpoint as referenced here:


The format you are looking for is:


 Hope that helps.





Shopify Partner & Developer
If it's a problem you can't solve the job is not too small - get in touch

Print or download a PDF catalog for your store in minutes - Shop-2-Doc
Shopify Partner
703 16 106

It cannot work for smart collections. It will give an error like this: 

"errors": "Cannot load count for Collects belonging to a SmartCollection"

Any fix to get the number of products under a collection?

BYOB - Build Your Own Bundles, SPO - SEO App to research keywords & edit social link preview
New Member
1 0 1

Try This: