Query for count of (active) products in account

332 views
Skip to first unread message

Kevin Weitzner

unread,
Nov 28, 2017, 1:34:10 PM11/28/17
to Google Content API for Shopping
Greetings,

I am looking to use the Content API to find the count of active products (ideally the count of each status, Approved, Disapproved, etc - but count total would be good)

I am currently using the product list and iterating through while summing the length of the product response - but the maximum page_size is 250; and I have almost 500k products.

Is there a more efficient route to just obtain the count of active items?

Thanks

Kevin

Lakshmi Prathipati (Content API Team)

unread,
Nov 28, 2017, 4:04:47 PM11/28/17
to Google Content API for Shopping
Hi Kevin,

When you mentioned that you are using product list, do you mean that you are using Productstatuses.list to retrieve the status of each product? Currently, you need to filter for active items and then count them at your end as there is no direct approach. I will forward your request as a feature request to the rest of the team.

Thanks,
Lakshmi, Content API Team

Kevin Weitzner

unread,
Nov 29, 2017, 9:54:01 AM11/29/17
to Google Content API for Shopping
Hi Lakshmi,

Yes, this is what I am looking to do.  Currently I have to paginate through results 2000~ times to obtain the counts.
-

It looks like accountstatuses gives me any products with errors - but doesn't give a count/list of all active products.. from what I can tell.

Is there a method which returns just active serving products?

Lakshmi Prathipati (Content API Team)

unread,
Nov 29, 2017, 1:39:05 PM11/29/17
to Google Content API for Shopping
Hi,

Yes, Accountstatuses will not give count or list of active products. It will just list the issues with sample items that a given account has at the time of API request. In Content API there is no such service which will return only active products or count of active products. As I mentioned in my previous response, you need to filter at your end using Productstatuses.list response. Also, I forwarded your request as a feature request to the rest of the team.

Michael Ladewig

unread,
Nov 30, 2017, 8:18:09 AM11/30/17
to Google Content API for Shopping
Hi, Lakshmi,

this is the feature. I am waiting for a long time now. Just to receive these 4 numbers that can be seen in diagnostics beneath the chart on Account-Level. Just "Approved", "Unapproved", "Pending" and "Expiring". It would be a real performance changer if we don't have to analyze all products any more to get these 4 numbers.

Thanks
Michael

Lakshmi Prathipati (Content API Team)

unread,
Nov 30, 2017, 1:54:14 PM11/30/17
to Google Content API for Shopping
Hi Michael,

Thanks for adding more details! I forwarded your request as well for this feature will all the details.

Kevin Weitzner

unread,
Nov 30, 2017, 5:03:09 PM11/30/17
to Google Content API for Shopping
Hi Lakshmi,

Thanks for your clarification regarding this currently not being possible.  Hopefully it is something the team can add in the future!

Timothy Grimes

unread,
Nov 5, 2019, 1:47:29 PM11/5/19
to Google Content API for Shopping
Is there any updates to this? We are looking to create alerts for when our products fall under X value so our team can be proactive.

Kevin Weitzner

unread,
Nov 5, 2019, 2:11:25 PM11/5/19
to Google Content API for Shopping
Hi Timothy,

I have no updates on my end, we are still using the same pagination of the content API to obtain details on our listings.  I did create a selenium script that went to merchant center and just scraped the numbers.. but I felt it was safer to use the API in production for something like this.

Google will generally email you if the delta is high enough ( I think 10%? ) but I understand your concern here.

Sorry about that.

Shopping API Forum Advisor Prod

unread,
Nov 5, 2019, 3:19:09 PM11/5/19
to kw.netr...@gmail.com, google-content-...@googlegroups.com
Hello,

Using productstatuses.list API, you will be able to get the status of each product. You need to filter for active items at your end as there is no direct approach. Let me know if you have any further questions. 

Thanks,
Milind, Content API Team

ref:_00D1U1174p._5001UMWK51:ref
Message has been deleted

sujana narasimhan

unread,
Sep 21, 2023, 9:53:48 AM9/21/23
to Google Content API for Shopping
Hi Lakshmi,

Our project has 200,000+  items listed in google. Is that possible to retrieve all item status in single API call mentioning their respective item status like Active or Inactive. So that will be helpful for me to track the Active items listed in Google. You mean this functionality can be performed using   Productstatuses.list  as you said earlier in loop? 

If not, can you please provide me the particular API which can fulfill my requirement.

Thanks in advance.

On Thursday, September 21, 2023 at 7:02:59 PM UTC+5:30 sujana narasimhan wrote:
Hi Lakshmi,

Its good to know that google has an API to fetch all active items in single API call using Productstatuses.list . Can you please forward the request  so that it will be helpful.

Shopping API Forum Advisor

unread,
Sep 21, 2023, 3:58:34 PM9/21/23
to sujanana...@gmail.com, google-content-...@googlegroups.com
Hi,

Thank you for reaching out to the Content API support team.

By reviewing your concern, I understand that you would like to make a single Content API call to retrieve the status of all your products. You can use the productstatuses.list method to list the status of your products through the Content API. For this method, the maximum number of product statuses to return in the response is used for paging. The default value is 25, and the maximum value is 250.
 
This message is in relation to case "ref:_00D1U1174p._5004Q2p095w:ref"

Thanks,
 
Google Logo Content API for Shopping Team


sujana narasimhan

unread,
Sep 21, 2023, 11:53:37 PM9/21/23
to Google Content API for Shopping
Thanks for the response.

As I said our project has 200,000+  items listed in google. By using productstatuses.list  method with 250 max items(in Single call) also. It will take many hours to complete this process for  200,000+ items. I want a everyday report of active items listed in google to make the items to be in Sync with my Database. That's the reason I'm asking is there any specific Content API or any other Report API to retrieve all item id with their respective 'active/inactive' status listed in google in Single API call or less than 20 hits at least to get status of all my data. That will be very helpful. Hope you understand.

Thanks.

Shopping API Forum Advisor

unread,
Sep 22, 2023, 5:33:46 AM9/22/23
to sujanana...@gmail.com, google-content-...@googlegroups.com
Hi,

Thank you for getting back to us.

You can use the ProductView table of the Reports service to show a filtered view of your product data, including product statuses. Also, you can refer this link for more information.

sujana narasimhan

unread,
Sep 22, 2023, 5:41:43 AM9/22/23
to Google Content API for Shopping
Thanks for the response.

Can you specify the  API call limit and Max result fetch limit in single API call for the ProductView table of the Reports service 

Shopping API Forum Advisor

unread,
Sep 22, 2023, 7:32:38 AM9/22/23
to sujanana...@gmail.com, google-content-...@googlegroups.com
Hi,

Thank you for getting back to us.

There are some of the default quotas limits for the products. You can check this link for more information. The method call quotas might be different from the defaults listed. Also, you can refer to this link for more information on report service.
Reply all
Reply to author
Forward
0 new messages