SE Home
Help
  • Documentation
  • Help centre
SEScrape Engine

Getting started

DocumentationQuickstartAuthenticationPlayground

Extracting data

Selecting valuesTransformsLists & tablesPage dataAI extractionMCP server

Fetching pages

Custom requestsTimeouts & redirectsCachingAutomatic retriesFallback strategies

Browsers & actions

BrowsersActionsRecipesScreenshots & PDFStored files

Getting past blocks

Anti-bot protectionCaptchasProxiesFingerprintsSessions

Workflows

Multi-step requestsVariablesPaginationBatchCrawlingTemplatesSchedules & monitoringAsync jobs & webhooksExport to S3, Sheets, databases & webhooks

Account & billing

CreditsSecretsPlansLimitsLogs & request idsNotificationsAccountAffiliate programmeHelp centre

Reference

POST /scrapeGET /sessions/:idGET /browsersGET /proxies/countriesGET /healthErrors
Documentation

Getting started

DocumentationQuickstartAuthenticationPlayground

Extracting data

Selecting valuesTransformsLists & tablesPage dataAI extractionMCP server

Fetching pages

Custom requestsTimeouts & redirectsCachingAutomatic retriesFallback strategies

Browsers & actions

BrowsersActionsRecipesScreenshots & PDFStored files

Getting past blocks

Anti-bot protectionCaptchasProxiesFingerprintsSessions

Workflows

Multi-step requestsVariablesPaginationBatchCrawlingTemplatesSchedules & monitoringAsync jobs & webhooksExport to S3, Sheets, databases & webhooks

Account & billing

CreditsSecretsPlansLimitsLogs & request idsNotificationsAccountAffiliate programmeHelp centre

Reference

POST /scrapeGET /sessions/:idGET /browsersGET /proxies/countriesGET /healthErrors

Pagination

Follow a site's next links, merge the lists, and serve pages of any list, on any request.

options.pagination works on any /scrape. It can read several pages of a site, serve one page of a long list, or both.

{
  "target_url": "https://example.com/products",
  "fields": { "products": { "selector": ".product", "items": { "name": "h2" } } },
  "options": { "pagination": { "next": "ai", "max_pages": 10, "page": 2, "per_page": 50 } }
}
PropertyTypeDefaultDescription
nexttrue, "ai" or a CSS selectornoneHow to find the next link. Without it, only the first page is read
max_pagesinteger5Site pages read at most, 1 to 50, within your plan
liststringthe longestThe list field page and per_page apply to
pageinteger1Which page of the list to return
per_pageintegerthe whole listItems per page, up to 1000

Finding the next link

  • A CSS selector: the link to follow.
  • true: the usual patterns (rel="next", "next" labels and classes).
  • "ai": the AI writes a selector on the first page. It's remembered for that site, like AI fields, so later requests don't call the model, and rewritten if it breaks. Billed as AI only when the model runs.

List fields of every page are merged; other fields come from the first page. Each site page read is billed as a page.

The answer

"pagination": { "field": "products", "page": 2, "per_page": 50, "pages": 4, "total": 180, "has_next": true, "fetched": 10, "next_url": "https://example.com/products?p=11" }

fetched is the number of site pages read. next_url is set when max_pages stopped before the end: start a request there to continue. If a later page fails, what was read is returned with a warning.

For a whole site, see Crawling.

On this page

  • Finding the next link
  • The answer