Skip to main content
The Screenshot API opens a page in a browser, captures a PNG, and returns image data through a JSON response. Standard requests return a hosted image URL; eligible zero-data-retention requests return an in-memory data URL.

Capture an exact URL

The endpoint costs 1 credit. Pass exactly one of directUrl and domain.

Find a page by type

If you know the domain but not the page URL, provide domain and a supported page type:
Supported page types are login, signup, blog, careers, pricing, terms, privacy, and contact. Page resolution uses site links and heuristics. Use directUrl when the exact page is known or the resolved page must be deterministic.

Choose the capture mode

Viewport width can be 240 to 7,680 pixels and height can be 240 to 4,320 pixels. scrollOffset accepts 0 to 100,000 pixels. The final offset slice can be shorter than the viewport near the bottom of a page. fullScreenshot is a string query enum in the HTTPS API, so use "true" or "false" in SDK calls when required by the generated type.

Handle overlays

Two controls address obstructive UI:
  • handleCookiePopup=true asks the browser to dismiss detected cookie or consent UI.
  • clearPopups=true asks for broader cleanup of detected overlays and also includes consent UI.
Cleanup is heuristic. It can miss a custom dialog or change the state you intended to document. Compare a capture with and without cleanup when visual fidelity matters.

Control freshness

Screenshots are cached for one day by default. Use:
  • maxAgeMs=0 when the image must be captured again;
  • a larger value, up to 30 days, when reuse matters more than freshness;
  • cache_metadata in the response to record whether the result was a cache hit.
Parameters that change the rendered result should be part of your own application cache key, including target, viewport, mode, popup handling, country, wait time, and scroll offset.

Read the response

The response is JSON, not raw PNG bytes. screenshotType is viewport or fullPage; inspect the returned width and height rather than assuming the requested size was produced. With zdr=enabled, the screenshot field is a data:image/png;base64,... URL instead of a hosted image URL. ZDR must be enabled for your organization, and a successful response includes X-Context-ZDR: true. See Zero data retention.
Screenshot URLs or data URLs may contain sensitive rendered content. Do not put authenticated pages, personal data, or secrets into a public asset pipeline without appropriate access controls and retention rules.

Common failures

The Screenshot endpoint does not accept browser actions.

Next steps

Screenshot API reference

Review capture options and the full response contract.

Branded campaign assets

Use captured images in a branded campaign workflow.

Use browser actions

Interact with a page before extracting text or page images.
Set timeoutOpts.milliseconds for the end-to-end deadline. Partial mode requires at least 15,000 ms and marks an interrupted capture with finalDOMState: "still-loading". See Timeouts and partial results.