Method: customers.generateKeywordIdeas

返回关键字提示列表。

抛出的错误列表:AuthenticationError AuthorizationError CollectionSizeError HeaderError InternalError KeywordPlanIdeaError QuotaError RequestError

HTTP 请求

POST https://googleads.googleapis.com/v16/customers/{customerId}:generateKeywordIdeas

网址采用 gRPC 转码语法。

路径参数

参数
customerId

string

提供建议的客户的 ID。

请求正文

请求正文中包含结构如下的数据:

JSON 表示法
{
  "geoTargetConstants": [
    string
  ],
  "includeAdultKeywords": boolean,
  "pageToken": string,
  "pageSize": integer,
  "keywordPlanNetwork": enum (KeywordPlanNetwork),
  "keywordAnnotation": [
    enum (KeywordPlanKeywordAnnotation)
  ],
  "aggregateMetrics": {
    object (KeywordPlanAggregateMetrics)
  },
  "historicalMetricsOptions": {
    object (HistoricalMetricsOptions)
  },
  "language": string,

  // Union field seed can be only one of the following:
  "keywordAndUrlSeed": {
    object (KeywordAndUrlSeed)
  },
  "keywordSeed": {
    object (KeywordSeed)
  },
  "urlSeed": {
    object (UrlSeed)
  },
  "siteSeed": {
    object (SiteSeed)
  }
  // End of list of possible types for union field seed.
}
字段
geoTargetConstants[]

string

目标地理位置的资源名称。最大值为 10。可以使用空列表来指定所有目标地理位置。

includeAdultKeywords

boolean

如果为 true,响应中将包含成人关键字。默认值为 false。

pageToken

string

要检索的页面的令牌。如果未指定,将返回第一页结果。如需请求下一页结果,请使用从上一个响应中的 nextPageToken 获取的值。各个页面中的请求字段必须保持一致。

pageSize

integer

要在单个页面中检索的结果数。最多可返回 10,000 个结果,如果 pageSize 超过该值,则会忽略该值。如果未指定,则最多返回 10,000 个结果。服务器可能决定进一步限制返回的资源数量。如果响应包含的结果数少于 10,000 个,系统可能不会将其视为最后一页结果。

keywordPlanNetwork

enum (KeywordPlanNetwork)

定位广告网络。如果未设置此政策,系统将会使用 Google 搜索与合作伙伴网络。

keywordAnnotation[]

enum (KeywordPlanKeywordAnnotation)

要包含在响应中的关键字注释。

aggregateMetrics

object (KeywordPlanAggregateMetrics)

要包含在响应中的汇总字段。

historicalMetricsOptions

object (HistoricalMetricsOptions)

历史指标数据的选项。

language

string

要定位的语言的资源名称。每个关键字都属于一组语言;如果语言是某个关键字的语言之一,就会包含该关键字。如果未设置,则将包括所有关键字。

联合字段 seed。用于生成关键字提示的种子类型。seed 只能是下列其中一项:
keywordAndUrlSeed

object (KeywordAndUrlSeed)

一个关键字和一个具体网址,用于生成提示(例如,汽车 www.example.com/cars)。

keywordSeed

object (KeywordSeed)

用于生成提示(例如汽车)的关键字或短语。

urlSeed

object (UrlSeed)

用于生成提示的特定网址,例如 www.example.com/cars。

siteSeed

object (SiteSeed)

生成提示的网站,例如 www.example.com。

响应正文

KeywordPlanIdeaService.GenerateKeywordIdeas 的响应消息。

如果成功,响应正文将包含结构如下的数据:

JSON 表示法
{
  "results": [
    {
      object (GenerateKeywordIdeaResult)
    }
  ],
  "aggregateMetricResults": {
    object (KeywordPlanAggregateMetricResults)
  },
  "nextPageToken": string,
  "totalSize": string
}
字段
results[]

object (GenerateKeywordIdeaResult)

生成关键字提示的结果。

