agentsvc.io

services / web-read-batch

weboperational · 172 ms

Web Read Batch

Read up to 5 web pages in one call and get each as clean Markdown with title and description. Pages are fetched in parallel; a page that fails is reported with its error while the others still return. Charged only if at least one page could be read. Params: urls (array of 1 to 5 http(s) URLs, required), max_chars per page (500 to 30000, default 6000).

Run free trial ↗1 free call per day with the example input. Paid: $0.008 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.transaction = on-chain receipt

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"
}