# Swerver Web Scraping API

> Swerver Web Scraping API is a paid API for AI agents from cheap-search--gw.swerver.net, paid per call via x402, $0.002/call, status unknown (last checked 2026-09-14).

Fetches any URL using a headless browser and returns the page content as clean HTML, Markdown, plain text, or extracted links, with optional JavaScript evaluation and stealth mode

## Facts

- Endpoint: POST https://cheap-search--gw.swerver.net/scrape
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/swerver-web-scraping-api-e8347e86
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_S5AKNpytZij42_Yf0Ce6m

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability swerver-web-scraping-api-e8347e86 -d '<json body>'
```

Example prompt: Can you fetch the page at https://example.com/article and give me the content as clean markdown? Wait 3 seconds after it loads in case there's delayed rendering, and cap the output at 10000 characters.

## When to prefer this

Use this endpoint when you need to fetch and render web pages that require JavaScript execution, dynamic content loading, or anti-bot evasion. It is ideal for scraping SPAs, extracting structured data via JS evaluation, or getting clean Markdown/text from articles without needing a separate API key. Prefer it over simple HTTP fetch tools when the target page relies on client-side rendering. The pay-per-request x402 model (no subscription) makes it suitable for low-volume or one-off scraping tasks.

## Known failure modes

- Page load timeout exceeded — response may be empty or partial content
- URL is unreachable or returns a non-200 status — content will be empty or error indicated
- JavaScript evaluation expression throws an error — content field may contain the error message
- CSS selector never appears on page — request may time out or return content without waiting
- Stealth mode insufficient for aggressive anti-bot systems — page may still block or return CAPTCHA
- Payment via x402 protocol fails or is rejected — request not processed
- Max length truncation silently cuts off content — truncated flag in metadata will be true

## How this service works

Headless browser API for web scraping. Fetch any URL and get back clean HTML, Markdown, plain text, or extracted links. Supports JavaScript evaluation, CSS selector targeting, stealth mode, and batch operations. Pay-per-request via x402 protocol (USDC on Base). No API key required.

## Output

Returns a JSON object with the requested URL, the output format used, and the full page content (or JS eval result) as a string. Also includes metadata: whether the content was truncated, the elapsed fetch time in milliseconds, and the original content length in bytes.

## Example request

```json
{
 "url": "https://example.com",
 "format": "markdown",
 "timeout": 10,
 "max_length": 5000
}
```

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "url"
 ],
 "properties": {
  "url": {
   "type": "string",
   "description": "The URL to scrape"
  },
  "wait": {
   "type": "integer",
   "description": "Extra seconds to wait after the page event fires. Useful for pages with delayed rendering."
  },
  "format": {
   "enum": [
    "html",
    "markdown",
    "text",
    "links"
   ],
   "type": "string",
   "description": "Output format for page content"
  },
  "stealth": {
   "type": "boolean",
   "description": "Enable anti-bot stealth mode. Randomizes browser fingerprint and blocks trackers."
  },
  "timeout": {
   "type": "integer",
   "description": "Page load timeout in seconds"
  },
  "evaluate": {
   "type": "string",
   "description": "JavaScript expression to evaluate on the page. When provided, the response content will contain the evaluation result instead of page content. Use for structured data extraction, e.g. 'JSON.stringify({title: document.title, links: [...document.querySelectorAll(\"a\")].map(a => a.href)})'"
  },
  "selector": {
   "type": "string",
   "description": "CSS selector to wait for before extracting content. Useful for SPAs where content loads dynamically."
  },
  "max_length": {
   "type": "integer",
   "description": "Maximum content length in characters. Content exceeding this limit is truncated. Use as a token budget control to keep responses within context window limits."
  },
  "user_agent": {
   "type": "string",
   "description": "Custom User-Agent string"
  },
  "wait_until": {
   "enum": [
    "load",
    "domcontentloaded",
    "networkidle0"
   ],
   "type": "string",
   "description": "Page lifecycle event to wait for. Use 'networkidle0' for JS-heavy pages."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "url": {
   "type": "string"
  },
  "format": {
   "type": "string"
  },
  "content": {
   "type": "string",
   "description": "Page content (or JS eval result if evaluate was provided)"
  },
  "metadata": {
   "type": "object",
   "properties": {
    "truncated": {
     "type": "boolean",
     "description": "Whether content was truncated by max_length"
    },
    "elapsed_ms": {
     "type": "integer",
     "description": "Time taken to fetch and render the page in milliseconds"
    },
    "content_length": {
     "type": "integer",
     "description": "Original content length in bytes before truncation"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/swerver-web-scraping-api-e8347e86/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from cheap-search--gw.swerver.net](https://www.zero.xyz/host/cheap-search--gw.swerver.net/llms.txt)
