Too many requests when calling KeywordPlanService.GenerateHistoricalMetrics

197 views
Skip to first unread message

David Mrnuštík

unread,
Jun 9, 2022, 8:01:29 AM6/9/22
to Google Ads API and AdWords API Forum
Hello Google Ads team,
We have very similar tool as described in this thread: https://groups.google.com/g/adwords-api/c/jdSLSDnIF7c

We are also getting RESOURCE_EXHAUSTED (Too many requests) issue when calling KeywordPlanService.GenerateHistoricalMetrics. In our case we use library https://github.com/Opteo/google-ads-api

Our plan is to use this service to fetch up to 10000 keywords with its historical metrics up to 4 years time range max.

The first time when we tried to fetch 10000 keywords, we got a RESOURCE_EXHAUSTED error. We weren't aware of max message size (64 MB) that could cause the issue.
Later we have called a service with 1 keyword and with 500 keywords (up to 3 years) and it has worked. But then when we tried to fetch with 1000 keywords, we got RESOURCE_EXHAUSTED. 

Before we weren't aware about Planning services, but later we've implemented a delay of 2 seconds between calls of following flow:
- create a keyword plan
- add a keyword plan campaign to keyword plan
- add keyword plan Ad groups to keyword plan campaign
- add keyword plan Ad group keywords to keyword plan Ad groups
- call KeywordPlanService.GenerateHistoricalMetrics

Even with a 2s delay, after another call with 500 keywords, we got "Too many requests":

GoogleAdsError {
    error_code: ErrorCode { quota_error: 2 },
    message: 'Too many requests. Retry in 74948 seconds.',
    details: ErrorDetails { quota_error_details: [QuotaErrorDetails] }
  }

error detail:
{ "quota_error_details": { "rate_scope": "DEVELOPER", "rate_name": "Number of operations for basic access", "retry_delay": { "seconds": "74948" } } }

Then we call a service with 1 keyword and we got 200 response.

I've checked API/Service details page of our Google Cloud Platform account and we shouldn't exceeded a daily quota. Those are actual stats:

google.ads.googleads.v10.services.KeywordPlanAdGroupKeywordService.MutateKeywordPlanAdGroupKeywords: 24 requests

google.ads.googleads.v10.services.KeywordPlanAdGroupService.MutateKeywordPlanAdGroups: 24 requests

google.ads.googleads.v10.services.KeywordPlanCampaignService.MutateKeywordPlanCampaigns: 24 requests

google.ads.googleads.v10.services.KeywordPlanService.GenerateHistoricalMetrics: 14 requests

google.ads.googleads.v10.services.KeywordPlanService.MutateKeywordPlans: 24 requests

I see that only this method contains Errors (41,67%):
google.ads.googleads.v10.services.KeywordPlanAdGroupKeywordService.MutateKeywordPlanAdGroupKeywords

I don't know what we're missing here and in which point we are "hitting" a quota limit.

I would appreciate any help to know what is a cause here.

Thank you.

Google Ads API Forum Advisor

unread,
Jun 9, 2022, 9:23:23 AM6/9/22
to david.m...@rindus.de, adwor...@googlegroups.com
Hi David,

Thank you for reaching out to the Google Ads API support team.

To investigate the issue further, could you please provide the complete request and response logs, with the request-id? If you haven't yet, logging can be enabled by navigating to the Client libraries > Your client library (ex. Java) > Logging documentation, which you can access from this link.You can provide it via Reply privately to author option. If this option is not available, you may send the details directly to our googleadsa...@google.com alias instead. Let me know if you have any questions.

Thanks,
Google Logo
Nirmita
Google Ads API Team
 


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