googleads.errors.GoogleAdsServerFault: [RateExceededError <rateName=RATE_LIMIT, rateKey=null, rateScope=ACCOUNT, retryAfterSeconds=30>]
My understanding from the rate sheet (https://developers.google.com/adwords/api/docs/ratesheet) is that I should be able to run 10,000 operations per day. I should be running only 1 get request (for 1 page as seen in my code below).
Any assistance as to why this error is throwing would be greatly helpful.
Code:
from googleads import adwordsimport loggingimport googleads
# logging.basicConfig(level=logging.INFO, format=googleads.util.LOGGER_FORMAT)# logging.getLogger('googleads.soap').setLevel(logging.DEBUG)
# Optional AdGroup ID used to set a SearchAdGroupIdSearchParameter.AD_GROUP_ID = 'INSERT_AD_GROUP_ID_HERE'PAGE_SIZE = 1
data_table = []def main(client, ad_group_id=None): # Initialize appropriate service. targeting_idea_service = client.GetService( 'TargetingIdeaService', version='v201806')
# Construct selector object and retrieve related keywords. selector = { 'ideaType': 'KEYWORD', 'requestType': 'IDEAS' }
selector['requestedAttributeTypes'] = [ 'KEYWORD_TEXT', 'SEARCH_VOLUME', 'CATEGORY_PRODUCTS_AND_SERVICES']
offset = 0 selector['paging'] = { 'startIndex': str(offset), 'numberResults': str(PAGE_SIZE) }
selector['searchParameters'] = [{ 'xsi_type': 'RelatedToQuerySearchParameter', 'queries': ['space cruise'] }]
# Language setting (optional). selector['searchParameters'].append({ # The ID can be found in the documentation: 'xsi_type': 'LanguageSearchParameter', 'languages': [{'id': '1000'}] })
# Network search parameter (optional) selector['searchParameters'].append({ 'xsi_type': 'NetworkSearchParameter', 'networkSetting': { 'targetGoogleSearch': True, 'targetSearchNetwork': False, 'targetContentNetwork': False, 'targetPartnerSearchNetwork': False } })
# Use an existing ad group to generate ideas (optional) if ad_group_id is not None: selector['searchParameters'].append({ 'xsi_type': 'SeedAdGroupIdSearchParameter', 'adGroupId': ad_group_id })
more_pages = True while more_pages: page = targeting_idea_service.get(selector)
# Display results. if 'entries' in page: for result in page['entries']: attributes = {} for attribute in result['data']: attributes[attribute['key']] = getattr( attribute['value'], 'value', '0') print ('Keyword with "%s" text and average monthly search volume ' '"%s" was found with Products and Services categories: %s.' % (attributes['KEYWORD_TEXT'], attributes['SEARCH_VOLUME'], attributes['CATEGORY_PRODUCTS_AND_SERVICES'])) print else: print('No related keywords were found.') offset += PAGE_SIZE selector['paging']['startIndex'] = str(offset) more_pages = offset < int(page['totalNumEntries'])
if __name__ == '__main__': # Initialize client object. adwords_client = adwords.AdWordsClient.LoadFromStorage()
main(adwords_client, int(AD_GROUP_ID) if AD_GROUP_ID.isdigit() else None)
Keyword with "panama canal cruise" text and average monthly search volume "18100" was found with Products and Services categories: [10153, 10017, 10802, 10150].
Keyword with "cruises from melbourne" text and average monthly search volume "8100" was found with Products and Services categories: [10153, 10017, 10802, 10150].
Keyword with "cruises from florida" text and average monthly search volume "22200" was found with Products and Services categories: [10153, 10017, 10802, 10150].
Keyword with "florida cruises" text and average monthly search volume "6600" was found with Products and Services categories: [10153, 10017, 10150].
Keyword with "cruises" text and average monthly search volume "368000" was found with Products and Services categories: [10153, 10017, 10802, 10150].
Keyword with "emerald river cruises" text and average monthly search volume "2900" was found with Products and Services categories: [12096, 10153, 10017, 10151].
Keyword with "river cruise lines" text and average monthly search volume "2400" was found with Products and Services categories: [12096, 10153, 10017, 10151].
Keyword with "world cruise" text and average monthly search volume "18100" was found with Products and Services categories: [10153, 10017, 10802, 10150].
Keyword with "caribbean cruise" text and average monthly search volume "135000" was found with Products and Services categories: [10153, 10017, 10802, 10150].
Keyword with "emerald cruises" text and average monthly search volume "2900" was found with Products and Services categories: [12096, 10153, 10017].
Keyword with "cruise" text and average monthly search volume "368000" was found with Products and Services categories: [10153, 10017, 10802, 10150].
Keyword with "river cruises" text and average monthly search volume "49500" was found with Products and Services categories: [12096, 10153, 10017, 10151].
Keyword with "boat cruise" text and average monthly search volume "22200" was found with Products and Services categories: [12096, 10153, 10017, 10802].
Keyword with "royal caribbean cruise ships" text and average monthly search volume "22200" was found with Products and Services categories: [10153, 10017, 10802, 10150].
Keyword with "royal caribbean cruises" text and average monthly search volume "246000" was found with Products and Services categories: [10153, 10017, 10802, 10150].
Keyword with "caribbean cruise ships" text and average monthly search volume "2900" was found with Products and Services categories: [10153, 10017, 10802, 10150].
Keyword with "cruise ship" text and average monthly search volume "135000" was found with Products and Services categories: [10153, 10017, 10150].
Keyword with "royal cruise" text and average monthly search volume "14800" was found with Products and Services categories: [10153, 10017, 12093, 10150].
Keyword with "royal caribbean oasis" text and average monthly search volume "5400" was found with Products and Services categories: [10153, 10017, 10150].
Keyword with "port canaveral transportation" text and average monthly search volume "880" was found with Products and Services categories: [10785, 10017, 10146, 12085, 10789].
Keyword with "scenic crystal river cruise" text and average monthly search volume "20" was found with Products and Services categories: [12096, 10153, 10017, 10151].
Keyword with "orlando to port canaveral" text and average monthly search volume "2400" was found with Products and Services categories: [10785, 10017, 10146, 13842, 12085, 13575, 10782].
Error summary: {'faultMessage': '[RateExceededError <rateName=RATE_LIMIT, rateKey=null, rateScope=ACCOUNT, retryAfterSeconds=30>]', 'requestId': '000576ef47109e300abf62118906a649', 'serviceName': 'TargetingIdeaService', 'methodName': 'get', 'operations': '1', 'responseTime': '29'}
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/googleads/common.py", line 1377, in MakeSoapRequest
*packed_args, _soapheaders=soap_headers)['body']['rval']
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/zeep/proxy.py", line 42, in __call__
self._op_name, args, kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/zeep/wsdl/bindings/soap.py", line 132, in send
return self.process_reply(client, operation_obj, response)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/zeep/wsdl/bindings/soap.py", line 194, in process_reply
return self.process_error(doc, operation)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/zeep/wsdl/bindings/soap.py", line 299, in process_error
detail=fault_node.find('detail'))
zeep.exceptions.Fault: [RateExceededError <rateName=RATE_LIMIT, rateKey=null, rateScope=ACCOUNT, retryAfterSeconds=30>]
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "keyword_planner.py", line 94, in <module>
main(adwords_client, int(AD_GROUP_ID) if AD_GROUP_ID.isdigit() else None)
File "keyword_planner.py", line 68, in main
page = targeting_idea_service.get(selector)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/googleads/common.py", line 1389, in MakeSoapRequest
e.detail, errors=error_list, message=e.message)
googleads.errors.GoogleAdsServerFault: [RateExceededError <rateName=RATE_LIMIT, rateKey=null, rateScope=ACCOUNT, retryAfterSeconds=30>]