Skip to content

Capture Screenshot

Cloudflare Browser Run

Cloudflare Browser Run

Capture Screenshot

Capture a screenshot of a page and return it as a file.

ActionAI Tool

Inputs

Name Type Required Description
urltextRequiredThe URL to screenshot. Provide either url or html.
htmltextOptionalRaw HTML to render instead of a URL.
screenshotOptionsobjectOptionalScreenshot output options.
fullPageyes/noOptionalCapture the full scrollable page.
omitBackgroundyes/noOptionalRender a transparent background.
typeselectOptionalImage format. (options: PNG, JPEG, WebP)
qualitynumberOptionalImage quality (0-100), for jpeg/webp.
captureBeyondViewportyes/noOptionalCapture content beyond the viewport.
clipobjectOptionalClip region.
xnumberOptionalX offset.
ynumberOptionalY offset.
widthnumberOptionalClip width.
heightnumberOptionalClip height.
selectortextOptionalCSS selector of a single element to capture.
viewportobjectOptionalViewport dimensions and device settings.
widthnumberOptionalViewport width in pixels.
heightnumberOptionalViewport height in pixels.
deviceScaleFactornumberOptionalDevice scale factor (pixel density).
gotoOptionsobjectOptionalNavigation options controlling how the page is loaded.
waitUntilselectOptionalWhen to consider navigation finished. (options: Load, DOM Content Loaded, Network Idle 0, Network Idle 2)
timeoutnumberOptionalMaximum navigation time in milliseconds.
referertextOptionalReferer header value.
cookiesarray of objectOptionalCookies to set before loading the page.
nametextRequiredCookie name.
valuetextRequiredCookie value.
domaintextOptionalCookie domain.
urltextOptionalCookie URL.
pathtextOptionalCookie path.
authenticateobjectOptionalHTTP basic auth credentials.
usernametextOptionalHTTP auth username.
passwordtextOptionalHTTP auth password.
setExtraHTTPHeadersdynamic objectOptionalExtra HTTP headers to send with the request.
userAgenttextOptionalCustom user agent string.
waitForSelectortextOptionalWait for this CSS selector before capturing.
addScriptTagarray of objectOptionalInject JavaScript before capture.
urltextOptionalExternal script URL.
contenttextOptionalInline JS content.
idtextOptionalScript id.
addStyleTagarray of objectOptionalInject CSS before capture.
urltextOptionalExternal stylesheet URL.
contenttextOptionalInline CSS content.

Outputs

Name Type Description
statusCodenumberHTTP status code.
bodyobjectResult containing the generated file.
fileattachmentsThe generated screenshot file, uploaded to the file store.
contentTypetextMIME type of the generated file.
sizenumberFile size in bytes.