Get UserList matching Selection criteria in Google Ads API

53 views
Skip to first unread message

Vignesh

unread,
Jan 9, 2022, 9:35:11 AM1/9/22
to AdWords API and Google Ads API Forum
Hi,
In Google Ads API, what is the equivalent of AdWordsUserListService.get(). I am looking to fetch the user lists which matches the selection criteria exactly as mentioned in this link - https://developers.google.com/adwords/api/docs/reference/v201809/AdwordsUserListService#get

For example in AdWords API, I have built a Selector like below to query UserList. How do I do the same in Google Ads API in 2022 ?
 SelectorBuilder builder = new SelectorBuilder();
 Selector selector = builder.fields("Id", "Name", "Size", "SizeForSearch", "Status").equals("ListType", UserListTypeEnum.UserListType.CRM_BASED.toString()).offset(offset).limit(PAGE_SIZE).build();

Thanks,
Vignesh

Google Ads API Forum Advisor

unread,
Jan 9, 2022, 10:39:17 PM1/9/22
to thegreat...@gmail.com, adwor...@googlegroups.com

Hi Vignesh,

Thanks for reaching out to the Google Ads API Forum.

An equivalent way to achieve this using pagination. The pagination uses pageSize by specifying page_size in your request. This will break up the result set of the query into multiple responses that each contain up to page_size objects. If page_size is not specified, it is automatically set to the maximum page size of 10,000 rows.

Suppose if your account contains 50,000 keywords and page_size is set to 1,000, the result set will contain 1,000 GoogleAdsRow objects in the first response, along with a next_page_token. To retrieve the next one thousand rows, simply send the request again with the same page size, but update the request's page_token to the response's next_page_token. The value of page_size in the subsequent requests can be different each time. The next_page_token will not be populated on the response that contains the last batch of rows. You may also find this existing forum thread for your query. Let us know if you have any additional questions.

Regards,

Google Logo
Yasar
Google Ads API Team
 


ref:_00D1U1174p._5004Q2Ui9FI:ref

Google Ads API Forum Advisor

unread,
Jan 9, 2022, 10:57:55 PM1/9/22
to adwor...@googlegroups.com, thegreat...@gmail.com

Hi Vignesh,

In addition to the above response, note that you may use pagination when fetching the user lists using the user_list report. However, for the AdWordsUserListService from the AdWords API, you may use the UserListService service to get GetUserList in Google Ads API. 

Let us know if you have any further questions.

Regards,

Reply all
Reply to author
Forward
0 new messages