קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
GoogleAdsService.Search תומך בהחלפת דפים בגודל דף קבוע של 10,000 שורות. קבוצת התוצאות של השאילתה מחולקת לכמה תגובות, שכל אחת מהן מכילה 10,000 אובייקטים.
אם החשבון מכיל 50,000 מילות מפתח, קבוצת התוצאות תכיל 10,000 אובייקטים של GoogleAdsRow בתשובה הראשונה, יחד עם next_page_token.
כדי לאחזר את 10,000 השורות הבאות, שולחים את הבקשה שוב, אבל מעדכנים את page_token של הבקשה ל-next_page_token של התגובה.
הערה: הערך של next_page_token לא מאוכלס בתגובה שמכילה את קבוצת השורות האחרונה.
ספריות הלקוח שלנו מטפלות באופן אוטומטי בחלוקה לדפים. צריך רק לבצע איטרציה בשורות של התגובה. אחרי שכל השורות בדף הנוכחי מוחזרות, ספריית הלקוח מאחזרת באופן אוטומטי דף חדש של שורות בשמכם עד שכל מערך הנתונים מאוחזר. אם משתמשים ב-REST במקום ב-gRPC, צריך לשלוח בקשה מפורשת לכל דף חדש.
מערכת Google Ads API שומרת במטמון באופן פנימי את כל מערך הנתונים, כך שהבקשות הבאות מהירות יותר מהבקשה הראשונית.
כדי להשתמש בנתונים שבמטמון, השאילתה צריכה להיות זהה בדיוק בבקשות הבאות. הבקשות לא ינוכו מהמכסה, במיוחד אם מדובר ברמת גישה בסיסית. אם השאילתה שונה ונשלחת עם אותו טוקן של הדף, מוחזרת שגיאה.
[[["התוכן קל להבנה","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-09-05 (שעון UTC)."],[[["\u003cp\u003e\u003ccode\u003eGoogleAdsService.Search\u003c/code\u003e returns data in fixed pages of 10,000 rows, requiring multiple requests to retrieve larger datasets.\u003c/p\u003e\n"],["\u003cp\u003eTo retrieve subsequent pages, use the \u003ccode\u003enext_page_token\u003c/code\u003e from the previous response in your next request's \u003ccode\u003epage_token\u003c/code\u003e field.\u003c/p\u003e\n"],["\u003cp\u003eClient libraries automate paging, but when using REST, you must manually request each page.\u003c/p\u003e\n"],["\u003cp\u003eThe Google Ads API caches the entire dataset, making subsequent requests with the same query faster and not counted towards quota.\u003c/p\u003e\n"],["\u003cp\u003eFor custom pagination scenarios, it's recommended to retrieve and store results locally, implementing your own pagination logic.\u003c/p\u003e\n"]]],[],null,["# Paging through results\n\n| **Note:** The `page_size` field was removed in v19 of the Google Ads API. See the [announcement](https://ads-developers.googleblog.com/2024/07/upcoming-changes-to-page-size-in-google.html). The `page_size` field has a default value of 10,000. Don't attempt to set the `page_size` value, as that will throw an error.\n\n[`GoogleAdsService.Search`](/google-ads/api/reference/rpc/v21/GoogleAdsService/Search) supports\npaging in fixed page sizes of 10,000 rows. The result set of the query is split\ninto multiple responses, each of which 10,000 objects.\n\nAs an example, consider the following query: \n\n SELECT\n ad_group.id,\n ad_group_criterion.type,\n ad_group_criterion.criterion_id,\n ad_group_criterion.keyword.text,\n ad_group_criterion.keyword.match_type\n FROM ad_group_criterion\n WHERE ad_group_criterion.type = KEYWORD\n\nIf your account contains 50,000 keywords, the result set will contain 10,000\n[`GoogleAdsRow`](/google-ads/api/reference/rpc/v21/GoogleAdsRow) objects in the first response,\nalong with a\n[`next_page_token`](/google-ads/api/reference/rpc/v21/SearchGoogleAdsResponse#next_page_token).\n\nTo retrieve the next 10,000 rows, send the request again, but update the\nrequest's `page_token` to the response's\n[`next_page_token`](/google-ads/api/reference/rpc/v21/SearchGoogleAdsResponse#next_page_token).\nNote that\n[`next_page_token`](/google-ads/api/reference/rpc/v21/SearchGoogleAdsResponse#next_page_token)\nis not populated in the response that contains the last batch of rows.\n\nOur client libraries handle paging automatically. You only have to iterate\nthrough the rows of the response. When all rows in the current page have\nbeen returned, the client library fetches a new page of rows automatically on\nyour behalf until the entire dataset is retrieved. If using REST instead\nof gRPC, you must explicitly make a request for each new page.\n\nThe Google Ads API internally caches the entire dataset, so subsequent requests are\nfaster than the initial one.\n\nYour query must remain exactly the same in subsequent requests to take advantage\nof the cached data. The requests won't contribute towards your quota,\nparticularly for [Basic Access level](/google-ads/api/docs/access-levels#basic_access). If\nthe query differs and is sent along with the same page token, an error is\nreturned.\n| **Key Point:** If you need manual paging, such as for custom web pagination, we recommend that you retrieve and store the results locally, such as in a database, and build your own pagination logic."]]