> ## 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 Scrapfly screenshot

> Capture a viewport, full page, or selected page element as an image.

`scrapfly.captureScreenshot` renders a page and returns its screenshot as a `Blob`.

```ts theme={null}
import { automation, onInvocation } from "automate.ax"
import { scrapfly } from "automate.ax/scrapfly"

export default automation("Capture pricing", () => {
  onInvocation()
  scrapfly.captureScreenshot({
    url: "https://example.com/pricing",
    capture: "fullpage",
    format: "png",
    resolution: "1440x900",
  })
})
```

| Input                                                                                                 | Type                                | Required | Default           | Description                                                                                   |
| ----------------------------------------------------------------------------------------------------- | ----------------------------------- | -------- | ----------------- | --------------------------------------------------------------------------------------------- |
| `url`                                                                                                 | `string`                            | Yes      | —                 | Complete page URL.                                                                            |
| `capture`                                                                                             | `string`                            | No       | Viewport          | Viewport, full-page, vertical, CSS, or XPath capture target.                                  |
| `format`                                                                                              | `'jpg' \| 'png' \| 'webp' \| 'gif'` | No       | JPEG              | Image format.                                                                                 |
| `resolution`                                                                                          | `` `${number}x${number}` ``         | No       | Provider default  | Browser viewport.                                                                             |
| `waitForSelector`, `renderingWait`, `javascript`, `autoScroll`                                        | Render controls                     | No       | Provider defaults | Prepare the page before capture.                                                              |
| `country`, `visionDeficiency`, `options`, `timeout`, `cache`, `cacheClear`, `cacheTtl`, `webhookName` | Advanced controls                   | No       | Provider defaults | Configure network, accessibility simulation, rendering, cache, timeout, or callback behavior. |

Returns `{ image, metadata }`. `image` is a typed `Blob`; metadata includes `extensionName`, `upstreamStatusCode`, and `upstreamUrl`.
