ERROR: retryAfterSeconds=30 in TargetingIdeaService get petition

41 views
Skip to first unread message

itsnesky

unread,
Oct 31, 2019, 4:54:32 AM10/31/19
to AdWords API and Google Ads API Forum
I've an array of N keywords and I'm looking for the average monthly seach of each one. The length of this array is always greater tan 700 (which is the limit size of the collection given to 'queries' for each call to this petition) so I had to split my array in X parts to create subarrays with length < 700. Then I looped throught those arrays and made as many calls to the API as subarrays I got.


targeting_idea_service = client.GetService('TargetingIdeaService'version='v201809')

  selector = {
    'ideaType''KEYWORD',
    'requestType''STATS'
  }

  selector['requestedAttributeTypes'= ['KEYWORD_TEXT''SEARCH_VOLUME''TARGETED_MONTHLY_SEARCHES']

selector['searchParameters'= [{
    'xsi_type''RelatedToQuerySearchParameter',
    'queries': keywords //=> length has to be < 700
  }]


The problem is that I'm getting this error:

[RateExceededError <rateName=RATE_LIMIT, rateKey=null, rateScope=ACCOUNT, retryAfterSeconds=30>]

I tried to wait 30 seconds before making another call but it didn't did the trick. 
I've a Standard access token.

Any help?
Thanks!

Google Ads API Forum Advisor Prod

unread,
Oct 31, 2019, 2:42:08 PM10/31/19
to zhai...@hotmail.com, adwor...@googlegroups.com
Hello, 

Based on the details shared, it looks like you're receiving an error with the rate scope as Account. This indicates that application is making a high number of requests per second on a single AdWords account. You could wait at least the amount of time specified in the retryAfterSeconds and retry the request again. Please note that the API call might still fail as the rate limits are not based on a constant QPS and are subjected to change. When you retry the requests, your application should use an exponential backoff policy which helps to make sure that you're not calling the API too aggressively. This guide has best practices that can be implemented to handle the rate limit errors. Please take a look at the system limits guide for the TargetingIdea specific limits. 

Let me know if you have any other questions.

Thanks,
Bharani, Google Ads API Team

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