Hi,
When trying to generate keyword suggestions and extract volume for just 5 keyword I keep running into the error below:
suds.WebFault: Server raised fault: '[RateExceededError <rateName=RATE_LIMIT, rateKey=null, rateScope=ACCOUNT, retryAfterSeconds=30>]'
Can someone explain me what the error means exactly? I can not find any documentation on the rateName = Rate_LIMIT exception. Only on RateName = RequestsPerMinute.
I am not an experienced python programmer, and as such I have build a script that takes one keyword as input and outputs the search volume for that keyword. Is it also possible to enter a list of keywords and get a list of search volumes out? Would this also help to solve the problem with the RateExceededError? See my code below.
Lastly, I read about that one can solve this error by building a throttling algorithm. Could someone give me a rough idea how such a algorithm would work for the script below?
I have a basic acces level for the API
Many thanks!
PAGE_SIZE = 1
def __init__(self, client):
self.client = client
# Construct selector object and retrieve related keywords.
self.selector = {
'ideaType': 'KEYWORD',
'requestType': 'STATS'
}
self.selector['requestedAttributeTypes'] = ['SEARCH_VOLUME']
self.selector['paging'] = {
'startIndex': str(0),
'numberResults': str(self.PAGE_SIZE)
}
self.selector['searchParameters'] = [{
'xsi_type': 'RelatedToQuerySearchParameter',
'queries': ['space cruise']
}]
# Language setting (optional).
self.selector['searchParameters'].append({
'xsi_type': 'LanguageSearchParameter',
'languages': [{'id': '1010'}]
})
# Network search parameter (optional)
self.selector['searchParameters'].append({
'xsi_type': 'NetworkSearchParameter',
'networkSetting': {
'targetGoogleSearch': True,
'targetSearchNetwork': False,
'targetContentNetwork': False,
'targetPartnerSearchNetwork': False
}
})
#
def set_query(self, query_str):
"""Set the query_str
query_str -- a string or array of strings
"""
self.selector['searchParameters'] = [{
'xsi_type': 'RelatedToQuerySearchParameter',
'queries':
query_str if isinstance(query_str, list) else [query_str]
}]
def set_language(self, language_code):
# Language setting (optional).
self.selector['searchParameters'].append({
# The ID can be found in the documentation:
# https://developers.google.com/adwords/api/docs/appendix/languagecodes
# see languagecodes.csv
'xsi_type': 'LanguageSearchParameter',
'languages': [{'id': language_code}]
})
def set_ad_group_id(self, ad_group_id):
self.selector['searchParameters'].append({
'xsi_type': 'SeedAdGroupIdSearchParameter',
'adGroupId': ad_group_id
})
@property
def get_search_volume(self):
self.targeting_idea_service = self.client.GetService(
'TargetingIdeaService', version='v201710')
page = self.targeting_idea_service.get(self.selector)
if 'entries' in page:
for result in page['entries']:
attributes = {}
for attribute in result['data']:
attributes[attribute['key']] = getattr(
attribute['value'], 'value', '0')
return attributes['SEARCH_VOLUME']