October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
Mountain View desk6 min

How to Capture a Website Screenshot with Browserless from a Google Sheet

Use Apps Script to send a URL from Google Sheets to Browserless, capture a viewport or full-page image, and optionally save it in Drive.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use a Google Sheet as the URL list, a bound Google Apps Script to send a JSON POST request to Browserless, and optionally Google Drive to store the returned image. The script below reads a URL from cell A2, requests a full-page PNG, saves it to Drive, and writes the file link to B2. You will need a Browserless API token and authorization for the Apps Script services it uses.

How the Google Sheets-to-Browserless workflow works

Three services handle the job: Google Sheets supplies the page URL, Apps Script makes the HTTPS request, and Browserless renders the page and returns screenshot image data. Apps Script can then save that data as a Drive file or route it elsewhere.

As an Amazon Associate I earn from qualifying purchases.

Browserless documents a POST request to its /screenshot endpoint with a URL and optional screenshot settings. Its example endpoint is https://production-sfo.browserless.io/screenshot?token=...; use the endpoint and region shown in your own account documentation if they differ. The token is passed as the token query parameter. See the Browserless Screenshot API documentation.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Prepare the sheet and keep the API token private

  1. Put the page address to capture in cell A2 of a sheet named Sheet1. The example writes the resulting Drive URL to B2.

  2. Obtain an API token from your Browserless account dashboard. Do not put a real token in a cell or in code shared with spreadsheet users.

  3. In the spreadsheet, open Extensions > Apps Script. In the Apps Script editor, open Project Settings and add a Script Property named BROWSERLESS_TOKEN with your token as its value. Script Properties avoid embedding the credential directly in the function, though people with sufficient access to the script project may still be able to manage its settings.

Add the Apps Script function

Paste this function into the project. It is an implementation pattern based on the documented Browserless and Google APIs, not a claim that this complete script has been run against your account or a particular website.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
function captureScreenshot() {
  const sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Sheet1');
  if (!sheet) throw new Error('Sheet1 was not found. Check the sheet name.');

  const targetUrl = String(sheet.getRange('A2').getValue()).trim();
  if (!targetUrl) throw new Error('Enter a website URL in cell A2.');

  const token = PropertiesService.getScriptProperties().getProperty('BROWSERLESS_TOKEN');
  if (!token) throw new Error('Set BROWSERLESS_TOKEN in Script Properties.');

  const endpoint = 'https://production-sfo.browserless.io/screenshot?token=' +
    encodeURIComponent(token);

  const response = UrlFetchApp.fetch(endpoint, {
    method: 'post',
    contentType: 'application/json',
    payload: JSON.stringify({
      url: targetUrl,
      options: { fullPage: true, type: 'png' }
    }),
    muteHttpExceptions: true
  });

  const status = response.getResponseCode();
  if (status < 200 || status >= 300) {
    throw new Error('Browserless request failed with HTTP ' + status +
      ': ' + response.getContentText());
  }

  const imageBlob = response.getBlob().setName('website-screenshot.png');
  const file = DriveApp.createFile(imageBlob);
  sheet.getRange('B2').setValue(file.getUrl());
}

The script uses SpreadsheetApp.getActiveSpreadsheet() to access the bound spreadsheet, UrlFetchApp.fetch() for the HTTP request, and DriveApp.createFile() to store the response blob. Google documents the required external-request scope as script.external_request; calling Drive also requires Drive authorization. The first manual run will prompt you to grant the requested permissions. See Google’s references for UrlFetchApp, DriveApp, and Apps Script authorization.

Choose the screenshot output

Viewport or full page

The example sets options.fullPage to true, asking for the whole document rather than only the currently visible viewport. Set it to false or omit the option when you want a viewport capture. Very long pages can create large images and take longer to render.

PNG, JPEG, or WebP

The documented screenshot output formats include PNG, JPEG, and WebP, selected with the type option. PNG is the example’s choice; select a format supported by your downstream workflow when file size or compatibility matters. Confirm the response format for your account and chosen options before applying a filename extension to other formats.

Drive or another destination

