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

> ## Agent Instructions
> Anchor Browser is cloud browser infrastructure for AI agents and automation: browser sessions you control over CDP or REST, natural-language web tasks, versioned automation tasks, managed authentication into third-party web apps (identities with MFA), persistent volumes and profiles, recordings, live view, batch sessions, webhooks, and network options including residential proxies, extra stealth, and captcha solving for sites that block standard browsers. AI agents should start at https://docs.anchorbrowser.io/for-agents, then create an API key at https://app.anchorbrowser.io/api-keys. Read the for-agents page before authentication or API calls.

# Screenshot Webpage

> Get a fully javascript-rendered screenshot of a given webpage

The screenshot tool captures a fully javascript-rendered screenshot of a given webpage using Chromium, without writing any automation code. Call `POST /v1/tools/screenshot` with the target `url`, and the API returns the captured image as a PNG.

The tool can run standalone or against an existing browser session — pass an optional `sessionId` query parameter to execute it on a running session (for example, to capture a page behind authentication).

> [!NOTE]
>
> PDF URLs are not supported by the screenshot tool.

### Request options

* **`url`**: The URL of the webpage to capture.
* **`width`** / **`height`**: Browser viewport dimensions in pixels.
* **`image_quality`**: Quality of the output image, on the range 1-100. 100 will not perform any compression.
* **`wait`**: Duration in milliseconds to wait after the page has loaded, mainly used for sites with JS animations.
* **`scroll_all_content`**: If true, scrolls the page and captures all visible content.
* **`capture_full_height`**: If true, captures the entire height of the page, ignoring the viewport height.
* **`s3_target_address`**: Presigned S3 url target to upload the image to.

See the full [API reference](https://docs.anchorbrowser.io/api-reference/tools/screenshot-webpage.md) for details.

### Code example

```javascript node.js theme={null}
const fs = require('fs');

const apiKey = process.env.ANCHOR_API_KEY;

const res = await fetch('https://api.anchorbrowser.io/v1/tools/screenshot', {
  method: 'POST',
  headers: {
    'anchor-api-key': apiKey,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    url: 'https://news.ycombinator.com',
    width: 1440,
    height: 900,
    capture_full_height: true,
  }),
});
if (!res.ok) {
  throw new Error(`screenshot failed: ${res.status} ${await res.text()}`);
}
const buffer = Buffer.from(await res.arrayBuffer());
fs.writeFileSync('screenshot.png', buffer);
console.log('saved screenshot.png');
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.