---
title: "Query a page with pagination"
method: POST
path: "/v1/sessions/{sessionId}/windows/{windowId}/paginated-extraction"
tags: ["windows"]
---

# Query a page with pagination

`POST /v1/sessions/{sessionId}/windows/{windowId}/paginated-extraction`

Submit a prompt that queries the content of a specific browser window and paginates through pages to return a list of results.

## Path parameters

- `sessionId` string, required
- `windowId` string, required

## Headers

- `Authorization` string, required

## Request body

- object
  - `clientRequestId` string
  - `configuration` TypePaginatedExtractionConfig
    - `experimental` TypePaginatedExtractionExperimentalConfig
      - `scrollWithin` string — A natural language description of the scrollable area on the web page. This identifies the container or region that should be scrolled to access pagination controls. If missing, the entire page will be scrolled. You can also describe a visible reference point inside the container.
    - `interactionMode` string — The mode to use for interaction. If set to 'auto', Airtop AI will automatically choose the most cost-effective interaction mode. If set to 'accurate', the request might be slower, but more likely to be accurate. Whereas, 'cost-efficient' will be cheaper and speed things up, but may reduce accuracy.
    - `outputSchema` string — JSON schema defining the structure of the output. If not provided, the format of the output might vary.
    - `paginationMode` string — The mode to use for pagination. If set to 'auto', Airtop AI will automatically look for pagination links first and then attempt infinite scrolling to load more content. If set to 'paginated', Airtop AI will follow pagination links to load more content. If set to 'infinite-scroll', Airtop AI will scroll the page to load more content.
    - `scrape` TypeScrapeConfig
      - `optimizeUrls` string — URL optimization helps improve performance during model analysis, but limits the model's ability to analyze internal details of URLs (such as individual URL parameters). This setting does not affect the ability to extract URLs or links from web pages -- those will work regardless of how this option is set. However, if you need to analyze URLs themselves and are not getting satisfactory results, try setting this option to 'disabled'. If set to 'auto', Airtop AI will automatically determine whether to apply URL optimization. If 'enabled', URLs will always be optimized to improve performance. If 'disabled', URLs will not be optimized.
  - `costThresholdCredits` integer — A credit threshold that, once exceeded, will cause the operation to be cancelled. Note that this is *not* a hard limit, but a threshold that is checked periodically during the course of fulfilling the request. A default threshold is used if not specified, but you can use this option to increase or decrease as needed. Set to 0 to disable this feature entirely (not recommended).
  - `prompt` string, required — A prompt providing the Airtop AI model with additional direction or constraints about the page and the details you want to extract from the page.
  - `timeThresholdSeconds` integer — A time threshold in seconds that, once exceeded, will cause the operation to be cancelled. Note that this is *not* a hard limit, but a threshold that is checked periodically during the course of fulfilling the request. A default threshold is used if not specified, but you can use this option to increase or decrease as needed. Set to 0 to disable this feature entirely (not recommended). This setting does not extend the maximum session duration provided at the time of session creation.

## Response `201`

Created

- TypeAiPromptResponse
  - `data` TypeAiResponseEnvelope, required
    - `modelResponse` string, required
  - `errors` TypeIssue[]
    - `code` string — Issue code.
    - `details` object — Any associated details.
    - `message` string, required — Message describing the issue.
    - `reason` string — Underlying reason for the issue.
  - `meta` TypeExternalSessionAiResponseMetadata, required
    - `clientProvided` TypeClientProvidedResponseMetadata
      - `clientRequestId` string
    - `requestId` string
    - `screenshots` TypeScreenshotMetadata[] — Array containing any requested screenshots from the operation.
      - `dataUrl` string — Base64 encoded data URL of screenshot image data
      - `fileId` string — Unique identifier for the uploaded file
      - `fileName` string — Name of the screenshot file
      - `format` 'base64' | 'url' — Format of the screenshot data
      - `scrollPosition` TypeScreenshotScrollPosition
        - `left` integer, required — Horizontal scroll position in pixels
        - `top` integer, required — Vertical scroll position in pixels
      - `signedDownloadUrl` string — Signed URL for downloading the screenshot (when format is 'url')
      - `urlExpiry` string — Expiration time for the signed URL in ISO format
      - `viewportDimensions` TypeScreenshotViewportDimensions
        - `height` integer, required — Height of the viewport in pixels
        - `width` integer, required — Width of the viewport in pixels
    - `status` 'success' | 'partial' | 'failure', required — Outcome of the operation.
    - `usage` TypeExternalSessionAiResponseMetadataUsage, required
      - `credits` integer, required — The credit usage for this request
      - `id` string, required — The id of the request
  - `warnings` TypeIssue[]
    - `code` string — Issue code.
    - `details` object — Any associated details.
    - `message` string, required — Message describing the issue.
    - `reason` string — Underlying reason for the issue.

---

[API](https://skmtc.net/airtop/apis/airtop-api.md) · [All operations](https://skmtc.net/airtop/apis/airtop-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/airtop/airtop-api/versions/77d6e0f03453/schema)