DriveApp.createFile(imageBlob) is a straightforward way to keep the image in Drive, and the script puts its URL in B2. If you do not need a persistent Drive file, omit those lines and handle the returned blob in the destination or processing step your workflow requires. Consider who can access any stored file and whether the sharing settings meet your needs.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Run the script and check the result

  1. Save the Apps Script project, select captureScreenshot in the function selector, and click Run.

  2. Complete the authorization prompts for the spreadsheet, external request, and Drive access used by the function.

  3. After a successful run, check Drive for website-screenshot.png and the sheet’s B2 cell for its file URL. If the request fails, Apps Script displays the error raised by the function; use the HTTP status and message to diagnose the request.

Handle dynamic pages and sites that resist automation

A page that fills in content after navigation may need a wait or navigation setting rather than the simplest screenshot request. Browserless documents wait and navigation options; use the relevant API settings for the target site’s loading behavior and verify that the desired elements have appeared before capture.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Automated browsing does not guarantee the same view a human visitor sees. Browserless notes that bot detection can lead to blank screenshots, CAPTCHA pages, access-denied responses, or missing page elements. A site may block automation or serve different content, so do not treat every failed or unexpected image as a Sheets or Drive problem.

Troubleshoot common failures

  • Missing token or authorization failure: Check that BROWSERLESS_TOKEN exists in Script Properties, that it is the current token, and that the URL includes the encoded token in the token query parameter. Confirm that you are using the endpoint configured for your account.

  • HTTP error from Browserless: The sample includes the status code and response body in its thrown error. Check the endpoint, token, request shape, and account configuration. A non-2xx response is not an image to save as a screenshot.

  • Invalid URL or navigation failure: Ensure A2 contains a complete URL, such as one beginning with https://, and that the target is reachable from the service. Private pages requiring an interactive login may not be accessible to a remote browser without an appropriate supported authentication setup.

    Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Blank, CAPTCHA, denied, or incomplete capture: The target may be detecting or blocking automated browsing, or its content may not have finished loading. Check the page in a browser, adjust documented wait or navigation settings where appropriate, and avoid assuming that repeated immediate retries will bypass a site’s controls.

  • Sheet or cell not found: Change Sheet1, A2, or B2 in the function to match your spreadsheet. The sample stops with a clear error if the named sheet or input URL is missing.

  • Drive permission or save failure: Reauthorize the script if needed and verify the account can create files in Drive. If the HTTP request succeeded but file creation did not, the screenshot response may have arrived even though the output step failed.

  • Unexpected image type or unusable file: Match the filename extension to the selected type and validate the response before handing it to another system. The sample’s filename is specifically for its PNG setting.

    Free tools Windows power users keep installed

    One-click scans. No signup required.

    Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Plan for Apps Script quotas and execution time

For repeated or scheduled captures, the Apps Script quotas page currently lists 20,000 URL Fetch calls per day for consumer accounts and 100,000 per day for Google Workspace accounts, a six-minute maximum execution time per run, and a 50 MB URL Fetch response-size limit per call. These are Google’s quota table values accessed on 2026-10-03; Google says quotas can change. Large full-page captures and slow pages can also consume more of the available execution time. See Google’s Apps Script quotas.

Or skip the browser setup

If you want a one-call screenshot API rather than maintaining the Apps Script-to-Browserless flow, ScreenshotNeo accepts a URL and returns a screenshot or PDF. For example, this cURL request saves a WebP capture:

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

See the ScreenshotNeo API documentation for parameters and setup. ScreenshotNeo removes cookie banners, popups, and chat widgets before the shot; bot checks, blank pages, and failed loads are never billed; and its MCP server lets AI agents take screenshots. The free plan includes 1,000 screenshots a month with no card, and paid plans start at $5 for 3,000. Sign up for ScreenshotNeo free.

Frequently Asked Questions

Can Browserless capture a full-page screenshot from this script?

Yes. The example requests one by setting options.fullPage to true.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Can I run the capture for multiple rows?

Yes, but the sample handles only A2. A batch version needs to iterate over the desired range, decide where each file link goes, and stay within Apps Script execution and URL Fetch quotas.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.