# readfetch — read the web, per call

`https://readfetch.com` — a reading service for agents. No account, no API key: pay per call in USDC
over x402. Reading routes settle only when content is delivered; **`POST /v1/fetch`** when the
origin answers (including 4xx/5xx).

**Paid routes require a funded Base USDC wallet.** Use `readfetch-client` / `@readfetch/client`
or the MCP signing proxy (`@readfetch/mcp-x402-proxy`). Direct HTTP or MCP `tools/call` without
a signing client will stop at 402.

**Free start:** `POST /v1/probe` costs nothing (no wallet, no 402). Use it before paying for
anything else. MCP: **`readfetch_probe`** is the same route — no `EVM_PRIVATE_KEY` on the signing proxy.

## Pick by intent

Prices are in the next table, generated from the catalog — never trust a price you saw in
prose.

| You want | Call |
|---|---|
| the article on one URL | `POST /v1/text` |
| to know whether a page is worth reading | `POST /v1/probe` **FREE** (full text for the first 3 calls a day, then a ~400-char `preview`) |
| the links on a site | `POST /v1/map` |
| a page that only renders with JavaScript | `POST /v1/scrape` |
| a page that blocks datacentres | `POST /v1/scrape/residential` |
| the raw response, status included | `POST /v1/fetch` |
| many URLs in one call | `POST /v1/batch` |
| text out of a PDF | `POST /v1/pdf` |
| one section of a page | `POST /v1/section` |
| what changed between two fetches | `POST /v1/diff` |
| a picture of the page | `POST /v1/screenshot` |
| web search results | `POST /v1/search` |
| a whole site, a few pages deep | `POST /v1/crawl` |

Start cheap: `/v1/probe` is free — status, title, size, `challenge`, and when the page is HTML
without a bot wall the extracted text: the whole read for your first 3 calls a day, a **`preview`**
of ~400 characters after that. If it says
`challenge: true`, go to `/v1/scrape` (or `/v1/scrape/residential`), not `/v1/text`.

**Exit is not a JSON field.** Datacentre by default. Residential is only **`POST /v1/scrape/residential`**
(same body as `/v1/scrape`). The catalogue omits `egress`; unknown top-level keys are ignored.

## Every endpoint

| `/v1/text` | POST | $0.002 | Article text and metadata, boilerplate stripped. No browser by default; falls back to one when a page blocks plain HTTP. |
| `/v1/map` | POST | $0.002 | Sitemaps, robots rules, feeds and link counts for a whole site, in one call. Plan a crawl before paying for it. |
| `/v1/scrape` | POST | $0.005 | Chromium renders the page, runs interactions, and returns Markdown, text or HTML with its links. |
| `/v1/scrape/residential` | POST | $0.02 | Scrape through a residential address pool, for targets that refuse a datacentre address. Same contract as /v1/scrape, one attempt, priced for the bandwidth. |
| `/v1/fetch` | POST | $0.0015 | Raw HTTP through the same egress. JSON APIs, GraphQL, PDFs, byte ranges - anything that is not a page. |
| `/v1/batch` | POST | $0.0015/page | Read up to 50 HTML pages in one payment (same /v1/text extraction per URL). Results in input order; undelivered pages are credited, not billed. |
| `/v1/pdf` | POST | $0.005/document | Documents, not pages: page text plus one Markdown body, priced per document rather than per page. |
| `/v1/section` | POST | $0.003 | Read one heading or one selector instead of the whole page - ten to a hundred times fewer tokens. |
| `/v1/diff` | POST | $0.003 | Stateless change detection. Send the hash you hold, get back whether it changed and a bounded diff. |
| `/v1/screenshot` | POST | $0.003 | PNG or JPEG of a rendered page: viewport, full page, or one element via CSS selector. |
| `/v1/search` | POST | $0.005 | Web search without a search subscription, returning titles, URLs and snippets. |
| `/v1/crawl` | POST | $0.003/page | Bounded async crawl with a job id, a page cap quoted up front, and per-page Markdown. |
| `/v1/crawl/{id}` | GET | $0 | Poll a crawl job: status, completed page count, and per-page Markdown as they land. |
| `/v1/probe` | POST | free | FREE · metadata before spending, plus the full extracted text on the first 3 probes per IP per day (a ~400-character preview after that). |

Full request fields and examples: `https://readfetch.com/llms.txt`, `https://readfetch.com/openapi.json`.
The same endpoints are exposed as MCP tools at `https://readfetch.com/mcp` (see below).

## Paying

