Capture Website Screenshots in Zapier

Zapier moves one record at a time and has nowhere to run a browser, which makes a screenshot step awkward to build by hand. The CustomJS action does the capture and returns a file object the following steps already know how to use.

600 free requests / month, no credit card

Task
Website screenshot
Platform
Zapier
Steps
3
Output
PNG file object

// live preview

Capture it here before building the Zap

Check that the page captures the way you expect, including any cookie banner, before wiring it into a Zap where failures are slower to see.

// the workflow

Trigger, capture, deliver

Trigger
new row, new submission, schedule
CustomJS
website screenshot
Slack, Drive, Gmail
post or store the image

Add CustomJS as an action step and map the URL from the trigger. The step returns a file, and Zapier passes file objects between steps without a download in between.

What the action receives

{
  "url": "{{trigger__website_url}}",
  "commands": [
    { "type": "click", "selector": "button[data-testid='accept-all']" }
  ]
}

// step by step

Build it yourself

  1. 1

    Connect CustomJS in Zapier

    Add a step, search for CustomJS, and create a connection with the API key from your workspace. The Zapier integration page shows each screen.

  2. 2

    Map the URL from the trigger

    Pick the field holding the address. Validate it first if it comes from a form, because a Zap that captures whatever a stranger typed is a request you did not intend to make.

  3. 3

    Add commands if the page needs them

    A cookie banner or a filter that has to be set before the shot goes in the command list. Build the list in the visual builder and paste it in.

  4. 4

    Pass the file to the next step

    The Slack, Drive, Dropbox and Gmail steps take the returned file directly in their file or attachment field. No extra formatter step is needed.

// zapier specifics

Things that only bite on Zapier

The capture is the same everywhere. What differs is how Zapier handles files, loops and failures, and those three are where a working Zap goes wrong later.

One capture per task

// A list of 20 URLs in one field does NOT become 20 captures.
// Either send one trigger record per URL, or use a Looping step,
// and remember each pass costs a task.

Validate a URL that came from a form

// Code by Zapier step, before the capture
const url = inputData.url || '';
const ok = /^https:\/\/[a-z0-9.-]+\.[a-z]{2,}(\/|$)/i.test(url);

// Stop the Zap rather than capturing something arbitrary
if (!ok) throw new Error('Refusing to capture: not a plain https URL');
output = [{ url }];

A capture triggered by user input reaches whatever address it is given. Keep it to a list you control, or validate it as above.

Questions about this template

Add a capture step to your Zap

Create a workspace, connect the API key in Zapier, and the action appears in the picker.