RateExceededError when using TargetingIdeaService with less than 5 calls per minute

502 views
Skip to first unread message

Joan Figuerola Hurtado

unread,
Apr 3, 2018, 3:38:04 PM4/3/18
to AdWords API Forum
Hello,

I'm getting the following error when accessing the TargetingIdeaService:

googleads.errors.GoogleAdsServerFault: [RateExceededError <rateName=RATE_LIMIT, rateKey=null, rateScope=ACCOUNT, retryAfterSeconds=30>]

I'm making less than 5 requests per minute and I even added sleeps in-between.

Do you have any idea about what's going on? It seems odd that I can only make just a few requests. Here is a piece of code I'm trying to run.

targeting_idea_service = client.GetService(
'TargetingIdeaService', version='v201802')

# Construct selector object and retrieve related keywords.
selector = {
'ideaType': 'KEYWORD',
##'requestType': 'IDEAS'
'requestType': 'STATS'
}

selector['requestedAttributeTypes'] = [
'KEYWORD_TEXT', 'SEARCH_VOLUME', 'COMPETITION', 'AVERAGE_CPC'
 ]

offset = 0
selector['paging'] = {
'startIndex': str(offset),
'numberResults': str(PAGE_SIZE)
}

selector['searchParameters'] = [{
'xsi_type': 'RelatedToQuerySearchParameter',
'queries': [keyword]
}]

# Language setting (optional).
selector['searchParameters'].append({
# The ID can be found in the documentation:
'xsi_type': 'LanguageSearchParameter',
'languages': [{'id': '1000'}]
})

# Network search parameter (optional)
selector['searchParameters'].append({
'xsi_type': 'NetworkSearchParameter',
'networkSetting': {
'targetGoogleSearch': True,
'targetSearchNetwork': False,
'targetContentNetwork': False,
'targetPartnerSearchNetwork': False
}
})

page = targeting_idea_service.get(selector)

if 'entries' in page:
for result in page['entries']:
return result

Any ideas?

Thank you in advance.

Luis Xander Talag (AdWords API Team)

unread,
Apr 4, 2018, 1:40:01 AM4/4/18
to AdWords API Forum
Hi Joan,

The TargetingIdeaService is a more expensive service to call as compared to the other services of the AdWords API. The rate limits for this service are significantly more strict than the other services that can be used for managing campaigns and the limits can vary based on time of day, overall volume of API usage by all users, and other factors. I would recommend to follow this guide to take control of your request.

Thanks and regards,
Luis
AdWords API Team

Joan Figuerola Hurtado

unread,
Apr 4, 2018, 4:24:49 AM4/4/18
to AdWords API Forum
Thank you Luis,

Is there any way to see how many requests I am doing or rate limits for that service or any other alternative way to do it?

I've already added 120s sleeps between requests but they don't seem enough as I keep getting the error. I need to make ~1500 requests and only managed to do 102 so far, it's going to take me a few days to do it all.

Is there any way to speed it up?

Thank you

Luis Xander Talag (AdWords API Team)

unread,
Apr 4, 2018, 5:44:35 AM4/4/18
to AdWords API Forum
Hi Joan,

Currently, we don't have a way for users to check on how many request was being sent using this service on the AdWords back end. For TargetingIdeaService, it does not depend on your usage alone, but on the usage of all users on a certain time of the day, and other factors. So if there are other users who are making a request using this service at the same time when you made your request, then this sums up to the overall volume of the API usage for this service which may generate the RateExceededError. The rate limits here is not per developer token, but per QPS across all AdWords users on a certain period. 

My apologies as the only way to minimize this issue is to slow down and retry your request based on the number of seconds specified in the retryAfterSeconds field of your response.

Regards,
Luis
AdWords API Team
Reply all
Reply to author
Forward
0 new messages