> This page is for Designer API.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developers.webflow.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developers.webflow.com/_mcp/server.

# Get element snapshot

## `webflow.getElementSnapshot()`

Captures a snapshot of the specified element.

### Syntax

```typescript
webflow.getElementSnapshot(element: AnyElement): Promise<null | string>
```

### Parameters

| Parameter | Type         | Description                           |
| --------- | ------------ | ------------------------------------- |
| `element` | *AnyElement* | The element to capture a snapshot of. |

### Returns

A Promise that resolves to a [base64](https://developer.mozilla.org/en-US/docs/Glossary/Base64) string representing the snapshot of the element, or `null` if the snapshot could not be captured. The string is a PNG image and includes the `data:image/png;base64,` prefix, making it ready to use directly as an image source.

### Examples

#### Get a snapshot

```typescript
const selectedElement = await webflow.getSelectedElement();

if (selectedElement) {
  const snapshot = await webflow.getElementSnapshot(selectedElement);
  console.log("Snapshot:", snapshot); // base64 string
} else {
  console.log("No element selected");
}
```

#### Render snapshot as an image

```typescript
const selectedElement = await webflow.getSelectedElement();
const img = document.getElementById("snapshot-image") as HTMLImageElement;

if (selectedElement) {
  const snapshot = await webflow.getElementSnapshot(selectedElement);

  if (snapshot) {
    // Get an existing image element and set the base64 string as source
    img.src = snapshot;
  }
}
```

[Try this example](https://webflow.com/oauth/authorize?response_type=code\&client_id=19511de1ec410f9228d8dcbc9420e67916dea80d86d18f0c9a533eb475ea0f62)

### Designer Ability

| Designer Ability    | Locale | Branch | Workflow | Sitemode |
| :------------------ | :----- | :----- | :------- | :------- |
| **canAccessCanvas** | Any    | Any    | Any      | Any      |