# Web Page to RAG Chunks API (x402)

> Web Page to RAG Chunks API (x402) is a paid API for AI agents from freetier-agent-api.pages.dev, paid per call via x402, $0.0025/call, status unknown (last checked 2026-10-29).

Fetches a public web page, converts it to clean Markdown, and returns it as token-sized chunks ready for RAG ingestion — pay-per-call via x402 USDC on Base.

## Facts

- Endpoint: GET https://freetier-agent-api.pages.dev/api/page-rag?utm_source=zero.xyz
- Price: $0.0025/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-29
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/web-page-to-rag-chunks-api-x402-edd85b8c
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_iwMKQGiBzPoYZe6ETB2pL

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 web-page-to-rag-chunks-api-x402-edd85b8c
```

Example prompt: Fetch https://en.wikipedia.org/wiki/Retrieval-augmented_generation and break it into chunks of 800 tokens with 80-token overlap, extracting main content only, so I can load it into my vector store.

## When to prefer this

Choose this endpoint when you need to ingest live, arbitrary public web pages into a RAG pipeline without setting up your own scraping infrastructure. It is ideal for agents that must answer questions grounded in current web content, index third-party documentation, or process articles on demand. The pay-per-call x402 model (no API key or signup) makes it especially suitable for autonomous agents that need to spin up web access dynamically. Prefer alternatives if you need JavaScript-rendered SPAs, authenticated pages, or bulk crawling of entire sites.

## Known failure modes

- Page requires JavaScript to render — likelyNeedsJavaScript flag will be true and content may be incomplete
- URL is not publicly accessible or returns non-200 status — ok will be false with status code
- Page exceeds max_chars limit — content will be truncated with truncatedReason set
- robots.txt disallows fetching — request may be blocked
- Invalid or malformed URL — request fails with error
- x402 payment not completed — 402 response returned before content is served

## How this service works

Invoice-to-JSON, on-chain tools (transaction explainer + payment check, wallet profile, contract ABI, ERC-20 token risk), company contacts and web-to-RAG for AI agents. Pay per call with x402 (USDC on Base). No signup, no API key.

## Output

A JSON object containing: ok status, the final resolved URL, page title, language, canonical URL, full markdown text, an array of indexed text chunks (each with text, heading path, and token estimate), word count, total token estimate, content hash, fetch timestamp, extractor used, whether content was truncated and why, and whether the page likely requires JavaScript.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "url"
     ],
     "properties": {
      "url": {
       "type": "string",
       "description": "public http(s) page URL"
      },
      "overlap": {
       "type": "integer",
       "description": "chunk overlap in tokens (default 80)"
      },
      "main_only": {
       "enum": [
        "true",
        "false"
       ],
       "type": "string",
       "description": "main content only via Readability (default true)"
      },
      "max_chars": {
       "type": "integer",
       "description": "max Markdown characters (default 100000, max 400000)"
      },
      "chunk_tokens": {
       "type": "integer",
       "description": "chunk size in tokens (0 = no chunks, default 800, max 4000)"
      }
     }
    }
   }
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "ok": {
       "type": [
        "boolean",
        "null"
       ]
      },
      "url": {
       "type": [
        "string",
        "null"
       ]
      },
      "title": {
       "type": [
        "string",
        "null"
       ]
      },
      "chunks": {
       "type": "array",
       "items": {
        "type": [
         "object",
         "null"
        ]
       }
      },
      "status": {
       "type": [
        "number",
        "null"
       ]
      },
      "fetchMs": {
       "type": [
        "number",
        "null"
       ]
      },
      "sources": {
       "type": "array",
       "items": {
        "type": [
         "object",
         "null"
        ]
       }
      },
      "finalUrl": {
       "type": [
        "string",
        "null"
       ]
      },
      "language": {
       "type": [
        "string",
        "null"
       ]
      },
      "markdown": {
       "type": [
        "string",
        "null"
       ]
      },
      "siteName": {},
      "canonical": {
       "type": [
        "string",
        "null"
       ]
      },
      "extractor": {
       "type": [
        "strin
… (truncated)
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "ok": true,
  "url": "https://en.wikipedia.org/wiki/HTTP_402",
  "title": "List of HTTP status codes - Wikipedia",
  "chunks": [
   {
    "text": "# List of HTTP status codes - Wikipedia\n\nThis article lists standard and notable non-standard [HTTP response status codes](https://en.wikipedia.org/wiki/HTTP...",
    "index": 0,
    "headingPath": "List of HTTP status codes - Wikipedia",
    "tokenEstimate": 666
   },
   {
    "text": "The server has received the request headers and the client should proceed to send the request body (in the case of a request for which a body needs to be sen...",
    "index": 1,
    "headingPath": "List of HTTP status codes - Wikipedia > Standard codes > 1xx informational response",
    "tokenEstimate": 460
   }
  ],
  "status": 200,
  "fetchMs": 484,
  "sources": [
   {
    "url": "https://github.com/mozilla/readability",
    "name": "Live fetch of the page you name (plain HTTP, robots.txt respected); Mozilla Readability + Turndown (Apache-2.0 / MIT), linkedom (ISC)"
   }
  ],
  "finalUrl": "https://en.wikipedia.org/wiki/HTTP_402",
  "language": "en",
  "markdown": "# List of HTTP status codes - Wikipedia\n\nThis article lists standard and notable non-standard [HTTP response status codes](https://en.wikipedia.org/wiki/HTTP...",
  "siteName": null,
  "canonical": "https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#402",
  "extractor": "readability",
  "fetchedAt": "2026-10-24T18:11:05.434Z",
  "truncated": true,
  "wordCount": 6573,
  "modifiedAt": null,
  "contentHash": "sha256:7ad19acc51489e84fb2f495ed08b7ac0dc6a9e6f8635caefcc8cef78238a4c52",
  "contentType": "text/html",
  "description": null,
  "jsonLdTypes": [],
  "publishedAt": null,
  "tokenEstimate": 18376,
  "truncatedReason": "page HTML larger than 350000 bytes after removing scripts/styles; only the first part was converted",
  "likelyNeedsJavaScript": false
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/web-page-to-rag-chunks-api-x402-edd85b8c/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from freetier-agent-api.pages.dev](https://www.zero.xyz/host/freetier-agent-api.pages.dev/llms.txt)
