Fundamentals
Pagination
6min
pagination requesting paginated results across multiple pages is one of the most common use cases in serpwow\ for certain types of searches serpwow allows you to return data across multiple pages automatically you can request a single page per search, or have serpwow automatically retrieve data from multiple pages and concatenate the results into one response api credits and max page each successfully retrieved page incurs an api credit if the request yields fewer pages than specified, only credits for the actual number of returned pages are charged for example, for a request with max page=5 that only yields 3 pages (because only 3 pages are available), then only 3 api credits are charged single pages to request a single page of results you should use the page parameter for example, making a request with page=5 will return data from page 5 to find the total number of pages, and determine whether a next page is available, inspect the pagination object in the result json infinite scrolling pagination request types that implement infinite scrolling pagination use a next page token parameter to request the next page of results in these cases starting pagination from an explicit page number is not possible multiple pages serpwow provides the max page parameter to retrieve mutliple pages of results and concatenate them into one response automating workloads such as "get the first 5 pages of results, if they exist" when running a request with max page set, the main array property of the response contains a concatenation of the array values from all requested pages setting a max page when using max page serpwow will retrieve the number of pages (if available) specified in the max page parameter results from subsequent pages will be concatenated into the main array property of the response for example, the following request would yield data from pages 1, 2, 3, 4 and 5 max page=5 the main array property of a request made with max page will have the following properties added, making it easy to determine which physical page the current result came from property type description position number the position of the current result on the its page page number the page the current result is taken from position overall number the position of the current result within all requested pages set in the max page parameter example assuming 10 results per page and a request made with max page=2 the first result on page would be position overall=1 and the last result on page 2 would be position overall=20 setting the start page set the page to start the multiple page concatenation from by using the page and max page parameters together for example, the following request would yield data from pages 2, 3 & 4 page=2\&max page=4 limits when using max page set the page to start the multiple page concatenation from by using the page and max page parameters together for example, the following request would yield data from pages 2, 3 & 4 real time searches 5 you can set a maximum max page value of 5 when making real time searches note on output=html when using max page in combination with output=html the resultant html returned will consist of each page of html, delimited by a horizontal line break ( html tag) note on include html=true when using max page in combination with include html=true the html field is returned as an array containing the html of each returned page searches in batches 100 you can set a maximum max page value of 100 when adding searches to searches batch limits when using max page using max page on searches added to a batch limits the total number of searches that can be added see batch limits https //docs trajectdata com/scaleserp/batches api/limits for more information