How to get count of keyword ideas from the Targeting idea service of the AdWords API

158 views
Skip to first unread message

Uros Kovacevic

unread,
Feb 17, 2021, 3:22:16 AM2/17/21
to AdWords API and Google Ads API Forum
Hello again,

Following up on my previous question, I am trying to get the count of keyword ideas associated with a specific categoryID.

I understand that the api currently does not return the total count of objects in a single call, however I don't want to have to query all the objects to be able to get the count.

Is there a way to at least get the number of pages needed to cycle through and get all of the data, so i can, for example, if I know all the pages but the last one contain 700 entries, just call the last page and calculate the count.

If not could someone explain to me why this is, so I can inform my employer.

Best regards,
Uros 

Google Ads API Forum Advisor Prod

unread,
Feb 17, 2021, 1:46:40 PM2/17/21
to ur...@linkgraph.io, adwor...@googlegroups.com
Hello,

Thanks for reaching out. Can you please clarify what category ID you are referring to (if you can point to a page of the documentation, this will be helpful)? 

If you are using the generate keyword ideas sample code (Python given here), you should be able to get the total count of ideas from the keyword_ideas array.

Regards,
Matt
Google Ads API Team

Google Logo
Matt
Google Ads API Team
 


ref:_00D1U1174p._5004Q2CRrzc:ref

Uros Kovacevic

unread,
Feb 17, 2021, 1:56:36 PM2/17/21
to AdWords API and Google Ads API Forum
Hello,

I am doing my search using this paramenter, how could I get it here?

Google Ads API Forum Advisor Prod

unread,
Feb 18, 2021, 5:53:00 AM2/18/21
to ur...@linkgraph.io, adwor...@googlegroups.com
Hi Uros,

Thank you for the reply.

Could you provide more details on the question that you recently sent so I check if it is possible using AdWords API?

Regards,
Google Logo
Ernie John Blanca Tacata
Google Ads API Team
 


ref:_00D1U1174p._5004Q2CRrzc:ref

Uros Kovacevic

unread,
Feb 19, 2021, 4:32:09 AM2/19/21
to AdWords API and Google Ads API Forum
Hello again,

We are trying to get the total count of keywords from the google AdWords API using a certain categoryID by searching with this search parameter, like in these categories here, the problem is the results are paginated and limited to 700, and with a parameter like a categoryID for instance - computer parts, the results are in the millions even billions.

We just need the count of keywords not the actual objects, so it doesn't make sense to loop over the pages and retrieve all of the objects in order to get a single number(count).

Is it possible to get this number anywhere in the response, or at least the total number of pages needed to loop over and get all the results, it would make sense to put this in if it is not, for users that need to get all of the data currently the best solution is to make a while loop that checks if there are pages left, and if so, make a new request, this is very daunting work as we don't even know how many requests we have to make in order to get all the keywords.

At least with the number of pages we can use a for loop which saves us from writing a lot of boilerplate code, and opens up possibilities to get additional data like - count in one API call.

Is this possible? Does the API even know the total number of results for a search parameter? Or are the results already indexed and limited in the database and the API only knows about the first 700, and when you make a call to the next page it starts from the previous index?

Would love some more explanation about this.

Thank you for all your help!
Uros

Google Ads API Forum Advisor Prod

unread,
Feb 21, 2021, 9:48:23 PM2/21/21
to ur...@linkgraph.io, adwor...@googlegroups.com
Hi Uros,

Thank you for providing more context.

Unfortunately, getting the total count of the keywords results or pages via the TargetingIdeaService is not possible in a single request. You will need to perform paging in order to do so.

Best regards,

Google Logo
Peter Laurence Napa Oliquino
Google Ads API Team
 


ref:_00D1U1174p._5004Q2CRrzc:ref
Reply all
Reply to author
Forward
0 new messages