با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
به منظور مدیریت مجموعههای نتایج حاوی تعداد زیادی ردیف، Merchant Center Query Language از صفحهبندی پشتیبانی میکند. دو پارامتر برای کنترل صفحه بندی در بدنه درخواست reports.search موجود است: page_size و page_token ، علاوه بر یک فیلد خروجی در بدنه پاسخ : next_page_token .
پارامتر page_size حداکثر تعداد سطرهایی را برای بازیابی در یک درخواست مشخص می کند. اگر مشخص نباشد، به طور خودکار روی حداکثر اندازه صفحه 1000 ردیف تنظیم می شود.
پارامتر page_token توکن صفحه را که باید برگردانده شود را مشخص می کند. اگر مشخص نشده باشد، صفحه اول برگردانده می شود. برای بازیابی صفحه بعدی، مقدار دریافت شده به عنوان next_page_token از تماس های قبلی reports.search باید به عنوان page_token ارائه شود. هنگامی که یک page_token ارائه میشود، تمام پارامترهای دیگر در تماس باید با تماس قبلی که page_token برمیگرداند مطابقت داشته باشد تا از رفتار غیرمنتظره جلوگیری شود.
برای این پرس و جو، فرض کنید حساب شامل 100000 offer_ids و page_size روی 200 تنظیم شده است. سپس مجموعه نتیجه شامل 200 شی ReportRow در اولین پاسخ همراه با next_page_token خواهد بود.
برای بازیابی 200 ردیف بعدی، درخواست را دوباره با همان اندازه صفحه ارسال کنید، اما page_token درخواست را به next_page_token پاسخ قبلی بهروزرسانی کنید.
در اینجا یک مثال بدنه پاسخ آمده است (پنج نتیجه اول به اضافه next_page_token ):
تاریخ آخرین بهروزرسانی 2025-08-13 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 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\u003eMerchant Center Query Language supports pagination to handle large result sets using \u003ccode\u003epage_size\u003c/code\u003e and \u003ccode\u003epage_token\u003c/code\u003e parameters.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003epage_size\u003c/code\u003e parameter controls the maximum number of rows returned per request, defaulting to 1000.\u003c/p\u003e\n"],["\u003cp\u003eTo retrieve subsequent pages of data, use the \u003ccode\u003enext_page_token\u003c/code\u003e from the previous response as the \u003ccode\u003epage_token\u003c/code\u003e in the next request.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003enext_page_token\u003c/code\u003e will not be included in the response containing the final batch of rows.\u003c/p\u003e\n"]]],["The Merchant API beta is introduced as the new version of the Content API for Shopping. Pagination in Merchant Center Query Language uses `page_size` (maximum 1000 rows) and `page_token` to handle large result sets. `page_size` defines the number of rows per request, and `page_token` specifies which page to return. Subsequent pages are fetched by using the previous response's `next_page_token`. The absence of `next_page_token` indicates the last page.\n"],null,["# Paginate query results\n\nIn order to handle result sets containing a large number of rows, Merchant\nCenter Query Language supports pagination. Two parameters are available to\ncontrol pagination in the [`reports.search` request\nbody](/shopping-content/reference/rest/v2.1/reports/search#request-body):\n`page_size` and `page_token`, in addition to one output field in the [response\nbody](/shopping-content/reference/rest/v2.1/reports/search#response-body):\n`next_page_token`.\n\nThe `page_size` parameter specifies the maximum number of rows to retrieve in a\nsingle request. If unspecified, it is automatically set to the maximum page size\nof 1000 rows.\n\nThe `page_token` parameter specifies the token of the page to return. If\nunspecified, the first page is returned. To retrieve a subsequent page, the\nvalue received as the `next_page_token` from the previous `reports.search` call\nshould be provided as a `page_token`. When a `page_token` is provided, all other\nparameters in the call should match the previous call that returned the\n`page_token` to avoid unexpected behavior.\n\nExample: \n\n SELECT\n segments.offer_id,\n metrics.impressions,\n metrics.clicks,\n metrics.ctr\n FROM MerchantPerformanceView\n WHERE segments.date BETWEEN '2021-12-01' AND '2021-12-31'\n\nFor this query, assume the account contains 100,000 `offer_ids` and the\n`page_size` is set to 200. The result set will then contain 200 `ReportRow`\nobjects in the first response, along with a `next_page_token`.\n\nTo retrieve the next 200 rows, send the request again with the same page size,\nbut update the request's `page_token` to the previous response's\n`next_page_token`.\n\nHere is a response body example (the first five results plus the\n`next_page_token`): \n\n {\n \"results\": [\n {\n \"segments\": {\n \"offerId\": \"12345\"\n },\n \"metrics\": {\n \"clicks\": \"0\",\n \"impressions\": \"59\",\n \"ctr\": 0\n }\n },\n {\n \"segments\": {\n \"offerId\": \"12346\"\n },\n \"metrics\": {\n \"clicks\": \"9625\",\n \"impressions\": \"276695\",\n \"ctr\": 0.034785594246372356\n }\n },\n {\n \"segments\": {\n \"offerId\": \"12347\"\n },\n \"metrics\": {\n \"clicks\": \"148\",\n \"impressions\": \"22045\",\n \"ctr\": 0.0067135404853708325\n }\n },\n {\n \"segments\": {\n \"offerId\": \"12348\"\n },\n \"metrics\": {\n \"clicks\": \"11\",\n \"impressions\": \"1100\",\n \"ctr\": 0.01\n }\n },\n {\n \"segments\": {\n \"offerId\": \"12349\"\n },\n \"metrics\": {\n \"clicks\": \"569\",\n \"impressions\": \"62977\",\n \"ctr\": 0.0090350445400701838\n }\n },\n ...\n ],\n \"nextPageToken\": \"CMgB\"\n }\n\n| **Key Point:** The `next_page_token` is not populated in the response that contains the last batch of rows."]]