Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Untuk menangani kumpulan hasil yang berisi sejumlah besar baris, Bahasa Kueri Merchant Center mendukung penomoran halaman. Dua parameter tersedia untuk mengontrol penomoran halaman di isi permintaan reports.search:
page_size dan page_token, selain satu kolom output di isi respons :
next_page_token.
Parameter page_size menentukan jumlah maksimum baris yang akan diambil dalam
satu permintaan. Jika tidak ditentukan, nilai ini akan otomatis ditetapkan ke ukuran halaman maksimum
sebanyak 1.000 baris.
Parameter page_token menentukan token halaman yang akan ditampilkan. Jika
tidak ditentukan, halaman pertama akan ditampilkan. Untuk mengambil halaman berikutnya, nilai yang diterima sebagai next_page_token dari panggilan reports.search sebelumnya harus diberikan sebagai page_token. Jika page_token diberikan, semua parameter lain dalam panggilan harus cocok dengan panggilan sebelumnya yang menampilkan page_token untuk menghindari perilaku yang tidak terduga.
Untuk kueri ini, asumsikan akun berisi 100.000 offer_ids dan
page_size disetel ke 200. Kumpulan hasil kemudian akan berisi 200 objek ReportRow
dalam respons pertama, beserta next_page_token.
Untuk mengambil 200 baris berikutnya, kirim permintaan lagi dengan ukuran halaman yang sama, tetapi perbarui page_token permintaan ke next_page_token respons sebelumnya.
Berikut adalah contoh isi respons (lima hasil pertama ditambah
next_page_token):
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Informasi yang saya butuhkan tidak ada","missingTheInformationINeed","thumb-down"],["Terlalu rumit/langkahnya terlalu banyak","tooComplicatedTooManySteps","thumb-down"],["Sudah usang","outOfDate","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Masalah kode / contoh","samplesCodeIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-08-13 UTC."],[[["\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."]]