Official clients implement the loop (402 → sign → retry): `pip install readfetch-client`,
`npm install @readfetch/client`, or MCP via `npx @readfetch/mcp-x402-proxy@latest` with `EVM_PRIVATE_KEY`
([integrations](https://readfetch.com/integrations#clients)).

1. Call without payment. You get `402` plus a `PAYMENT-REQUIRED` header with an `accepts[]`
   quote. **The live quote on that response is authoritative** — static `accepts[]` in
   `/.well-known/x402-resources.json` are catalogue templates only.
2. Resend the same call with payment — **`readfetch-client` / `@readfetch/client` / the MCP proxy
   attach `PAYMENT-SIGNATURE` for you.** Bare HTTP or MCP `tools/call` without them stops at 402.
3. A paid response carries `PAYMENT-RESPONSE` (settlement, with `transaction`) and `RECEIPT`
   (our signed receipt, needed for claims) when `billed: true`.
4. **`billed: false`** means **not charged** on that route. On reading routes, read the **`hint`**.
   On **`POST /v1/fetch`**, bot-check pages and transport failures are unbilled — origin 4xx/5xx
   can still be **`billed: true`**.

In test mode (`payment.status: "test-mode"`) any non-empty `x-payment-proof` header passes and
nothing settles. Use that while building.

## Free vs paid routes

Paid routes answer 402 first. **`POST /v1/probe`** is free (rate-limited): metadata
plus the full extracted text on the first 3 probes per IP per day, a ~400-character
`preview` after that — not a daily quota on text/map.

## When a call fails

| Symptom | What it means | Next call |
|---|---|---|
| `billed: false` with `hint` on a reading route | not charged; the hint names the fix | follow the hint |
| `billed: true` on `/v1/fetch` with origin 4xx/5xx | transport succeeded — the HTTP answer is what you paid for | read `status_code` and body; not a text/scrape failure |
| `402` | payment required | sign `accepts[0]` and retry |
| `429` with `Retry-After` | rate limited | wait, then retry the same call |
| `502` / `503` | upstream or us, nothing charged | retry once; then `/v1/probe` |
| `challenge: true` in a 200 | a bot wall answered | `/v1/scrape`, then `/v1/scrape/residential` |
| `text` empty or nav-only | the page needs JavaScript | `/v1/scrape` |
| `used_browser: true` | the HTTP path was blocked and one render rescued it | nothing, it delivered |
| wrong language / geo | the exit is one region | accept `accept_language`, or use `advanced.locale` on `/v1/scrape` |
| a PDF answered as HTML | it is not a PDF | `/v1/pdf` only accepts `%PDF-` bodies |
| one page is too big | capped, `provenance.extraction.truncated: true` | ask for less: `/v1/section` |
| "already used" on a payment | nonce replay | sign a new authorization |
| truncated delivery you paid for | provable from the receipt | `POST /v1/claims` with reason `truncated` |
| confusing 402, MCP, or docs | integrator signal, not billing | `POST /v1/feedback` with `X-Request-Id`, or MCP `readfetch_feedback` |

Claims: send `{receipt, reason, address, signature}` where the signature is EIP-191 over
`sha256(receipt || rid)`. Only **`truncated`** is auto-approved. **`empty`** is rejected (422) —
probe before paying, or escalate to `/v1/scrape` when the hint says so. **`wrong_content`**
needs a human. A credit is a single-use `X-CREDIT` header worth one call.

## Feedback

- **Integration / docs / site** — `POST https://readfetch.com/v1/feedback` with `{request_id, category, message}`.
  `request_id` is the **`X-Request-Id`** header from the call you are reporting.
  Categories: `integration`, `docs`, `site`, `other`. MCP: **`readfetch_feedback`**.
- **Paid delivery** — `POST https://readfetch.com/v1/claims` with `{receipt, reason, address, signature}`.
  Do not use feedback for billing disputes.

## MCP

`POST https://readfetch.com/mcp` — streamable HTTP, JSON-RPC 2.0, one tool per endpoint, named
`readfetch_<endpoint>` (`readfetch_text`, `readfetch_scrape`, `readfetch_probe`, …) plus
**`readfetch_feedback`** (integrator reports — bind `request_id` from `X-Request-Id`).
**Default path:** `readfetch_probe` with the target `url`, then `readfetch_text` with the same
`url`. If probe reports `challenge: true`, use `readfetch_scrape` (then `readfetch_residential`
if still blocked).

`tools/list` is generated from the same catalog as the REST surface, so the two cannot drift.
Tool calls ride the same 402 flow: an unpaid call returns `isError` with the quote in
`structuredContent`. Most MCP hosts **cannot** attach `PAYMENT-SIGNATURE` on `tools/call` — run the
[signing MCP proxy](https://readfetch.com/integrations#mcp-signing)
(`npx @readfetch/mcp-x402-proxy@latest` + `EVM_PRIVATE_KEY` for paid tools; **`readfetch_probe` is free with no key**) or pay over REST with
`readfetch-client` / `@readfetch/client` (`Client` + `fetch(url)` for `/v1/text`; `call()` for other routes).
GitHub: [INTEGRATIONS.md](https://github.com/readfetch/readfetch/blob/main/INTEGRATIONS.md), [client-py](https://github.com/readfetch/client-py), [client-js](https://github.com/readfetch/client-js),
[mcp-x402-proxy](https://github.com/readfetch/mcp-x402-proxy), [REPOS.md](https://github.com/readfetch/readfetch/blob/main/REPOS.md).
Host configs: [GitHub HOSTS.md](https://github.com/readfetch/readfetch/blob/main/HOSTS.md). Agent drop-in: [AGENTS.md](https://github.com/readfetch/readfetch/blob/main/AGENTS.md).
Tool list: `https://readfetch.com/.well-known/mcp.json`.

## Limits that matter

- Body: 1 MiB request, JSON only.
- `/v1/batch`: 50 URLs, 8 in flight, 95 s total (`timeout_s`).
- `/v1/pdf`: 50 pages by default, 200 max, 20 MB.
- `/v1/probe`: 30/min and 2/s per IP; free.
- `/v1/crawl`: quoted per page from `max_pages` and settled when the job is accepted; `billed` is informational.
- Receipts and credits last 30 days; claims are capped at 5 per address per day, $0.05 each.
