You can use the Merchant Reports API to [view performance
data](https://developers.google.com/merchant/api/guides/reports/evaluate-products#measure_performance), [filter your products](https://developers.google.com/merchant/api/guides/reports/evaluate-products#filter_products) by
specific attributes, and [improve your pricing](https://developers.google.com/merchant/api/guides/reports/evaluate-products#improve_pricing).

## Measure performance

You can retrieve
[performance metrics](https://support.google.com/merchants/answer/10265167)
for your account with the Merchant Reports API
[`product_performance_view`](https://developers.google.com/merchant/api/reference/rest/reports_v1/accounts.reports/search#productperformanceview).

### Requirements

To retrieve this report you will need to have the
[Performance and insights role](https://support.google.com/merchants/answer/11935402).

To assign the Performance and insights role to an existing user, create a [patch
request](https://developers.google.com/merchant/api/reference/rest/accounts_v1/accounts.users/patch) and
assign the `PERFORMANCE_REPORTING` access right to the user. The following
request shows how you can create a patch request for assigning the
`PERFORMANCE_REPORTING` access right:

    PATCH https://merchantapi.googleapis.com/accounts/v1/accounts/{ACCOUNT_ID}/users/{EMAIL_ID}

    {
      "accessRights": [
        "PERFORMANCE_REPORTING"
      ]
    }

Replace the following:

- <var translate="no">{ACCOUNT_ID}</var>: The unique identifier of the Merchant Center account.
- <var translate="no">{EMAIL_ID}</var>: The email address of the user to whom you want to assign the role.

### Sample query

The following query retrieves the `impressions`, `clicks`, and
`click_through_rate` for all products in your account during a specific 30-day
period. To make the request, pass the following [Merchant Center Query
Language](https://developers.google.com/merchant/api/guides/reports/query-language) statement to the
[`accounts.reports.search`](https://developers.google.com/merchant/api/reference/rest/reports_v1/accounts.reports/search)
method:

    SELECT impressions, clicks, click_through_rate
    FROM product_performance_view
    WHERE date BETWEEN '2020-12-01' AND '2020-12-30'

For more information about performance reports, see the
[Performance reports](https://developers.google.com/merchant/api/guides/reports/performance-reports)
guide.

## Filter products

You can use the Merchant Reports API's
[`product_view`](https://developers.google.com/merchant/api/reference/rest/reports_v1/accounts.reports#productview)
to show a filtered view of your product data, including product statuses. For
example, you can query `product_view` to list products that have issues, or to
get a list of your new products and verify serving.

You must include the `id` field in the `SELECT` clause of your query. The `id`
has the same value as the product's [REST
ID](https://developers.google.com/merchant/api/guides/compatibility#new_id_format).

You can filter based on all the
[available fields](https://developers.google.com/merchant/api/reference/rest/reports_v1/accounts.reports#productview),
except the following:

- `status_per_reporting_context`
- `item_issues`

You can sort the response based on all the available fields except the
following:

- `gtin`
- `status_per_reporting_context`
- `item_issues`

You can check the `aggregated_reporting_context_status` field to understand
a product's overall eligibility. This field aggregates the statuses across all
of a product's reporting contexts.

Here's an example that returns your products with the aggregated status
`ELIGIBLE_LIMITED`, meaning they're eligible to serve in at least one, but not
all, of their targeted reporting contexts. You can request the detailed product
status per reporting context and product issues to investigate further. To make
the request, pass the following [Merchant Center Query
Language](https://developers.google.com/merchant/api/guides/reports/query-language) statement
to the
[`accounts.reports.search`](https://developers.google.com/merchant/api/reference/rest/reports_v1/accounts.reports/search)
method:

    SELECT
      id,
      offer_id,
      feed_label,
      title,
      aggregated_reporting_context_status,
      status_per_reporting_context,
      item_issues
    FROM product_view
    WHERE aggregated_reporting_context_status = 'ELIGIBLE_LIMITED'

Here's a sample response from the preceding query:

    {
      "results": [
        {
          "productView": {
            "id": "en~US~id0",
            "offerId": "id0",
            "feedLabel": "US",
            "aggregatedReportingContextStatus": "ELIGIBLE_LIMITED",
            "statusPerReportingContext": [
              {
                "reportingContext": "SHOPPING_ADS",
                "disapprovedCountries": [
                  "US"
                ]
              },
              {
                "reportingContext": "FREE_LISTINGS",
                "approvedCountries": [
                  "US"
                ]
              }
            ]
            "itemIssues": [
              {
                "type": {
                  "code": "invalid_string_value",
                  "canonicalAttribute": "n:product_code"
                },
                "severity": {
                  "severityPerReportingContext": [
                    {
                      "reportingContext": "SHOPPING_ADS",
                      "disapprovedCountries": [
                        "US"
                      ]
                    },
                    {
                      "reportingContext": "FREE_LISTINGS",
                      "disapprovedCountries": [
                        "US"
                      ]
                    }
                  ],
                  "aggregatedSeverity": "DISAPPROVED"
                },
                "resolution": "MERCHANT_ACTION"
              },
              {
                "type": {
                  "code": "apparel_missing_brand",
                  "canonicalAttribute": "n:brand"
                },
                "severity": {
                  "severityPerReportingContext": [
                    {
                      "reportingContext": "SHOPPING_ADS",
                      "disapprovedCountries": [
                        "US"
                      ]
                    }
                  ],
                  "aggregatedSeverity": "DEMOTED"
                },
                "resolution": "MERCHANT_ACTION"
              }
            ]
          }
        }
      ]
    }

You can use a filter on `reporting_context` in the `WHERE` clause to view
product details for a specific reporting context. When you filter by
`reporting_context`, `aggregated_reporting_context_status` is computed based
only on the selected reporting context, and `status_per_reporting_context` and
`item_issues` only return details for that context.

For more information about the fields available for query, see
[Fields in `product_view` table](https://developers.google.com/merchant/api/reference/rest/reports_v1/accounts.reports#ProductView.FIELDS).

## Improve pricing

You can use the price insights view to see suggested sale prices for your
products, and predictions for the performance that you can expect if you update
your products' prices. Using the price insights report can help you price your
products more effectively.

For more information, see [Improve product pricing with the price insights report](https://support.google.com/merchants/answer/11916926).

Query
[`price_insights_product_view`](https://developers.google.com/merchant/api/reference/rest/reports_v1/accounts.reports/search#priceinsightsproductview)
to view suggested sale prices for your products.

Here's a sample you can use to view suggested sales prices for your products. To
make the request, pass the following [Merchant Center Query
Language](https://developers.google.com/merchant/api/guides/reports/query-language) statement to the
[`accounts.reports.search`](https://developers.google.com/merchant/api/reference/rest/reports_v1/accounts.reports/search)
method:

    SELECT
      id,
      title,
      brand,
      price,
      suggested_price,
      predicted_impressions_change_fraction,
      predicted_clicks_change_fraction,
      predicted_conversions_change_fraction
    FROM price_insights_product_view

Here's a sample response from the preceding query:

    {
       "results": [
        {
          "priceInsightsProductView": {
            "id": "en~US~12345",
            "title": "UGG Women's s Classic Mini",
            "brand": "UGG",
            "price" {
              "amountMicros": "124990000",
              "currencyCode": "USD"
            },
            "suggestedPrice" {
              "amountMicros": "135680000",
              "currencyCode": "USD"
            },
            "predictedImpressionsChangeFraction": "0.12609300017356873",
            "predictedClicksChangeFraction": "0.508745014667511",
            "predictedConversionsChangeFraction": "2.3431060314178467"
          }
        },
        {
          "priceInsightsProductView": {
            "id": "en~US~12346",
            "title": "Nike React Infinity Run Flyknit 2",
            "brand": "Nike",
            "price" {
              "amountMicros": "119990000"
              "currencyCode": "USD"
            },
            "suggestedPrice" {
              "amountMicros": "125440000",
              "currencyCode": "USD"
            },
            "predictedImpressionsChangeFraction": "0.1799899935722351",
            "predictedClicksChangeFraction": "0.6203680038452148",
            "predictedConversionsChangeFraction": "1.234868049621582"
          }
        },
        {
          "priceInsightsProductView": {
            "id": "en~US~12347",
            "title": "  New Balance 327 White Trainers",
            "brand": "New Balance",
            "price" {
              "amountMicros": "84990000"
              "currencyCode": "USD"
            },
            "suggestedPrice" {
              "amountMicros": "82000000",
              "currencyCode": "USD"
            },
            "predictedImpressionsChangeFraction": "0.11538799852132797",
            "predictedClicksChangeFraction": "0.5869849920272827",
            "predictedConversionsChangeFraction": "1.3622850179672241"
          }
        }
      ]
    }

For more information about the fields available for query, see [Fields in `priceInsightsProductView` table](https://developers.google.com/merchant/api/reference/rest/reports_v1/accounts.reports#PriceInsightsProductView.FIELDS).