# Swift Bot Labs HTML Extract

> Swift Bot Labs HTML Extract is a paid API for AI agents from x402-toolbox.swiftbotlab.workers.dev, paid per call via x402, $0.005/call, status unknown (last checked 2026-10-31).

Extracts clean text, Markdown, and links from raw HTML, optionally converting to readable format

## Facts

- Endpoint: POST https://x402-toolbox.swiftbotlab.workers.dev/v1/html/extract?utm_source=zero.xyz
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-31
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/swift-bot-labs-html-extract-86115ff7
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_JEmqko9PLyXAMNygwZxWr

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 swift-bot-labs-html-extract-86115ff7 -d '<json body>'
```

Example prompt: Take this raw HTML string and extract all the readable content as markdown, including any links, and limit the output to 50000 characters: <html>...</html>

## When to prefer this

Choose this endpoint when you have raw HTML content (already fetched) and need to convert it into clean, structured text or Markdown — especially for feeding into LLMs, extracting links, or processing scraped pages. It is ideal for agentic pipelines where a separate fetch step has already retrieved the HTML and now needs readability extraction without spinning up a headless browser. At $0.005 per call with no API key required, it suits lightweight pay-per-use workflows.

## Known failure modes

- HTML string exceeds 2MB maxLength limit — request rejected
- maxChars set below minimum of 500 — validation error
- Malformed or non-HTML input produces empty or minimal output
- Payment in USDC not completed via x402 protocol — 402 response returned
- Invalid enum value for mode or format fields — schema validation error

## How this service works

62 small, deterministic utility APIs (DNS and e-mail checks, web extraction, EVM decoding, x402 checks, IP math, JSON/CSV, hashing, conversions). No account or API key: pay per call in USDC with x402.

## Output

Returns a JSON object with ok:true, the tool name, and a result object containing: markdown-formatted content, plain text (depending on format mode), an array of links with href and text, the page title (if found), and a word count.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "html": {
   "type": "string",
   "maxLength": 2097152
  },
  "mode": {
   "enum": [
    "main",
    "all"
   ],
   "type": "string",
   "default": "all"
  },
  "format": {
   "enum": [
    "markdown",
    "text",
    "both"
   ],
   "type": "string",
   "default": "markdown"
  },
  "baseUrl": {
   "type": "string",
   "maxLength": 2048
  },
  "maxChars": {
   "type": "integer",
   "default": 40000,
   "maximum": 200000,
   "minimum": 500
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "ok": true,
  "tool": "html-extract",
  "result": {
   "links": [
    {
     "href": "https://example.com/docs",
     "text": "the docs"
    }
   ],
   "title": null,
   "words": 4,
   "markdown": "# Hi\n\nRead [the docs](https://example.com/docs)."
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/swift-bot-labs-html-extract-86115ff7/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402-toolbox.swiftbotlab.workers.dev](https://www.zero.xyz/host/x402-toolbox.swiftbotlab.workers.dev/llms.txt)
