Hi
I keep getting responses like UNEXPECTED_INTERNAL_API_ERROR.
I'm trying to get the monthly volume of my keywords but I can't.
I could get the correct response in PHP code, but not in python.

Here is my codes.
------------------------------------------------------------------------------------------------------------------------------
from googleads import adwords


# Optional AdGroup ID used to set a SearchAdGroupIdSearchParameter.
PAGE_SIZE = 100


def main(client):
  # Initialize appropriate service.
  targeting_idea_service = client.GetService(
      'TargetingIdeaService', version='v201809')

  # Construct selector object and retrieve related keywords.
  selector = {
      'ideaType': 'STATS',
      'requestType': 'IDEAS'
  }

  selector['requestedAttributeTypes'] = [
      'KEYWORD_TEXT', 'SEARCH_VOLUME', 'TARGETED_MONTHLY_SEARCHES']

  offset = 0
  selector['paging'] = {
      'startIndex': str(offset),
      'numberResults': str(PAGE_SIZE)
  }

  selector['searchParameters'] = [{
      'xsi_type': 'RelatedToQuerySearchParameter',
      'queries': ['삼성카드']
  }]

  # Language setting (optional).
  selector['searchParameters'].append({
      # The ID can be found in the documentation:
      # 
https://developers.google.com/adwords/api/docs/appendix/languagecodes
      'xsi_type': 'LanguageSearchParameter',
      'languages': [{'id': '1012'}]
  })

  # Network search parameter (optional)
  selector['searchParameters'].append({
      'xsi_type': 'NetworkSearchParameter',
      'networkSetting': {
          'targetGoogleSearch': True,
          'targetSearchNetwork': False,
          'targetContentNetwork': False,
          'targetPartnerSearchNetwork': False
      }
  })

  more_pages = True
  while more_pages:
    page = targeting_idea_service.get(selector)
    
    print(page)


if __name__ == '__main__':
  # Initialize client object.
  adwords_client = adwords.AdWordsClient.LoadFromStorage()

  main(adwords_client)
------------------------------------------------------------------------------------------------------------------------------

And the Error is below.
------------------------------------------------------------------------------------------------------------------------------
Error summary: {'faultMessage': 
'[InternalApiError.UNEXPECTED_INTERNAL_API_ERROR @ 
com.google.ads.api.services.common.error.InternalApiError.<init>(InternalApiErro]',
 
'requestId': '0005a591950de0560ab46056a704a0e1', 'serviceName': 
'TargetingIdeaService', 'methodName': 'get', 'operations': '1', 
'responseTime': '224'}
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/googleads/common.py", line 
992, in MakeSoapRequest
    *packed_args, _soapheaders=soap_headers)['body']['rval']
  File "/usr/local/lib/python3.6/site-packages/zeep/proxy.py", line 45, in 
__call__
    kwargs,
  File "/usr/local/lib/python3.6/site-packages/zeep/wsdl/bindings/soap.py", 
line 130, in send
    return self.process_reply(client, operation_obj, response)
  File "/usr/local/lib/python3.6/site-packages/zeep/wsdl/bindings/soap.py", 
line 195, in process_reply
    return self.process_error(doc, operation)
  File "/usr/local/lib/python3.6/site-packages/zeep/wsdl/bindings/soap.py", 
line 299, in process_error
    detail=fault_node.find("detail"),
zeep.exceptions.Fault: [InternalApiError.UNEXPECTED_INTERNAL_API_ERROR @ 
com.google.ads.api.services.common.error.InternalApiError.<init>(InternalApiErro]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/google/test.py", line 113, in <module>
    main(adwords_client)
  File "/home/google/test.py", line 85, in main
    page = targeting_idea_service.get(selector)
  File "/usr/local/lib/python3.6/site-packages/googleads/common.py", line 
1004, in MakeSoapRequest
    e.detail, errors=error_list, message=e.message)
googleads.errors.GoogleAdsServerFault: 
[InternalApiError.UNEXPECTED_INTERNAL_API_ERROR @ 
com.google.ads.api.services.common.error.InternalApiError.<init>(InternalApiErro]
------------------------------------------------------------------------------------------------------------------------------

What is this commonError?
Please let me know where to fixed.
Thanks.

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/0a714e73-00c9-4e92-839c-c37a63ce6394%40googlegroups.com.

Reply via email to