ResourceExhausted: 429 Resource has been exhausted

31 views
Skip to first unread message

Vamsee Srinivas

unread,
Aug 8, 2024, 3:20:27 AM8/8/24
to Google Ads Scripts Forum
Hi Team, 

I am using the google ads api service in my project and I follow the below given format inside the python function where I request metrics for keywords.

googleads_service = client.get_service("GoogleAdsService") 
keyword_plan_idea_service = client.get_service("KeywordPlanIdeaService") 
request = client.get_type("GenerateKeywordHistoricalMetricsRequest") 
request.customer_id = customer_id 
request.keywords = keywords request.geo_target_constants.append(
    googleads_service.geo_target_constant_path(geotarget_id)
    )
    request.keyword_plan_network = (
    client.enums.KeywordPlanNetworkEnum.GOOGLE_SEARCH
    ) request.language = googleads_service.language_constant_path(language_id)
request.language = googleads_service.language_constant_path(language_id)
request.historical_metrics_options = year_month_range 
response = keyword_plan_idea_service.generate_keyword_historical_metrics(request=request)

And I just wanna know how to calculate the operation in my scenario.

Upon checking the documentation, it says 15,000 API operations per day and 1 QPS is calculated as 60 requests per 60 seconds.

So in my scenario, I am using the function to fetch the keyword volumes of keywords per country and language combination. 

For example, if we consider United States and English, for this set I have 15,000 keywords and like this I have 36 unique country and language combinations. And the total keyword count is 2,50,000.

So  I have applied the chunking logic inside my code where I process 8000 keywords per group and last week upon running for the whole data, it ran and there was no issue.

But upon running this today, within 33 min I received the error below:
google.api_core.exceptions.ResourceExhausted: 429 Resource has been exhausted (e.g. check quota). [type_url: "type.googleapis.com/google.ads.googleads.v15.errors.GoogleAdsFailure"
value: "\n-\n\002X\002\022\'Too many requests. Retry in 30 seconds.
And I have used time.sleep(3) in my code.

So I am confused right now and more skeptical on how the google ads operations are being calculated here.

Is 1 operation equals 24 keywords per country and language or it is just per country.

If you could suggest some possible best practices it will be really helpful.

Best Regards,
Vamsee

Google Ads Scripts Forum

unread,
Aug 8, 2024, 12:44:57 PM8/8/24
to Google Ads Scripts Forum
Reposting the last response (https://groups.google.com/g/adwords-scripts/c/ul8OnQlFDB4) as the corresponding SF case was not created

Regards,
Google Ads Scripts team.

Google Ads Scripts Forum

unread,
Aug 8, 2024, 12:46:58 PM8/8/24
to Google Ads Scripts Forum

Hi Vamsee,

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

I would like to inform you that our team specializes in providing support related to the technical queries and implementation of the Google Ads Scripts. As your issue is related to the Google Ads API, I would suggest that you post your concerns on the API forum page.

Thanks,
Google Ads Scripts team
Reply all
Reply to author
Forward
0 new messages