Scrape data in seconds

No proxies needed

Start Free
APIs

Website Screenshots in Google Sheets With Apps Script

A step-by-step Apps Script setup that captures every URL in a column and shows the page image in the next cell, with tests and fixes.

VK
Varun Kumar
··10 min read
Website Screenshots in Google Sheets With Apps Script: Pulldata blog cover

💡 Key Takeaways:

1) Google Sheets can't capture a web page on its own, but a short Apps Script can send each URL in a column to a screenshot API and write the result back to the same row.

2) The IMAGE function shows a picture in a cell only from a public image URL. Google's help page says it doesn't accept URLs hosted on Google Drive, and it doesn't support SVG.

3) If the API returns the image file itself, Apps Script can place it over the grid, but blobs passed to insertImage are capped at 2 MB, which a tall full page PNG can pass.

4) A time-driven trigger reruns the script on a schedule, and appending a row per capture turns the sheet into a dated visual log of each page.

Page previews in your sheet, on autopilot

Pulldata is a no-code web data platform that collects live, structured data from the public web, through a dashboard, a REST API or an MCP server for AI agents. Its website screenshot tool turns URLs into page images, and you pay only for results that come back, free to start.

A sheet with URL, preview, captured_at and status columns, each row showing a small page thumbnail next to its address

What will you build?

You'll build a Google Sheet where column A holds URLs and a script fills the next columns with a page screenshot, a link to the full image, a timestamp and a status. It runs from a custom menu, or on a timer, without a server or a browser extension.

Apps Script sends a row's URL to a screenshot API, and the page image comes back into the preview cell of the same row

The flow has four parts: the sheet, Apps Script, the screenshot API and the image coming back. Everything runs in Google's cloud and in Pulldata's, so nothing installs on your computer.

Website screenshots in Google Sheets are useful wherever a list of pages needs a quick visual check. Site audits, launch checks and records of how a pricing or landing page looked on a given day all fit this pattern.

What do you need before you start?

You need a Google account, a Pulldata account with an API key and a list of URLs. Plan on about twenty minutes the first time.

Item

Where you get it

Notes

Google Sheet

sheets.google.com

Personal or Workspace account

Apps Script editor

Extensions, then Apps Script, inside the sheet

The script is bound to that one sheet

Pulldata API key

Pulldata dashboard (Pulldata docs)

Stored in Script Properties, never in a cell

Screenshot API request

Website screenshot API page

Copy the endpoint and body from there

URL list

Your own pages or a crawl

One full URL per cell, with https://

Pulldata bills per result that comes back, so the cost grows with the number of URLs and how often the trigger runs. Check the live pricing page before you schedule a long list.

How to send website screenshots to Google Sheets, step by step

The steps below use Google's documented Apps Script services for the sheet side. The API call is a template: copy the exact endpoint, body and response field from Pulldata's API page into it.

Step #1: Create a free account and copy your API key

Go to app.pulldata.io/signup and pick "Continue with Google", or enter an email and a password of at least 8 characters and click "Create account". The sign-up page says new accounts get $10 of free credit with no card required.

Open the dashboard and copy your API key. Keep it somewhere private for the next step.

Step #2: Set up the sheet

Rename the first tab to URLs. Put these headers in row 1: url, preview, image_link, captured_at and status, in columns A to E.

Paste your URLs into column A from row 2 down. Use full addresses such as https://example.com/pricing, since an address without a scheme can fail before the capture even starts.

A browser address bar with https:// highlighted in front of example.com/pricing, above the bare address marked invalid

Step #3: Store the API key in Script Properties

Open Extensions, then Apps Script. In the editor, go to Project Settings and add a script property named PULLDATA_API_KEY with your key as the value.

Google describes script properties as the place for app-wide settings such as credentials, shared by everyone with access to the script (Apps Script Properties Service). That keeps the key out of the cells, where anyone who can view the sheet could copy it.

An API key in cell B1 behind a share dialog listing every viewer who can read it, beside a locked Script Properties key
Keep in mind

Anyone who can edit a bound script can read its script properties. If the sheet is shared with a team, give it a key of its own so you can revoke that key without breaking your other scripts.

Step #4: Paste the script

Replace the contents of Code.gs with the script below. It reads each URL that has no status yet, requests a capture, and writes the image, the link, the time and the result into the same row.

javascript
// Template: copy the real values from Pulldata's website screenshot API page.
const ENDPOINT = 'PASTE_SCREENSHOT_ENDPOINT_HERE';

