简体   繁体   English

我使用什么“操作”从 googleads api 获取关键字搜索量? (TargetingIdeaService)

[英]What "operations" do I use to get keyword search volume from the googleads api? (TargetingIdeaService)

I am trying to get a search volume metric from the Google Ads API.我正在尝试从 Google Ads API 获取搜索量指标。 I am running into trouble when I using the "SearchVolumeSearchParameter" argument.我在使用“SearchVolumeSearchParameter”参数时遇到了麻烦。 This argument requires an "operation" field and the documentation does not do a great job on explaining what these operations can be.这个论点需要一个“操作”字段,文档并没有很好地解释这些操作可以是什么。 Preferably, I would like the script to return a list of keywords and their respective search volumes for the previous month.最好,我希望脚本返回上个月的关键字列表及其各自的搜索量。

adwords_client = adwords.AdWordsClient.LoadFromStorage()
targeting_idea_service = adwords_client.GetService(
      'TargetingIdeaService', version='v201809') 

selector = {
    'ideaType': 'KEYWORD',
    'requestType': 'STATS'
}

selector['requestedAttributeTypes'] = [
    'KEYWORD_TEXT', 
    'SEARCH_VOLUME', 
    # 'TARGETED_MONTHLY_SEARCHES',
]
offset = 0
PAGE_SIZE = 500
selector['paging'] = {
    'startIndex': str(offset),
    'numberResults': str(PAGE_SIZE)
}
selector['searchParameters'] = [{
        'xsi_type': 'SearchVolumeSearchParameter',
         'operation': []
                }]
page = targeting_idea_service.get(selector)

You use maximum, minimum like so:您使用最大值、最小值,如下所示:

  selector['searchParameters'] = [
      {
      'xsi_type': 'RelatedToQuerySearchParameter',
      'queries': search_keywords
      },
      {
      'xsi_type': 'LocationSearchParameter',
      'locations': [
          {'id': location_id}  
        ]
      },
      {
      'xsi_type': 'SearchVolumeSearchParameter',
       'operation': [
          {'minimum': 100}
       ]
      }
  ]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我可以通过AdWords测试帐户使用关键字规划师API(TargetingIdeaService)吗? - Am I able to use the Keyword Planner API (TargetingIdeaService) with an Adwords test account? 如何为 python googleads lib 创建 googleads yaml 文件? - How do I create a googleads yaml file for python googleads lib? 我有一个开发人员令牌,并安装了googleads软件包。 如何开始通过Python使用Google Ads API? - I have a developer token and installed the googleads package. How do I start using the Google Ads API with Python? 如何从此json文件获取卷? - How do I get the Volume from this json file? 如何搜索关键字并打印文件,只打印关键字中的行 - How do I search a keyword and print a file with only print the lines from the keyword on 通过Twitter Search API可以为一个特定的关键字获取多少数据? - How much data can I get with the Twitter Search API for one specific keyword? GoogleAds API 测试帐户设置 - GoogleAds API Test Account setup 在什么情况下我应该使用 self 关键字? - In what cases should i use self keyword? 我应该在CNN中使用哪种策略将3D体积转换为2D平面? - What strategy should I use in my CNN to go from a 3D volume to a 2D plane? 如何使用关键字作为变量名? - How do I use a keyword as a variable name?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM