با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
گزارش API
Reporting API به تاجر اجازه میدهد تا با دادههای عملکرد خود بهصورت برنامهنویسی از طریق زبان پرسوجوی Merchant Center درگیر شود. این شبیه به توانایی ایجاد گزارش های سفارشی به طور مستقیم در Merchant Center است. گزارش API دارای مزایای زیر است:
به تاجران بزرگ اجازه میدهد دادههای عملکرد فهرستهای محصولات را به سیستمهای گزارشدهی داخلی یا شخص ثالث خود وارد کنند.
به کاربران، شرکای شخص ثالث و جمعآورندگانی که حسابهای Merchant Center را مدیریت میکنند، اجازه میدهد به گزارش دسترسی داشته باشند.
کاربران API میتوانند مشخص کنند که کدام دادههای عملکردی را میخواهند در پاسخ تماس جستجو بازیابی کنند، مانند:
معیارهایی که باید برگردانده شوند (به عنوان مثال: کلیکها، نمایشها)
ابعادی که در آن داده ها تقسیم می شوند (به عنوان مثال: OfferId، Date)
شرایطی که باید رعایت شوند (به عنوان مثال: کلیک > 100)
زبان جستجوی Reporting API میتواند با استفاده از روش Search ، از Content API برای خرید برای معیارهای عملکرد (کلیکها، نمایشها)، که احتمالاً بر اساس ابعاد مختلف (ویژگیهای رویداد گزارششده مانند برنامه و تاریخ، و ویژگیهای محصول مانند نام تجاری، دسته و غیره) تقسیمبندی شده است، Reports .
نتیجه یک پرس و جو به سرویس Reports فهرستی از نمونه های ReportRow است که هر ReportRow مقادیر معیارهای درخواستی برای بخش هایی را که در جستار خود مشخص کرده اید نشان می دهد. اگر هیچ بخش مشخص نشده باشد، یک ردیف با معیارهای جمعآوری شده در همه بخشها برگردانده میشود. در غیر این صورت، اگر هر بخش در کنار معیارها درخواست شود، پاسخ یک ردیف را برای هر تاپل بخش منحصر به فرد نشان می دهد. انتخاب چندین بخش و چندین معیار در یک پرس و جو امکان پذیر است.
پرس و جو برای معیارها
میتوانید معیارهایی (کلیکها، تأثیرگذاریها، CTR، و غیره) را که میخواهید برگردانید، جستجو کنید. برای پرس و جو از سرویس گزارش ها باید یک فیلتر در محدوده تاریخ اضافه کنید. پرس و جوی نمونه زیر یک ردیف را برمی گرداند: مقدار کل کلیک ها در شرایط اضافه شده یک محدوده تاریخ.
نمونه پاسخ کد JSON در زیر نشان میدهد که چگونه این تاجر 4440 کلیک در همه محصولات خود در همه مقصدهای خود بین 1 دسامبر 2020 و 21 دسامبر 2020 جمعآوری کرده است.
{"results":[{"metrics":{"clicks":"4,440"}}]}
پرس و جو برای بخش ها
در کنار معیارها، میتوانید بخشهایی را نیز جستوجو کنید، که میتواند ویژگی یک محصول ( offer_id ، brand ، category ، و غیره) یا ویژگی یک رویداد گزارششده ( date ، program ) باشد. یک رویداد گزارش شده یک برداشت یا کلیک برای یک محصول است.
بخش ها مشابه GROUP BY در SQL عمل می کنند. بخشها معیارهای انتخابی را تقسیم میکنند و بر اساس هر بخش در عبارت SELECT گروهبندی میشوند. جستجوی نمونه زیر، کلیکها را در هر روز برمیگرداند که بر اساس نزولی کلیکها در شرایط اضافه شده در محدوده تاریخ مرتب شدهاند. فقط ردیفهایی که حداقل یکی از معیارهای درخواستی غیرصفر باشد، برگردانده میشوند.
نمونه پاسخ کد JSON در زیر نشان میدهد که چگونه این تاجر 1546 کلیک روی همه محصولاتش در همه مقصدهایش در 1 دسامبر 2020 و 829 کلیک روی همه محصولاتش در همه مقصدهایشان در 2 دسامبر 2020 داشته است. هیچ شیئی برای 3 دسامبر 2020 بازگردانده نمیشود زیرا تاجر در آن روز هیچ کلیکی نداشت.
تاریخ آخرین بهروزرسانی 2025-08-13 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-08-13 بهوقت ساعت هماهنگ جهانی."],[[["\u003cp\u003eMerchant API is the new version of the Content API for Shopping and allows programmatic access to data.\u003c/p\u003e\n"],["\u003cp\u003eReporting API enables merchants to access performance data using Merchant Center Query Language, benefiting large merchants and third-party partners.\u003c/p\u003e\n"],["\u003cp\u003eAPI users can specify metrics, dimensions, and conditions for data retrieval within the \u003ccode\u003eSearch\u003c/code\u003e call.\u003c/p\u003e\n"],["\u003cp\u003eReporting API queries can be used to retrieve performance metrics and segments for analysis, however date filters are required.\u003c/p\u003e\n"],["\u003cp\u003eReturned data includes metrics aggregated by segments, with single-row responses when no segments are specified.\u003c/p\u003e\n"]]],["The Merchant API's Reporting API allows users to programmatically access performance data via the Merchant Center Query Language. Users specify desired metrics (e.g., clicks, impressions) and dimensions (e.g., date, offer ID) in queries. A date range filter is mandatory. Results are returned as `ReportRow` instances, showing metrics segmented as requested. If no segments are specified one row of metrics will be returned. Multiple segments and metrics can be requested together, but all wildcards will return an error.\n"],null,["Reporting API\n-------------\n\nThe Reporting API lets a merchant engage with their performance data\nprogrammatically through the Merchant Center Query Language. This is similar to\nthe ability to\n[create custom reports](//support.google.com/merchants/answer/9967959)\ndirectly in Merchant Center. The Reporting API has the following benefits:\n\n- Lets large merchants import performance data for product listings into their internal or third-party reporting systems.\n- Lets users, third-party partners, and aggregators who manage Merchant Center accounts access reporting.\n\nAPI users can specify which performance data they would like to retrieve in the\nSearch call response, such as:\n\n- Metrics to be returned (for example: Clicks, Impressions)\n- Dimensions in which to segment the data (for example: OfferId, Date)\n- Conditions which need to be met (for example: Clicks \\\u003e 100)\n\nThe Reporting API query language can query the Content API for Shopping for\nperformance metrics (clicks, impressions), possibly segmented by various\ndimensions (reported event attributes like program and date, and product\nattributes like brand, category, etc.), using the `Search` method on the\n`Reports` service.\n\nThe result from a query to the `Reports` service is a list of `ReportRow`\ninstances, with each `ReportRow` representing the values of requested metrics\nfor segments you specified in your query. If no segments are specified, a single\nrow is returned with metrics aggregated across all segments. Otherwise, if any\nsegments are requested alongside metrics, then the response shows one row for\neach unique segment tuple. It is possible to select multiple segments and\nmultiple metrics in a single query.\n| **Key Point:** If you have never advertised your products or shared them on free listings, you will have no associated metrics and be returned a results field that contains an empty array.\n\n### Query for metrics\n\nYou can query for metrics (Clicks, Impressions, CTR, etc.) that you want\nreturned. **You must add a filter on the date range to query the Reports\nservice.** The sample query below returns a single row: the aggregate amount\nof clicks within the added condition of a date range. \n\n SELECT metrics.clicks\n FROM MerchantPerformanceView\n WHERE segments.date BETWEEN '2020-12-01' AND '2020-12-21';\n\n| **Key Point:** You must be explicit about the data you want returned. Any wildcards (for example, `Select metrics.*`) will return an error.\n\n#### Sample response\n\nThe sample JSON code response below shows how this merchant has had 4,440 clicks\nsummed together across all their products across all their destinations between\nDecember 1st, 2020 and December 21st, 2020. \n\n {\"results\": [\n {\n \"metrics\": {\n \"clicks\": \"4,440\"\n }\n }\n ]}\n\n| **Key Point:** If you don't select any segments in your query, you will only be returned one row of metrics.\n\n### Query for segments\n\nAlongside metrics, you can also query for segments, which can be an attribute of\na product (`offer_id`, `brand`, `category`, etc.) or an attribute of a reported\nevent (`date`, `program`). A reported event is an impression or click for a\nproduct.\n\nSegments act similarly to a `GROUP BY` in SQL. Segments split the selected\nmetrics, grouping by each segment in the `SELECT` clause. The sample query below\nreturns clicks per day, ordered by clicks descending within the added condition\nof a date range. Only rows where at least one requested metric is non-zero will\nbe returned. \n\n SELECT\n segments.date,\n metrics.clicks\n FROM MerchantPerformanceView\n WHERE segments.date BETWEEN '2020-12-01' AND '2020-12-03'\n ORDER BY metrics.clicks DESC;\n\n#### Sample response\n\nThe sample JSON code response below shows how this merchant has had 1,546 clicks\nacross all their products across all their destinations on December 1st, 2020\nand 829 clicks across all their products across all their destinations on\nDecember 2nd, 2020. No object will be returned for December 3rd, 2020 since\nthe merchant had no clicks on that day. \n\n {\n \"results\": [\n {\n \"segments\": {\n \"date\": {\n \"year\": 2020,\n \"month\": 12,\n \"day\": 1\n }\n },\n \"metrics\": {\n \"clicks\": \"1546\"\n }\n },\n {\n \"segments\": {\n \"date\": {\n \"year\": 2020,\n \"month\": 12,\n \"day\": 2\n }\n },\n \"metrics\": {\n \"clicks\": \"829\"\n }\n }\n ]}\n\n| **Key Point:** Segments can only be selected if metrics are also selected. If you don't select any metrics in your query, you will be returned an error."]]