---
title: "Screenshots"
description: "Capture a screenshot with CDP."
---

> Documentation Index
> Fetch the complete documentation index at: https://help.tooluse.net/llms.txt
> Use this file to discover all available pages before exploring further.

# Screenshots

<p>Connect a compatible CDP client to the <code>connectUrl</code> returned by a running Tooluse.net session. Use Chromium’s <code>Page.captureScreenshot</code> to capture that page. There is no separate native screenshot HTTP endpoint.</p>
<pre><code class="language-javascript">// client is an already connected, page-scoped CDP session.
const {data} = await client.send("Page.captureScreenshot", {
  format: "png", captureBeyondViewport: true
});
await writeFile("screenshot.png", Buffer.from(data, "base64"));
</code></pre>
<p>Import <code>writeFile</code> from <code>node:fs/promises</code> in a Node.js program. The image is returned to your automation process; it is not automatically added to retained browser downloads.</p>
<p>See <a href="/browsers/getting-started/create-browser-session">Create a browser session</a> and the <a href="/browsers/api">Browsers API</a> for authentication, request fields, and limits.</p>

Source: https://help.tooluse.net/browsers/files/screenshots/index.mdx
