AdWords API Keyword count

22 views
Skip to first unread message

Uros Kovacevic

unread,
Feb 21, 2021, 3:28:08 PM2/21/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 22, 2021, 3:38:22 PM2/22/21
to ur...@linkgraph.io, adwor...@googlegroups.com

Hi Uros,

Thank you for reaching out. Unfortunately, it’s not possible to fetch the total number of results. To overcome the issue of response oversize, the results are divided into chunks and each response would have a maximum of 700 results. Internally it’s using the index to locate the results. 

Thanks and regards,
Xiaoming, Google Ads API Team

 

Google Logo
Xiaoming
Google Ads API Team
 


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