function captureScreenshots() {
  const sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('URLs');
  const key = PropertiesService.getScriptProperties().getProperty('PULLDATA_API_KEY');
  const last = sheet.getLastRow();
  if (last < 2) return;

  const rows = sheet.getRange(2, 1, last - 1, 5).getValues();
  rows.forEach(function (row, i) {
    const url = row[0];
    const status = row[4];
    if (!url || status === 'ok') return;

    const res = UrlFetchApp.fetch(ENDPOINT, {
      method: 'post',
      contentType: 'application/json',
      headers: { /* auth header from the API page, using key */ },
      payload: JSON.stringify({ /* request body from the API page, with url */ }),
      muteHttpExceptions: true
    });

    const r = i + 2;
    if (res.getResponseCode() !== 200) {
      sheet.getRange(r, 5).setValue('error ' + res.getResponseCode());
      return;
    }

    const body = JSON.parse(res.getContentText());
    const imageUrl = body.PASTE_IMAGE_URL_FIELD; // field name from the API page

    const img = SpreadsheetApp.newCellImage()
      .setSourceUrl(imageUrl)
      .setAltTextDescription('Screenshot of ' + url)
      .build();

    sheet.getRange(r, 2).setValue(img);
    sheet.getRange(r, 3).setValue(imageUrl);
    sheet.getRange(r, 4).setValue(new Date());
    sheet.getRange(r, 5).setValue('ok');
  });
}

function onOpen() {
  SpreadsheetApp.getUi().createMenu('Screenshots')
    .addItem('Capture now', 'captureScreenshots')
    .addToUi();
}

The method, headers, payload and muteHttpExceptions options are documented in Google's reference for UrlFetchApp. The image step uses SpreadsheetApp.newCellImage(), which Google documents as the way to build an image value and write it to a cell with setValue (CellImageBuilder reference).

Skipping rows marked "ok" matters on reruns. Without it, every run would capture every URL again and bill for each one.

Example sheet rerun with a Capture missing button: ok rows are skipped, while error and empty rows get a new capture

Step #5: Authorise and run it once

Save, reload the spreadsheet, and pick Screenshots, then Capture now from the new menu. The first time, Google asks you to approve access to the sheet and to external requests.

Read the permission screen before you approve. It should ask for the spreadsheet and for connecting to an external service, which is what UrlFetchApp needs.

Step #6: Pick how the image shows in the cell

The script writes an in-cell image, which resizes to fit the cell. Make the preview column wider and the rows taller, around a thumbnail's height, so each capture reads as a picture and not a sliver.

A page image squashed into a default-height row, next to the same capture in a taller row and a wider column that shows it

The other option is the IMAGE formula in column B, pointing at the link in column C: =IMAGE(C2). Google's help page lists four sizing modes, from fit-to-cell (the default) to stretch, original size and a custom height and width (IMAGE function help).

One page capture in four cells, one per IMAGE formula mode: fit inside, stretch to fill, original size cropped, custom
Worth knowing

The IMAGE function won't load pictures hosted on Google Drive, according to Google's help page. Saving captures to Drive and pointing IMAGE at them gives you empty cells, so keep the image URL the API returns, or host the files somewhere public.

If the API returns the image file itself, the script needs a different last step. Google's Sheet reference says insertImage places a blob over the grid and that the blob can be at most 2 MB (Apps Script Sheet class).

Over-grid images also float above the cells, so they don't sort or filter with their row. For a list you'll reorder, in-cell images or IMAGE formulas behave far better.

After sorting by name, in-cell images in column B move with their rows, while images over the grid stay in the wrong row

Step #7: Schedule it with a trigger

In the Apps Script editor, open Triggers and add one for captureScreenshots with a time-driven source and a daily or weekly interval. Google's installable triggers guide covers the options.

For a dated history in place of an up-to-date preview, change the script to append a new row per capture and stop skipping "ok" rows. Our guide to scheduling website screenshots covers capture times and intervals in more depth.

Overwrite replaces one /pricing capture with the latest, while append adds a new dated row with a preview for each run

How do you test it?

Test with three URLs first: one simple page, one long page and one address you know is broken. You should get two rows with a preview, a link, a time and "ok", plus one row with an error code.

Then check by hand:

  • Each preview matches the URL in its row, not the row above.
  • The link in column C opens the full image in a browser.
  • The long page shows the whole page, if you asked for a full page capture.
  • Executions in the Apps Script sidebar show a finished run with no errors.

Run it a second time. Nothing should change and no new captures should be billed, because every row already says "ok".

Quick check

A capture can succeed and still show the wrong thing, such as a cookie banner or a login page. Glance down the preview column after each run, since a status of "ok" only means the API returned an image.

Those capture problems have fixes on the capture side, not the sheet side. Our guide to the full page website screenshot covers lazy loading, sticky headers and banners.

