I'm trying to use the Google Ads API to gather historical metrics on keywords in all fifty states.
Using the Python wrapper library, for each of the 51 locations (states + District of Colombia), I'm doing this:
- I create a KeywordPlan
- I create a KeywordPlanCampaign specific to the location, using the KeywordPlan
- I create a KeywordPlanAdGroup using the KeywordPlanCampaign
- I create a KeywordPlanAdGroupKeywords using the KeywordPlanAdGroup, for 100 keywords
- I call generate_historical_metrics() on the KeywordPlanService
This runs through all 51 locations successfully and I get all the data.
If I try it again with another 100 keywords, it fails halfway through with RESOURCE_EXHAUSTED errors. "Resource has been exhausted (e.g. check quota)."
As soon as that happens, I'm locked out for 24 hours.
I tried having it wait an hour before starting again, and got locked out for 24 hours.
The day after that I tried having it wait for two hours, along with a 5 minute wait between each of the 51 queries, and got locked out for another 24 hours.