BuildE2EBuildE2E
DocsStart Free
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/sequence
Execute a multi-step browser workflow on a single page. Each scrape step acts as a breakpoint that captures the current page content.

Request Body

ParameterTypeDescription
startUrlrequired
stringStarting 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
booleanExtract metadata at each breakpoint

Example Request

curl -X POST https://api.builde2e.com/api/v1/scrape/sequence \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer uc-YOUR-API-KEY' \
  -d '{
    "startUrl": "https://www.google.com/search?q=test",
    "steps": [
      { "type": "scrape" },
      { "type": "click", "selector": "#pnnext" },
      { "type": "wait", "milliseconds": 2000 },
      { "type": "scrape" }
    ],
    "type": "markdown"
  }'

Example Response

json
{
  "success": true,
  "data": [
    {
      "url": "https://www.google.com/search?q=test",
      "markdown": "# Search Results\nPage 1 results...",
      "stepIndex": 0
    },
    {
      "url": "https://www.google.com/search?q=test&start=10",
      "markdown": "# Search Results\nPage 2 results...",
      "stepIndex": 3
    }
  ],
  "totalBreakpoints": 2,
  "completedBreakpoints": 2,
  "method": "browser",
  "totalTimeMs": 8450,
  "timestamp": "2026-03-04T10:15:38.623Z",
  "cost": 0.002
}

Step Types

Steps are executed in order. Use scrape steps as breakpoints to capture page content at any point during the workflow.
ParameterTypeDescription
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.
curl -X POST https://api.builde2e.com/api/v1/scrape/sequence \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer uc-YOUR-API-KEY' \
  -d '{
    "startUrl": "https://example.com/login",
    "steps": [
      { "type": "type", "selector": "#email", "text": "[email protected]" },
      { "type": "type", "selector": "#password", "text": "secret" },
      { "type": "click", "selector": "button[type=submit]" },
      { "type": "wait", "milliseconds": 3000 },
      { "type": "scrape" }
    ],
    "type": "markdown"
  }'

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.
Node.js
// Async sequence
const job = await BuildE2E.asyncSequence({
  startUrl: 'https://example.com',
  steps: [
    { type: 'click', selector: '#load-more' },
    { type: 'wait', milliseconds: 2000 },
    { type: 'scrape' }
  ]
});

// Async sequence batch
const batchJob = await BuildE2E.asyncSequenceBatch({
  sequences: [
    {
      startUrl: 'https://example.com/page1',
      steps: [{ type: 'scrape' }]
    },
    {
      startUrl: 'https://example.com/page2',
      steps: [
        { type: 'click', selector: '.tab' },
        { type: 'wait', milliseconds: 1000 },
        { type: 'scrape' }
      ]
    }
  ],
  type: 'markdown'
});

Response Fields

FieldTypeDescription
successbooleanWhether the sequence completed successfully
dataSequenceBreakpointResult[]Results for each scrape breakpoint
data[].urlstringURL at the time of the breakpoint
data[].markdownstringExtracted content as markdown (if type="markdown")
data[].htmlstringRaw HTML content (if type="html")
data[].stepIndexnumberIndex of the scrape step in the steps array
data[].metadataobjectPage metadata (when extractMetadata is true)
data[].contentstringSummarized content (when summary query provided)
totalBreakpointsnumberTotal number of scrape steps in the sequence
completedBreakpointsnumberNumber of breakpoints successfully completed
method"browser" | "browser-stealth"Browser method used for execution
totalTimeMsnumberTotal execution time in milliseconds
errorstringError message if the sequence failed
failedAtStepIndexnumberIndex of the step where failure occurred
timestampstringISO timestamp when execution completed
costnumberCost 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.
OperationCost (USD)Description
Sequence (any method)$0.002/URLFlat rate per URL (~$2.00 per 1000)