Version v2 of the Content API is scheduled for sunset on September 30th, 2021. Onboarding to v2 will stop on April 30, 2021. To avoid disruptions with your integration, please migrate to v2.1 as soon as possible.

For more information, see Migrating to v2.1 and this blog post.

Method: reports.search

Retrieves merchant performance mertrics matching the search query and optionally segmented by selected dimensions.

HTTP request

POST https://shoppingcontent.googleapis.com/content/v2.1/{merchantId}/reports/search

Path parameters

Parameters
merchantId

string (int64 format)

Required. Id of the merchant making the call. Must be a standalone account or an MCA subaccount.

Request body

The request body contains data with the following structure:

JSON representation
{
  "query": string,
  "pageSize": integer,
  "pageToken": string
}
Fields
query

string

Required. Query that defines performance metrics to retrieve and dimensions according to which the metrics are to be segmented.

pageSize

integer

Number of ReportRows to retrieve in a single page. Defaults to the maximum of 1000. Values above 1000 are coerced to 1000.

pageToken

string

Token of the page to retrieve. If not specified, the first page of results is returned. In order to request the next page of results, the value obtained from nextPageToken in the previous response should be used.

Response body

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

Response message for the ReportService.Search method.

JSON representation
{
  "results": [
    {
      object (ReportRow)
    }
  ],
  "nextPageToken": string
}
Fields
results[]

object (ReportRow)

Rows that matched the search query.

nextPageToken

string

Token which can be sent as pageToken to retrieve the next page. If omitted, there are no subsequent pages.

Authorization Scopes

Requires one of the following OAuth scopes:

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

For more information, see the OAuth 2.0 Overview.

ReportRow

Result row returned from the search query.

JSON representation
{
  "segments": {
    object (Segments)
  },
  "metrics": {
    object (Metrics)
  }
}
Fields
segments

object (Segments)

Segmentation dimensions requested by the merchant in the query. Dimension values are only set for dimensions requested explicitly in the query.

metrics

object (Metrics)

Metrics requested by the merchant in the query. Metric values are only set for metrics requested explicitly in the query.

Segments

Dimensions according to which metrics are segmented in the response. Values of product dimensions, e.g., offer id, reflect the state of a product at the time of the corresponding event, e.g., impression or order.

Segment fields cannot be selected in queries without also selecting at least one metric field.

Values are only set for dimensions requested explicitly in the request's search query.

JSON representation
{
  "program": enum (Program),
  "date": {
    object (Date)
  },
  "offerId": string
}
Fields
program

enum (Program)

Program to which metrics apply, e.g., Free Product Listing.

date

object (Date)

Date in the merchant timezone to which metrics apply.

offerId

string

Merchant-provided id of the product.

Program

Programs as part of which merchant's products are listed across Google.

Enums
PROGRAM_UNSPECIFIED Not specified.
SHOPPING_ADS Shopping Ads.
FREE_PRODUCT_LISTING Free Product Listing.
FREE_LOCAL_PRODUCT_LISTING Free Local Product Listing.
BUY_ON_GOOGLE_LISTING Buy on Google Listing.

Metrics

Performance metrics. Values are only set for metrics requested explicitly in the request's search query.

JSON representation
{
  "clicks": string,
  "impressions": string,
  "ctr": number
}
Fields
clicks

string (Int64Value format)

Number of clicks.

impressions

string (Int64Value format)

Number of times merchant's products are shown.

ctr

number

Click-through rate - the number of clicks merchant's products receive (clicks) divided by the number of times the products are shown (impressions).