switch402

Full-Page Screenshot API: the Whole Scrollable Page as PNG, $0.012 per Call

/v1/screenshot/full captures an entire public web page, top to bottom, JavaScript rendered, and returns it as a base64 PNG for $0.012 USDC on Base per call, paid over x402. Need only what is above the fold? /v1/screenshot returns the 1280x800 viewport for $0.008.

  • Whole page, one image

    The response has full_page: true, width (1280), height (the page length), bytes and image_base64 (PNG, up to 8 MB).

  • Viewport option

    /v1/screenshot returns the visible 1280x800 area for $0.008 per call; same response shape with full_page: false.

  • Charged only for an image

    Settles only when an image comes back. Blocked URLs (400), failed captures (502) and capacity limits (503) are not charged.

  • Know the limits

    Public http(s) pages on default ports only. Input is the URL; PNG is the only format, with no device, delay or element options today.

Cost: full-page screenshots x $0.012. 200 full pages a month cost $2.40; mixing in 300 viewport shots adds $2.40.

Code examples

curl: unpaid call shows the price (HTTP 402, $0.012)

curl -i -G https://api.switch402.com/v1/screenshot/full \
  -H 'User-Agent: my-agent/1.0' \
  --data-urlencode 'url=https://example.com'
# HTTP 402 with x402 terms: amount 12000 (= $0.012). An x402 client pays and retries.

Python: save the full page as page.png

# pip install "x402[requests,evm]"
import os
from eth_account import Account
from x402 import x402ClientSync
from x402.http.clients import x402_requests
from x402.mechanisms.evm import EthAccountSigner
from x402.mechanisms.evm.exact import ExactEvmScheme

client = x402ClientSync()
client.register("eip155:8453", ExactEvmScheme(signer=EthAccountSigner(Account.from_key(os.environ["AGENT_KEY"]))))
session = x402_requests(client)
session.headers["User-Agent"] = "my-agent/1.0"

import base64

r = session.post("https://api.switch402.com/v1/screenshot/full", json={"url": "https://example.com"})  # $0.012
r.raise_for_status()
shot = r.json()  # {"url", "full_page": true, "format": "png", "width", "height", "bytes", "image_base64", ...}
open("page.png", "wb").write(base64.b64decode(shot["image_base64"]))
print(shot["width"], "x", shot["height"], shot["bytes"], "bytes")

MCP: the screenshot_full tool

curl -s -X POST https://api.switch402.com/mcp -H 'Content-Type: application/json' -H 'Accept: application/json, text/event-stream' -H 'User-Agent: my-agent/1.0' \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"screenshot_full","arguments":{"url":"https://example.com"}}}'

FAQ

How tall can the page be?
The capture covers the whole scrollable page, as long as the PNG stays within 8 MB.
Can I change the width or device?
Not today. Captures use a 1280 px wide viewport; the only input is the URL.
Am I charged if the capture fails?
No. Payment settles only when an image comes back.

Related

More API pages