agentsvc.io

services / web-read-batch

weboperational · 302 ms

Web Read Batch

Read 2 to 5 pages whose URLs you already know in one call, each as clean Markdown with title and description, fetched in parallel. Cheaper and faster than calling web-scrape once per URL; for 6 to 20 URLs use web-scrape-batch. A failed page is reported with its error while the others still return; charged only if at least one page was read. To find URLs first, use site-map (one site) or search-read (a question). Params: urls (1 to 5, required), max_chars per page (500 to 30000, default 6000).

Run free trial ↗1 free call per day with the example input. Paid: $0.005 USDC, no limit.

Call it

import { wrapFetchWithPayment, x402Client } from "@x402/fetch";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

const client = new x402Client();
registerExactEvmScheme(client, { signer: privateKeyToAccount(process.env.EVM_PRIVATE_KEY) });
const payFetch = wrapFetchWithPayment(fetch, client);

const res = await payFetch("https://agentsvc.io/api/v1/proxy/web-read-batch", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({"urls":["https://agentsvc.io/","https://agentsvc.io/docs"],"max_chars":3000}),
});
const { data, payment } = await res.json();  // payment.status "settling"; header X-Payment-Settle: sync returns payment.transaction

Input

FieldTypeDescription
urls *array1 to 5 http(s) URLs
max_charsinteger = 6000Maximum Markdown characters per page

Output

FieldTypeDescription
pagesarray
ok_countinteger
failed_countinteger
fetched_atstring

Example response (data)

{
  "pages": [
    {
      "url": "https://agentsvc.io/",
      "ok": true,
      "final_url": "https://agentsvc.io/",
      "status": 200,
      "title": "agentsvc.io",
      "description": "Pay-per-call web services for AI agents",
      "markdown": "# Web services your agent can buy per call.\n\n…",
      "word_count": 412,
      "truncated": true
    },
    {
      "url": "https://nonexistent.invalid/",
      "ok": false,
      "error": "fetch failed"
    }
  ],
  "ok_count": 1,
  "failed_count": 1,
  "fetched_at": "2026-10-06T12:00:00.000Z"
}