Caution: You are viewing documentation for the API's REST interface. Most of our official client libraries use gRPC. See the REST Introduction for details.

Method: customers.generateKeywordIdeas

Stay organized with collections Save and categorize content based on your preferences.

Returns a list of keyword ideas.

List of thrown errors: AuthenticationError AuthorizationError CollectionSizeError HeaderError InternalError KeywordPlanIdeaError QuotaError RequestError

HTTP request

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

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
customerId

string

The ID of the customer with the recommendation.

Request body

The request body contains data with the following structure:

JSON representation
{
  "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.
}
Fields
geoTargetConstants[]

string

The resource names of the location to target. Maximum is 10. An empty list MAY be used to specify all targeting geos.

includeAdultKeywords

boolean

If true, adult keywords will be included in response. The default value is false.

pageToken

string

Token of the page to retrieve. If not specified, the first page of results will be returned. To request next page of results use the value obtained from nextPageToken in the previous response. The request fields must match across pages.

pageSize

integer

Number of results to retrieve in a single page. A maximum of 10,000 results may be returned, if the pageSize exceeds this, it is ignored. If unspecified, at most 10,000 results will be returned. The server may decide to further limit the number of returned resources. If the response contains fewer than 10,000 results it may not be assumed as last page of results.

keywordPlanNetwork

enum (KeywordPlanNetwork)

Targeting network. If not set, Google googleAds.search And Partners Network will be used.

keywordAnnotation[]

enum (KeywordPlanKeywordAnnotation)

The keyword annotations to include in response.

aggregateMetrics

object (KeywordPlanAggregateMetrics)

The aggregate fields to include in response.

historicalMetricsOptions

object (HistoricalMetricsOptions)

The options for historical metrics data.

language

string

The resource name of the language to target. Each keyword belongs to some set of languages; a keyword is included if language is one of its languages. If not set, all keywords will be included.

Union field seed. The type of seed to generate keyword ideas. seed can be only one of the following:
keywordAndUrlSeed

object (KeywordAndUrlSeed)

A Keyword and a specific Url to generate ideas from for example, cars, www.example.com/cars.

keywordSeed

object (KeywordSeed)

A Keyword or phrase to generate ideas from, for example, cars.

urlSeed

object (UrlSeed)

A specific url to generate ideas from, for example, www.example.com/cars.

siteSeed

object (SiteSeed)

The site to generate ideas from, for example, www.example.com.

Response body

If successful, the response body contains data with the following structure:

Response message for KeywordPlanIdeaService.GenerateKeywordIdeas.

JSON representation
{
  "results": [
    {
      object (GenerateKeywordIdeaResult)
    }
  ],
  "aggregateMetricResults": {
    object (KeywordPlanAggregateMetricResults)
  },
  "nextPageToken": string,
  "totalSize": string
}
Fields
results[]

object (GenerateKeywordIdeaResult)

Results of generating keyword ideas.

aggregateMetricResults

object (KeywordPlanAggregateMetricResults)

The aggregate metrics for all keyword ideas.

nextPageToken

string

Pagination token used to retrieve the next page of results. Pass the content of this string as the pageToken attribute of the next request. nextPageToken is not returned for the last page.

totalSize

string (int64 format)

Total number of results available.

Authorization Scopes

Requires the following OAuth scope:

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

For more information, see the OAuth 2.0 Overview.

KeywordPlanKeywordAnnotation

Enumerates keyword plan annotations that can be requested.

Enums
UNSPECIFIED Not specified.
UNKNOWN The value is unknown in this version.
KEYWORD_CONCEPT Return the keyword concept and concept group data.

KeywordAndUrlSeed

Keyword And Url Seed

JSON representation
{
  "keywords": [
    string
  ],
  "url": string
}
Fields
keywords[]

string

Requires at least one keyword.

url

string

The URL to crawl in order to generate keyword ideas.

KeywordSeed

Keyword Seed

JSON representation
{
  "keywords": [
    string
  ]
}
Fields
keywords[]

string

Requires at least one keyword.

UrlSeed

Url Seed

JSON representation
{
  "url": string
}
Fields
url

string

The URL to crawl in order to generate keyword ideas.

SiteSeed

Site Seed

JSON representation
{
  "site": string
}
Fields
site

string

The domain name of the site. If the customer requesting the ideas doesn't own the site provided only public information is returned.

GenerateKeywordIdeaResult

The result of generating keyword ideas.

JSON representation
{
  "keywordIdeaMetrics": {
    object (KeywordPlanHistoricalMetrics)
  },
  "keywordAnnotations": {
    object (KeywordAnnotations)
  },
  "closeVariants": [
    string
  ],
  "text": string
}
Fields
keywordIdeaMetrics

object (KeywordPlanHistoricalMetrics)

The historical metrics for the keyword.

keywordAnnotations

object (KeywordAnnotations)

The annotations for the keyword. The annotation data is only provided if requested.

closeVariants[]

string

The list of close variants from the requested keywords that are combined into this GenerateKeywordIdeaResult. See https://support.google.com/google-ads/answer/9342105 for the definition of "close variants".

text

string

Text of the keyword idea. As in Keyword Plan historical metrics, this text may not be an actual keyword, but the canonical form of multiple keywords. See KeywordPlanKeywordHistoricalMetrics message in KeywordPlanService.

KeywordAnnotations

The Annotations for the Keyword plan keywords.

JSON representation
{
  "concepts": [