aggregateMetricResults

object (KeywordPlanAggregateMetricResults)

所有关键字提示的汇总指标。

nextPageToken

string

用于检索下一页结果的分页令牌。将此字符串的内容作为下一个请求的 pageToken 属性传递。没有针对最后一页返回 nextPageToken

totalSize

string (int64 format)

可用的结果总数。

授权范围

需要以下 OAuth 作用域:

  • https://www.googleapis.com/auth/adwords

有关详情,请参阅 OAuth 2.0 概览

KeywordPlanKeywordAnnotation

枚举可请求的关键字方案注释。

枚举
UNSPECIFIED 未指定。
UNKNOWN 在此版本中,此值未知。
KEYWORD_CONCEPT 返回关键字概念和概念组数据。

KeywordAndUrlSeed

关键字和网址种子

JSON 表示法
{
  "keywords": [
    string
  ],
  "url": string
}
字段
keywords[]

string

至少需要一个关键字。

url

string

为了生成关键字提示而要抓取的网址。

KeywordSeed

关键字种子

JSON 表示法
{
  "keywords": [
    string
  ]
}
字段
keywords[]

string

至少需要一个关键字。

UrlSeed

网址种子

JSON 表示法
{
  "url": string
}
字段
url

string

为了生成关键字提示而要抓取的网址。

SiteSeed

网站种子

JSON 表示法
{
  "site": string
}
字段
site

string

网站的域名。如果请求提供提示的客户不拥有网站,则系统将仅返回公开信息。

GenerateKeywordIdeaResult

生成关键字提示的结果。

JSON 表示法
{
  "keywordIdeaMetrics": {
    object (KeywordPlanHistoricalMetrics)
  },
  "keywordAnnotations": {
    object (KeywordAnnotations)
  },
  "closeVariants": [
    string
  ],
  "text": string
}
字段
keywordIdeaMetrics

object (KeywordPlanHistoricalMetrics)

关键字的历史指标。

keywordAnnotations

object (KeywordAnnotations)

关键字的注释。只有在请求时才会提供注释数据。

closeVariants[]

string

组合到此 GenerateKeywordIdeaResult 中的所请求关键字的紧密变体形式列表。有关“紧密变体”的定义,请参阅 https://support.google.com/google-ads/answer/9342105

text

string

关键字提示的文字。与关键字方案历史指标一样,这些文字可能不是实际关键字,而是多个关键字的规范形式。请参阅 KeywordPlanService 中的 KeywordPlanKeywordHistoricalMetrics 消息。

KeywordAnnotations

关键字方案关键字的注释。

JSON 表示法
{
  "concepts": [
    {
      object (KeywordConcept)
    }
  ]
}
字段
concepts[]

object (KeywordConcept)

关键字的概念列表。

KeywordConcept

关键字的概念。

JSON 表示法
{
  "name": string,
  "conceptGroup": {
    object (ConceptGroup)
  }
}
字段
name

string

conceptGroup 中关键字的概念名称。

conceptGroup

object (ConceptGroup)

概念详情的概念组。

ConceptGroup

关键字概念的概念组。

JSON 表示法
{
  "name": string,
  "type": enum (KeywordPlanConceptGroupType)
}
字段
name

string

概念组的名称。

type

enum (KeywordPlanConceptGroupType)

概念组的类型。

KeywordPlanConceptGroupType

枚举关键字方案概念组类型。

枚举
UNSPECIFIED 概念组分类与品牌/非品牌不同。这是一个包含所有不属于以下分类的所有类别。
UNKNOWN 在此版本中,此值未知。
BRAND 概念组分类以 BRAND 为基础。
OTHER_BRANDS 基于 BRAND 的概念组分类,不适用于 BRAND 分类。这些字词通常是离群值,在此类分类中可以有非常少的关键字。
NON_BRAND 这些概念组分类并非基于 BRAND。对于没有品牌关联的宽泛关键字,系统会返回此代码。