POST/v2.1/merchantId/reports/searchHTTP/1.1Host:shoppingcontent.googleapis.comUser-Agent:curlContent-Type:application/jsonAccept:application/jsonAuthorization:Bearer access tokenParameters:{"query":"SELECT segments.program, segments.offer_id, metrics.impressions, metrics.clicks, metrics.ctr FROM MerchantPerformanceView WHERE segments.date BETWEEN '2020-11-01' AND '2020-11-30'"}
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["缺少我需要的資訊","missingTheInformationINeed","thumb-down"],["過於複雜/步驟過多","tooComplicatedTooManySteps","thumb-down"],["過時","outOfDate","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["示例/程式碼問題","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-08-13 (世界標準時間)。"],[[["\u003cp\u003eThe Merchant API is the new version of the Content API for Shopping and represents the future of the platform.\u003c/p\u003e\n"],["\u003cp\u003eYou can use the Merchant API to retrieve performance data, such as impressions, clicks, and CTR, segmented by program and offer ID.\u003c/p\u003e\n"],["\u003cp\u003eA sample query is provided to demonstrate how to retrieve performance data for the last 30 days using the \u003ccode\u003eMerchantPerformanceView\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eIt's recommended to use one of the client libraries instead of directly making HTTP requests to the Content API for Shopping.\u003c/p\u003e\n"]]],["The beta version of the Merchant API, the new Content API for Shopping, is introduced. To use the `Reports` service, users with the Reporting manager role can query the `MerchantPerformanceView` for account performance. A sample query using Merchant Center Query Language is provided to retrieve data on `program`, `offer_id`, `impressions`, `clicks`, and `ctr` between '2020-11-01' and '2020-11-30'. Users can run the sample via the API Explorer, updating the merchant ID and modifying the query.\n"],null,["| Meet the [Merchant API (beta)](/merchant/api) - the official successor to the Content\n| API for Shopping.\n|\n|\n| [Get the latest](/merchant/api/latest-updates) on new features, bug fixes, and release\n| updates of the Merchant API (beta).\n|\n|\n| Learn how to manage your business and products on Google and how to get programmatic access to\n| data, insights, and unique capabilities at scale. [Get\n| started now](/merchant/api/guides/quickstart)\n\nHere's a sample query to the `MerchantPerformanceView` that returns the\nperformance of your account over the last 30 days, segmented by `program` and\n`offer_id`. You can try this quick example to get familiar with the `Reports` service.\n\nYou need the [Reporting manager\nrole](//support.google.com/merchants/answer/11935402) to retrieve this report.\n\nTo make the request, pass the following Merchant Center Query\nLanguage statement to the\n[`reports.search`](/shopping-content/reference/rest/v2.1/reports/search)\nmethod: \n\n SELECT\n segments.program,\n segments.offer_id,\n metrics.impressions,\n metrics.clicks,\n metrics.ctr\n FROM MerchantPerformanceView\n WHERE segments.date BETWEEN '2020-11-01' AND '2020-11-30'\n\n[Run](https://developers.google.com/shopping-content/reference/rest/v2.1/reports/search?apix=true&apix_params=%7B%22merchantId%22%3A0%2C%22resource%22%3A%7B%22query%22%3A%22SELECT%20%20segments.program%2C%20%20segments.offer_id%2C%20%20metrics.impressions%2C%20%20metrics.clicks%2C%20%20metrics.ctr%20FROM%20MerchantPerformanceView%20WHERE%20segments.date%20BETWEEN%20%272020-11-01%27%20AND%20%272020-11-30%27%22%7D%7D)\n\nClick **Run** to try the sample in the **API Explorer** . After you click\n**Run** , update the merchant ID placeholder to your own merchant ID in the\nrequest URL. You can modify the query. The full query must remain on one line to\nwork with the **API explorer**.\n| **Note:** This guide shows the underlying HTTP request as a teaching tool, but we recommend that you use one of the [client libraries](/shopping-content/guides/libraries) to submit your requests.\n\nHTTP request URL\n\nThe request consists of an HTTP POST to the Content API for Shopping server at\nthe following URL: \n\n```text\nhttps://shoppingcontent.googleapis.com/content/v2.1/merchantId/reports/search\n```\n\nComplete HTTP request sample\n\nHere is a complete example showing the report definition above enclosed within\nan HTTP POST request: \n\n```http\nPOST /v2.1/\u003cvar class=\"edit\" translate=\"no\"\u003emerchantId\u003c/var\u003e/reports/search HTTP/1.1\nHost: shoppingcontent.googleapis.com\nUser-Agent: curl\nContent-Type: application/json\nAccept: application/json\nAuthorization: Bearer \u003cvar class=\"edit\" translate=\"no\"\u003eaccess token\u003c/var\u003e\n\nParameters:\n{\n \"query\" : \"SELECT segments.program, segments.offer_id, metrics.impressions,\n metrics.clicks, metrics.ctr\n FROM MerchantPerformanceView\n WHERE segments.date BETWEEN '2020-11-01' AND '2020-11-30'\"\n}\n```"]]