Guide · website screenshots
Take website screenshots from your AI agent
Your agent needs to see a page: check a layout, keep proof of what a page showed, or hand an image to a vision model. screenshot opens the URL in a real browser (Playwright), runs its JavaScript and returns a PNG. $0.009 per screenshot.
Try it free
curl -X POST https://agentsvc.io/api/v1/try/screenshot -H "Content-Type: application/json" -d '{}'JavaScript
npm i @x402/fetch @x402/evm viem
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/screenshot", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ url: "https://example.com", full_page: true }),
});
console.log(await res.json());Python
pip install "x402[httpx]" eth_account
from eth_account import Account
from x402 import x402Client
from x402.http.clients import x402HttpxClient
from x402.mechanisms.evm import EthAccountSigner
from x402.mechanisms.evm.exact.register import register_exact_evm_client
client = x402Client()
register_exact_evm_client(client, EthAccountSigner(Account.from_key(PRIVATE_KEY)))
async with x402HttpxClient(client) as http:
r = await http.post("https://agentsvc.io/api/v1/proxy/screenshot", json={"url": "https://example.com", "full_page": True})
await r.aread()
print(r.json())Input and output
url: the page to capture.widthandheight: viewport in pixels, default 1280 x 800. Use 390 x 844 for a phone view.full_page:truecaptures the whole page height instead of the first screen.wait_ms: extra wait after loading, default 1000. Raise it for pages that animate in or load late.
The answer has data.image_base64. Save it as a file:
curl -X POST https://agentsvc.io/api/v1/proxy/screenshot \
-H "Authorization: Bearer asvc_cr_..." -H "Content-Type: application/json" \
-d '{"url":"https://example.com","full_page":true}' | jq -r .data.image_base64 | base64 -d > page.pngNeed the text, not the picture?
Reading a page as text is cheaper and easier for a model: web pages as Markdown from $0.0025.
Paying
No account and no API key. Three ways to pay, all only for calls that succeed:
- Wallet (x402): a separate wallet with a few dollars of USDC on Base, Solana, Polygon or Arbitrum. The x402 client pays the price from the 402 answer and retries; you pay no gas.
- Credit token: buy one at /credits ($5 to $100, USDC on Base, +10% bonus) and send it as
Authorization: Bearer. Good for a script that runs through a long list. - Zero: if your agent already uses the Zero CLI, it pays the 402 for you:
zero fetch https://agentsvc.io/api/v1/proxy/screenshot -d '{"url":"https://example.com"}'
Details for every client, MCP and frameworks: docs, LangChain, Vercel AI SDK.
Claude Code, Codex or Cursor can learn this as a skill: npx skills add agentsvc/skills (source).