ScrapingSequence
Sequence Endpoint
Sequence
Execute multi-step browser workflows on a single page. Supports pagination, login flows, and complex interactions with content capture at scrape breakpoints.
POST
/v1/scrape/sequenceExecute a multi-step browser workflow on a single page. Each
scrape step acts as a breakpoint that captures the current page content.Request Body
| Parameter | Type | Description |
|---|---|---|
startUrlrequired | string | Starting URL to navigate to |
stepsrequired | SequenceStep[] | Ordered steps: actions + scrape breakpoints. Must contain at least 1 step. |
type | "markdown" | "html" | Output format at each breakpoint. Defaults to "markdown" |
summary | { query: string } | Summarization applied to each breakpoint |
proxy | { country: string } | Proxy configuration. See supported countries |
extractMetadata | boolean | Extract metadata at each breakpoint |
Example Request
Example Response
Step Types
Steps are executed in order. Use
scrape steps as breakpoints to capture page content at any point during the workflow.| Parameter | Type | Description |
|---|---|---|
scrape | { type: "scrape" } | Capture page content (breakpoint) |
click | { type: "click", selector: string } | Click an element matching CSS selector |
type | { type: "type", selector: string, text: string } | Type text into an input element |
wait | { type: "wait", milliseconds: number } | Wait for specified duration (ms) |
press | { type: "press", key: string } | Press keyboard key (Enter, Tab, etc.) |
scroll | { type: "scroll", direction?: "up" | "down", selector?: string } | Scroll page or element (direction: up/down) |
waitForSelector | { type: "waitForSelector", selector: string, timeout?: number } | Wait for element to appear |
navigate | { type: "navigate", url: string } | Navigate to different URL |
goBack | { type: "goBack" } | Navigate back to previous page |
Login Flow Example
A common use case is logging into a site and scraping authenticated content. Combine type, click, and wait steps to fill forms and navigate through login flows.
Async Variants
For long-running sequences or batch execution, use async variants. Submit the job and poll for results, or use
waitForJob() to wait for completion.Response Fields
| Field | Type | Description |
|---|---|---|
success | boolean | Whether the sequence completed successfully |
data | SequenceBreakpointResult[] | Results for each scrape breakpoint |
data[].url | string | URL at the time of the breakpoint |
data[].markdown | string | Extracted content as markdown (if type="markdown") |
data[].html | string | Raw HTML content (if type="html") |
data[].stepIndex | number | Index of the scrape step in the steps array |
data[].metadata | object | Page metadata (when extractMetadata is true) |
data[].content | string | Summarized content (when summary query provided) |
totalBreakpoints | number | Total number of scrape steps in the sequence |
completedBreakpoints | number | Number of breakpoints successfully completed |
method | "browser" | "browser-stealth" | Browser method used for execution |
totalTimeMs | number | Total execution time in milliseconds |
error | string | Error message if the sequence failed |
failedAtStepIndex | number | Index of the step where failure occurred |
timestamp | string | ISO timestamp when execution completed |
cost | number | Cost of the request in USD |
Pricing
Flat per-URL pricing. The API automatically selects the best browser method, and the cost is returned in each response.
| Operation | Cost (USD) | Description |
|---|---|---|
| Sequence (any method) | $0.002/URL | Flat rate per URL (~$2.00 per 1000) |