/screenshot opens a URL in a headless Chrome browser, captures it, stores the image and returns a public URL to it. Cookie banners and ad slots are hidden on every capture. You choose:
- What to capture: the viewport, the full scrollable page (
full_page) or one element (selector). - What to render it as: a viewport size (
width,height), or a real device (device) with its viewport, pixel density, touch support and user agent, so the page serves its phone or tablet layout. - How the page looks: its dark theme (
dark_mode), and with ads and trackers blocked (block_ads). - When to capture: after a delay (
wait_for), or once an element appears (wait_for_selector). - The output:
jpeg(smaller),png(lossless),webp(best compression) orpdf(the whole page as a document), withqualityfor JPEG and WebP.
Example requests
Example response
viewport is in CSS pixels. The image is viewport × device_scale_factor pixels, so an iphone_15 capture is 1,179 pixels wide. warnings appears when something wasn’t as you asked but the capture still happened, for example a wait_for_selector that never appeared.
Devices
A device sets the viewport, so
width and height are ignored when you pass one.
Elements
selector captures the first element that matches a CSS selector, whole: #pricing, header, .hero img. Prefetch waits up to 10 seconds for it. If nothing matches, the request fails with 422 and TARGET_ELEMENT_NOT_FOUND, and isn’t charged. An element can’t be captured as a PDF.
wait_for_selector is different: it’s best effort. The page is captured once the selector appears, or after 10 seconds, with a warning, if it never does.
Formats
Images larger than 8 MB, such as a long page at a phone’s pixel density, are scaled down until they fit.
Limits
Credits
1 credit per capture, whatever the options. Failures are never charged.Next
Batch screenshots
Capture up to 500 URLs in one job with
POST /batch/screenshot.API reference
Every parameter, and a playground to try it.