Why isn't the screenshot showing in the sheet?

Most problems show up in the status column or as a blank cell. The table matches each symptom to its usual cause.

Symptom

Likely cause

Fix

Status shows error 401

Missing or wrong API key

Re-copy the key into Script Properties, no spaces

Status shows error 400

Body doesn't match the API page, or the URL lacks https://

Copy the body exactly; fix the URL

Preview cell is empty

Image URL hosted on Drive, or an SVG (IMAGE help)

Use the API's image URL in PNG or JPG

insertImage fails

Image blob over 2 MB

Use a viewport capture, JPG, or the image URL

Script stops part way

6-minute limit per run (Apps Script quotas)

Rerun; done rows are skipped

Previews in the wrong rows

Rows sorted while the script ran

Don't sort during a run; rerun the batch

Google caps URL Fetch calls at 20,000 a day for consumer accounts and 100,000 for Workspace, according to the same quotas page. A sheet of a few hundred URLs captured daily sits far below that.

If an image URL stops loading weeks later, the link may have expired on the provider's side. Save a copy of captures you need to keep, since a sheet full of dead links is not an archive.

A timeline where a capture kept only as a link is broken by audit time, while a saved copy of the same image is still there

Is there a way to do this without code?

Yes, if you're happy to move files by hand. Run the URL list through the no-code screenshot tool, download the images, and add them to the sheet with Insert, then Image, then Insert image in cell (Google's guide to adding images).

That's fine for a one-off audit of twenty pages. It gets tedious fast for anything you repeat, which is where the script earns its twenty minutes.

Tip

Name each downloaded file after its row, such as row-07-pricing.png, before you insert it. Images added by hand carry no URL, so the file name is the only thing tying a picture to its page once the list gets long.

A third option is to ask an AI assistant for the captures. Our post on screenshot MCP servers covers that route, and it suits quick looks more than lists you track over time.

For page changes you want flagged, not just recorded, our guide to website visual change monitoring adds image comparison on top. And if your sheet already tracks rankings, the same pattern appears in our post on Google search results in Google Sheets.

Website Screenshot Google Sheets FAQ

Can Google Sheets take a screenshot of a website by itself?

No. Sheets can show an image from a URL, but something else has to capture the page, such as a screenshot API called from Apps Script.

Why does IMAGE show nothing for my Drive file?

Google's help page says IMAGE doesn't accept URLs hosted on Google Drive. Use a public image URL from the screenshot provider.

Will the screenshot in the cell update by itself?

Only when the script runs again. Add a time-driven trigger and the preview refreshes on that schedule.

Can I screenshot a page behind a login into Sheets?

Only if the capture service supports passing cookies or headers, and only for accounts you own.

Does this work in Excel?

The API call works anywhere that can send an HTTP request. In Excel you'd use Office Scripts or Power Automate, and the image steps differ.

Disclaimer: This guide is general information. Check Google's Apps Script quotas, Pulldata's documentation and the terms of the sites you capture before running automated jobs, and make sure your use of captured pages follows the laws that apply to you.

Google's documentation and limits were checked on Google's own pages on Nov 3.

Share this article
V

Written by

Varun Kumar

Varun Kumar is co-founder of Pulldata, where he leads the data infrastructure behind its products. A backend engineer by training, he has spent 8 years building large-scale scraping and automation systems, and now oversees how Pulldata extracts, validates and delivers web data at scale.

FAQ

Frequently asked questions

Everything you need to know about extracting web data, proxy management, and zero-cost failed rows.

Explore Documentation

Where can I extract public web data from with PullData?

PullData provides ready-to-use scrapers for Google Maps, Google Search SERP, directory listings, company websites, and social platforms, with built-in proxy rotation and automated anti-bot bypass.

Do I need coding skills or proxies to collect data?

No coding or proxy management is required. Everything runs in the cloud. You only configure your target keywords or URLs, and PullData handles rate limits, proxy rotation, and CAPTCHAs automatically.

In what file formats can I download extracted data?

You can export datasets instantly into CSV, Microsoft Excel (XLSX), or JSON. You can also connect directly via Webhook or REST API to sync rows with your database or CRM.

What happens if a scraping job encounters failed rows?

PullData only charges for successfully scraped and verified rows. Any failed row or timeout costs 0 credits, ensuring you only pay for actionable data.

Get Started Free

Ready to extract web data?

No code, no proxies, no engineering overhead. Start with $10 free credits and collect clean public data instantly.

Instant Cloud Setup $10 Free Credits Included Failed Rows Cost $0
Weekly Digest

Get weekly data-extraction insights

One short email a week — new guides, scraper tips, and the occasional teardown. No spam, unsubscribe anytime.