SCREENSHOT API
Turn any URL into a crisp PNG or JPEG — full-page, viewport or element-level — with retina scaling, dark mode and cookie-banner blocking built in. No headless browsers to maintain.
POST https://api.ottersnap.com/v1/screenshot
Capture the whole scroll height or just the visible fold — one flag switches between them.
Pass a CSS selector to screenshot exactly one card, chart or section instead of the page.
Device scale factor two on request, so captures stay crisp on studio displays and phones alike.
Force prefers-color-scheme dark to capture how a page looks at night, automatically.
Consent popups and newsletter modals are hidden before the shot, so renders stay clean.
A delay window and networkidle waiting let lazy-loaded pages finish painting before capture.
JSON in, rendered file out. Works with anything that can make an HTTP request.
curl -X POST https://api.ottersnap.com/v1/screenshot \
-H "Authorization: Bearer otter_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://github.com", "fullPage": true, "scale": 2}' \
--output shot.pngconst res = await fetch("https://api.ottersnap.com/v1/screenshot", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.OTTERSNAP_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({ url: "https://github.com", fullPage: true }),
});
fs.writeFileSync("shot.png", Buffer.from(await res.arrayBuffer()));import os, requests
res = requests.post(
"https://api.ottersnap.com/v1/screenshot",
headers={"Authorization": f"Bearer {os.environ['OTTERSNAP_KEY']}"},
json={"url": "https://github.com", "fullPage": True},
)
open("shot.png", "wb").write(res.content)| Name | Type | Description |
|---|---|---|
| url | string · required | The page to render. Must start with https:// or http://. |
| format | string · default png | Output format: png or jpeg. |
| fullPage | boolean · default true | Capture beyond the viewport when true. |
| width | integer · default 1280 | Viewport width in CSS pixels (16–2560). |
| height | integer · default 800 | Viewport height in CSS pixels (16–2560). |
| scale | integer · default 1 | Device scale factor. Set 2 for retina captures. |
| darkMode | boolean · default false | Emulate prefers-color-scheme: dark. |
| delay | integer · default 0 | Extra milliseconds (0–10000) to wait after the page loads — useful for late fonts. |
| cookieBlock | boolean · default false | Hide common cookie banners and consent modals. |
| selector | string · optional | CSS selector for an element capture instead of the whole page. |
Most pages render in a few seconds. The first render of a page pays the full cost; repeat renders of the same URL hit our cache and come back faster and free of charge.
Not with this endpoint today — it renders public pages. For private dashboards, render on your own infrastructure or contact us about authenticated sessions.
You get a clear HTTP error instead of a blank image, and failed renders never count against your monthly quota.