> ## Documentation Index
> Fetch the complete documentation index at: https://docs.automate.ax/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Automate.ax automations are TypeScript programs.
> Use Bun for installation and command examples.
> Use Automate.ax for the product name and automate.ax for the package, CLI, and domain.
> Treat documented public APIs as current; do not invent transitional or deprecated names.

# Capture screenshot

> Render a URL or HTML document and return a screenshot image.

`cloudflare.captureScreenshot` captures a rendered page through Cloudflare Browser Run.

```ts automations/capture-cloudflare-screenshot.automation.ts theme={null}
import { automation, onDashboardRun } from "automate.ax"
import { cloudflare } from "automate.ax/cloudflare"

export default automation("Capture homepage", () => {
  onDashboardRun({ title: "Capture homepage" })
  const image = cloudflare.captureScreenshot({
    accountId: "cloudflare-account-id",
    screenshotOptions: { fullPage: true, type: "png" },
    url: "https://example.com",
  })
  // Pass image to the file-storage or messaging action that should publish it.
})
```

## Inputs

Provide `accountId` and exactly one of `url` or `html`. `screenshotOptions` controls PNG, JPEG, or WebP output, full-page capture, clipping, transparency, surface capture, viewport overflow, speed, and JPEG/WebP quality from 0–100. The type defaults to PNG, which does not accept `quality`. You can also set `selector` or enable `scrollPage`. `cacheTtl` defaults to 5 seconds, and the common Browser Run page controls are available.

## Output

Returns the image as a `Blob` with Cloudflare's response media type. The action consumes Browser Run duration and is not replay-safe.
