Method: customers.generateKeywordHistoricalMetrics

Returns a list of keyword historical metrics.

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

HTTP request

POST https://googleads.googleapis.com/v18/customers/{customerId}:generateKeywordHistoricalMetrics

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
{
  "keywords": [
    string
  ],
  "includeAdultKeywords": boolean,
  "geoTargetConstants": [
    string
  ],
  "keywordPlanNetwork": enum (KeywordPlanNetwork),
  "aggregateMetrics": {
    object (KeywordPlanAggregateMetrics)
  },
  "historicalMetricsOptions": {
    object (HistoricalMetricsOptions)
  },
  "language": string
}
Fields
keywords[]

string

A list of keywords to get historical metrics. Not all inputs will be returned as a result of near-exact deduplication. For example, if stats for "car" and "cars" are requested, only "car" will be returned. A maximum of 10,000 keywords can be used.

includeAdultKeywords

boolean

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

geoTargetConstants[]

string

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

keywordPlanNetwork

enum (KeywordPlanNetwork)

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

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.

Response body

Response message for KeywordPlanIdeaService.GenerateKeywordHistoricalMetrics.

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

JSON representation
{
  "results": [
    {
      object (GenerateKeywordHistoricalMetricsResult)
    }
  ],
  "aggregateMetricResults": {
    object (KeywordPlanAggregateMetricResults)
  }
}
Fields
results[]

object (GenerateKeywordHistoricalMetricsResult)

List of keywords and their historical metrics.

aggregateMetricResults

object (KeywordPlanAggregateMetricResults)

The aggregate metrics for all keywords.

Authorization scopes

Requires the following OAuth scope:

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

For more information, see the OAuth 2.0 Overview.

GenerateKeywordHistoricalMetricsResult

The result of generating keyword historical metrics.

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

string

The list of close variants from the requested keywords whose stats are combined into this GenerateKeywordHistoricalMetricsResult.

keywordMetrics

object (KeywordPlanHistoricalMetrics)

The historical metrics for text and its close variants

text

string

The text of the query associated with one or more keywords. Note that we de-dupe your keywords list, eliminating close variants before returning the keywords as text. For example, if your request originally contained the keywords "car" and "cars", the returned search query will only contain "cars". The list of de-duped queries will be included in closeVariants field.