1. readfetch
  2. choose
  3. /v1/batch

Data · Documents and structure

POST/v1/batch

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.

  • $0.0015/page
  • min 3
  • partial ok

What it does

Read a fixed list of public HTML pages in one call—the same article extraction as POST /v1/text for each URL (Markdown or plain text plus title and metadata). One x402 payment covers the batch (minimum 3 pages quoted; URLs deduped, max 50). Returns results in input order: each item has url, status_code, text, billed, and hint when undelivered, plus batch-level delivered, failed, billed_pages, and optional credit for unused pages. Undelivered pages are not billed. Use readfetch_text for one URL, readfetch_map then readfetch_crawl to discover and walk a site, readfetch_scrape when JavaScript is required. Read-only; 402 without PAYMENT-SIGNATURE like other paid tools.

Price

Quoted by the 402 before anything runs.

  • $0.0015/pageper page
  • 95 s default, 95 s maximumwhole-call budget
  • billedonly when content is delivered
  • no keythe payment is the credential

When to call it

Cheapest endpoint that answers the question, first.

Call it when the sentence above is the whole job. Its neighbours solve the same URL with a different trade-off — a browser instead of plain HTTP, a site instead of one page, one section instead of a document. /choose walks the decision, cheapest first, browser last.

Unsure whether another URL is worth paying for at all? /v1/probe is free: metadata plus the full extracted text on the first 3 probes per IP per day (a ~400-character preview after that) before you pay for a priced route.

Request fields

JSON body shape for POST /v1/batch — use with the client snippets below, not as a bare POST.

FieldTypeDefaultWhat it does
urls requiredarray—URLs to read, deduped before quoting.
pipelinestringtexttext (default) = HTTP-first per URL, same as readfetch_text; use render when probe reported challenge:true or items need JavaScript — bills like scrape per undelivered page, not like plain text.
formatstringmarkdownPer-item output flavour, same as /v1/text: markdown (default) or plain text.
accept_languagestring—Accept-Language header for every item, e.g. 'de-DE,de;q=0.9'. Defaults to en-US when omitted.
timeout_snumber95Total budget for the whole batch in seconds; every item shares it and no item restarts it.

Make the call

Unpaid REST stops at 402. Use readfetch-client, @readfetch/client, or MCP @readfetch/mcp-x402-proxy — they sign x402 and retry. The JSON below is the argument shape for call() / route helpers.

example body
{
  "urls": [
    "https://example.com"
  ]
}

readfetch-client / @readfetch/client (latest+) handle x402 on paid routes — full API on /integrations#clients.

python
# pip install readfetch-client
# export EVM_PRIVATE_KEY=0x…
import asyncio
from readfetch_client import call

async def main():
    data = await call(
        "batch",
        {
          "urls": [
            "https://example.com"
          ]
        },
    )

asyncio.run(main())
javascript
// npm install @readfetch/client
// export EVM_PRIVATE_KEY=0x…
import { call } from "@readfetch/client";

const data = await call("batch", {
  "urls": [
    "https://example.com"
  ]
});

Response

Fields shown are the ones a caller branches on.

200 ok
{
  "billed_pages": 1,
  "credit": "credit-token-when-refund-applies",
  "delivered": 1,
  "failed": 1,
  "results": [
    {
      "billed": true,
      "content_sha256": "...",
      "hint": null,
      "requested_url": "https://example.com",
      "status_code": 200,
      "text": "...",
      "title": "Example Domain",
      "url": "https://example.com/",
      "used_browser": false
    },
    {
      "billed": false,
      "content_sha256": null,
      "hint": "upstream error",
      "requested_url": "https://example.invalid/",
      "status_code": 502,
      "text": "",
      "title": null,
      "url": "https://example.invalid/",
      "used_browser": false
    }
  ],
  "status": "partial"
}

Limits

Requests are JSON, 1 MiB maximum. Redirects are re-validated at every hop and capped at 5; the final URL is reported. Every call runs on one whole-call budget — DNS, connect, redirects, retries and any render share that clock, and no step starts a fresh timer. Where the endpoint publishes a timeout_s, its default and ceiling are the whole-call budget in the strip above. A budget that expires mid-walk returns status: "partial", and nothing is charged for what was not delivered.

Failures come back as {"error": "…", "hint": "…"} with a status to branch on. Shapes: /docs#errors.

Billing

$0.0015 per delivered page. A response with billed: false settles nothing and names the next call to try.

billed: false on 200 usually means a URL that failed that endpoint's delivery check. 502/504 settle nothing.

RECEIPT, claims, and billing rules: /docs#billing.

Settlement, receipts and claims: /docs.