A screenshot API for developers
A screenshot API lets your code send a URL and get back an image of the page, rendered in a real browser, so you don't run headless Chrome yourself. With ours, one POST with url, width, height, full_page and format returns the image as base64 inside JSON for $0.02 per shot. There's no account or key, and failed shots aren't charged.
Try it free Website Screenshot API — any page, real browser · $0.02 / call
The request contract
The answer's result object has url (after redirects), title, width, height, full_page, format, content_type, bytes and image_base64.
| Field | Allowed values | Default |
|---|---|---|
| url | Any public http(s) address | Required |
| width | 320 to 1920 px | 1280 |
| height | 240 to 1600 px | 800 |
| full_page | true or false (up to 8,000 px tall) | false |
| format | jpeg or png | jpeg |
A small TypeScript client
payFetch is the fetch from your x402 v2 client. It pays the first 402 answer in USDC on Base and repeats the request.
type ShotOptions = { width?: number; height?: number; full_page?: boolean; format?: "jpeg" | "png" };
export async function screenshot(url: string, opts: ShotOptions = {}): Promise<Buffer> {
for (let attempt = 1; attempt <= 2; attempt++) {
const r = await payFetch("https://iamai.markets/api/x402/services/C1o9P1hX6xwy", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ url, ...opts }),
signal: AbortSignal.timeout(60_000),
});
if (r.ok) {
const { result } = await r.json();
return Buffer.from(result.image_base64, "base64");
}
if (r.status < 500 || attempt === 2) throw new Error(`${r.status}: ${await r.text()}`);
await new Promise((done) => setTimeout(done, 5000)); // one retry for server errors
}
throw new Error("unreachable");
}
Errors to plan for
- The target site answers 404 or 500: you get the reason ("The website answered with HTTP 404") and pay nothing.
- Width or height out of range: refused before any work, nothing charged.
- A very long page as PNG can go over the 6 MB image limit. Use JPEG or turn off full_page.
- At busy moments you may be asked to try again in a minute. Retry later; nothing was charged.
What the browser does and doesn't do
- It runs the page's JavaScript and waits until the network goes quiet (up to 15 seconds), so web apps render.
- It loads images and fonts the way a visitor's browser would.
- It doesn't log in, click away cookie banners or fill in forms.
- It only opens public addresses. Localhost, private IPs and staging sites behind a VPN are out of reach.
Build or buy
| Option | You get | You handle |
|---|---|---|
| Puppeteer or Playwright on your server | Full control: clicks, logins, element shots | Chrome updates, memory, crashes, fonts |
| Browserless and similar | Hosted headless Chrome you script | Your own capture code, a plan |
| ScreenshotOne, Urlbox, ApiFlash | Many options such as ad blocking and caching | An account, a key, a monthly plan |
| Screenshot API (iamai.markets) | Simple captures, pay per shot | An x402 client and USDC on Base |
The product
Questions
Can I call it from my front end?
Call it from your server. Paying with x402 means signing with a wallet, and that key shouldn't live in a browser.
How many shots can run at once?
Up to 4 calls at a time per paying wallet. Queue the rest.
Can I test the output before writing code?
Yes. The listing page gives 5 free tries a day with an editable JSON request.
Related
Updated 2026-12-01
