Tool
Screenshot API
URL in, image out. A real browser renders the page, not a fetch.
The endpoint
GET /api/shot?url=https://example.com&viewport=mobile&full=1| Parameter | Notes |
|---|---|
url | Required. Public http/https only. |
viewport | desktop (1440×900), laptop (1280×800), tablet (834×1112), mobile (390×844) |
full=1 | Whole page rather than the viewport. |
format | png, jpeg, webp |
quality | 20–100, jpeg and webp only. |
dark=1 | Emulates prefers-color-scheme: dark. |
delay | Extra settle time in ms, capped at 5000. |
The page is loaded to networkidle0 rather than load, because a modern page fires load with half its content still arriving. delay is there for the rest — an entrance animation, a font swap, a chart that draws itself.
Setup
This is the one tool here with a dependency outside the account's free tier defaults: Cloudflare Browser Rendering. It needs two secrets.
npx wrangler secret put CF_ACCOUNT_IDnpx wrangler secret put BROWSER_TOKENThe token is an API token with Account · Browser Rendering · Edit. Until both are set the endpoint answers 501 and says so — it is deliberately implemented over the REST API rather than thebrowser binding, so a missing token turns off one tool instead of failing the whole deploy.
Why it is not public
Two reasons, and both are the same reason. Every capture is billed browser time, and an open screenshot endpoint is a fetcher that will retrieve whatever anyone points it at, from an address that belongs totesseract.page. Private and loopback addresses are rejected regardless.