# Take Animated Screenshot — ScreenshotOne

> Takes and returns an animated screenshot of the given site with specified options. See the documentation

- Key: `screenshotone-take-animated-screenshot`
- Type: Action (Write)
- Version: 0.0.3
- App: ScreenshotOne (`screenshotone`) — https://pipedream.com/apps/screenshotone.md
- This page (HTML): https://pipedream.com/apps/screenshotone/actions/take-animated-screenshot
- Hints: open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/screenshotone/actions/take-animated-screenshot/take-animated-screenshot.mjs

## Description

Takes and returns an animated screenshot of the given site with specified options. [See the documentation](https://screenshotone.com/docs/animated-screenshots/)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `websiteUrl` | `string` | Yes | The URL of the website to take a screenshot of |
| `fileName` | `string` | Yes | The new name of the file to be saved without extension. e.g: screenshot |
| `scenario` | `string` | Yes | The default scenario is to record animation after loading the site without additional animations. See the documentation |
| `viewportWidth` | `integer` | Yes | The width of the viewport for the screenshot |
| `viewportHeight` | `integer` | Yes | The height of the viewport for the screenshot |
| `format` | `string` | Yes | The format of the screenshot |
| `scrollDelay` | `integer` | No | Delay in milliseconds between scrolls. The default value is 500 |
| `scrollDuration` | `integer` | No | Duration in milliseconds of one scroll. The default value is 1500 |
| `scrollBy` | `integer` | No | By how many pixes scroll. The default value is 1000 |
| `blockCookieBanners` | `boolean` | No | Whether to block cookie banners in the screenshot |
| `blockAds` | `boolean` | No | Whether to block ads in the screenshot |
| `blockTrackers` | `boolean` | No | Whether to block trackers in the screenshot |
| `delay` | `integer` | No | The delay before taking the screenshot, in seconds |

## Run it

**MCP**

```ts
import { Client } from "@modelcontextprotocol/sdk/client/index.js"
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const accessToken = await pd.rawAccessToken

const transport = new StreamableHTTPClientTransport(
  new URL("https://remote.mcp.pipedream.net/v3"),
  {
    requestInit: {
      headers: {
        Authorization: `Bearer ${accessToken}`,
        "x-pd-project-id": process.env.PIPEDREAM_PROJECT_ID!,
        "x-pd-environment": "production",
        "x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
        "x-pd-app-slug": "screenshotone",
      },
    },
  },
)

const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)

const { tools } = await mcp.listTools()

// listTools() hands your model this tool's input schema, so it can
// fill the arguments itself:
const result = await mcp.callTool({
  name: "screenshotone-take-animated-screenshot",
  arguments: {
    websiteUrl: "Website URL",
    fileName: "File name",
  },
})
```

**TypeScript**

```ts
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "screenshotone-take-animated-screenshot",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    screenshotone: { authProvisionId: "apn_xxxxxxx" },
    websiteUrl: "Website URL",
    fileName: "File name",
  },
})

console.log(result)
```

**cURL**

```bash
curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
  -H "Content-Type: application/json" \
  -H "X-PD-Environment: production" \
  -H "Authorization: Bearer {access_token}" \
  -d '{
    "external_user_id": "{external_user_id}",
    "id": "screenshotone-take-animated-screenshot",
    "configured_props": {
      "screenshotone": { "authProvisionId": "apn_xxxxxxx" },
      "websiteUrl": "Website URL",
      "fileName": "File name"
    }
  }'
```

---

- App: https://pipedream.com/apps/screenshotone.md · All apps: https://pipedream.com/apps
