Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Collection product count by API

Collection product count by API

tttdog
Visitor
2 0 1

Hello,

 

We currently stuck with counting published products in collection.

 

We tried use ADMIN API 

/admin/api/2020-01/collects/count.json?collection_id=12345678

But this way counting all product not published products.

 

Is there anyway to count with Storefront API or Admin API , Please help


Thank you 

Reply 1 (1)

mfowler
Shopify Partner
3 0 3

Yes, try to add some parameters. Like: &status=ACTIVE

 

So in your reference: 

 

/admin/api/2020-01/collects/count.json?collection_id=12345678&status=ACTIVE  

 This worked for me to not count products w/ draft status.