---
title: "Start a web page scrape"
method: POST
path: "/v1/scrape"
tags: ["Scrape"]
---

# Start a web page scrape

`POST /v1/scrape`

## Request

- Base URL: `http://localhost:9998`
- URL: `http://localhost:9998/v1/scrape`
- Auth: HTTP bearer

Navigates to a URL in Chrome via CDP, waits for framework-aware readiness, and extracts content in up to 7 formats from a single page load. HTTPS only. Two-layer SSRF prevention on the URL and again on the page a redirect lands on (a private landing fails the job). Up to 3 jobs run at once and 20 more wait; each job fails as timed out after 90 seconds. Requires Chrome connection.

**Formats:** `markdown` (AX tree → structured markdown, default — best for AI consumption), `text` (HTML → plain text, fast), `readability` (cleaned HTML, noise stripped), `axTree` (raw accessibility tree), `html` (raw page HTML), `links` (extracted links with anchor text and context), `screenshot` (base64 PNG).

## Request body

- object
  - `url` string, required: HTTPS URL to scrape
  - `formats` string[]: Output formats (default [markdown])
  - `waitForSelector` string: PiperSelector to wait for before extracting
  - `waitMs` integer: Additional milliseconds to wait after page load (max 10000)
  - `executeScript` string: JavaScript to run before extraction
  - `focus` string: For the AX-tree formats, only the subtree this selector names (e.g. role:main)
  - `maxChars` integer: For the AX-tree formats, the pruned tree's character budget

## Response `202`

Scrape job started

- ScrapeJob
  - `id` string, required
  - `url` string, required
  - `status` 'running' | 'completed' | 'failed', required
  - `error` string, nullable
  - `result` object, nullable
    - `markdown` string
    - `text` string
    - `readability` string
    - `axTree` string
    - `html` string
    - `links` object[]
      - `text` string
      - `url` string
      - `context` string
    - `screenshot` string: Base64 PNG
    - `components` object: Component tree from virtual DOM
    - `metadata` object
      - `title` string
      - `description` string
      - `canonicalUrl` string
      - `language` string
    - `resolvedUrl` string
    - `httpStatus` integer
    - `durationMs` integer
    - `readiness` object
      - `framework` string
      - `tier` integer
      - `readyAtMs` integer
      - `timedOut` boolean
  - `createdAt` string, date-time, required

## Other responses

- `400`: Invalid request
- `429`: Too many concurrent requests
- `503`: Chrome not connected

---

[API](https://skmtc.dev/modelpiper/apis/toolpiper-api.md) · [All operations](https://skmtc.dev/modelpiper/apis/toolpiper-api/llms.txt) · [OpenAPI document](https://skmtc.dev/modelpiper/apis/toolpiper-api/revisions/6722bf56385c?raw)
