Integrate with Google Sheets

Overview

You can display GetScreenshot screenshots directly in Google Sheets using the built-in IMAGE() function. This approach lets you create dynamic spreadsheets that show live website screenshots without any third-party integrations.

Requirements

  • GetScreenshot API Key - Get one here
  • Google account with access to Google Sheets

Quick Start

Basic Screenshot Formula

To display a screenshot in a cell, use the IMAGE() function with the GetScreenshot API URL:

=IMAGE("https://api.rasterwise.com/v1/get-screenshot?apikey=YOUR_API_KEY&url=https://example.com")

Replace YOUR_API_KEY with your actual API key and https://example.com with the target URL.

Screenshot from Cell Reference

If the URL is in another cell (e.g., A2), use CONCATENATE() or the & operator:

=IMAGE("https://api.rasterwise.com/v1/get-screenshot?apikey=YOUR_API_KEY&url=" & A2)

Or with ENCODEURL() for URLs with special characters:

=IMAGE("https://api.rasterwise.com/v1/get-screenshot?apikey=YOUR_API_KEY&url=" & ENCODEURL(A2))

Screenshot Parameters

Add parameters to customize your screenshots:

Parameter Description Example
width Viewport width in pixels &width=1280
height Viewport height in pixels &height=800
fullpage Capture entire scrollable page &fullpage=true
format Output format (png, jpeg, webp) &format=jpeg
devicefactor Retina scaling (1, 2, or 3) &devicefactor=2
hidemsg Hide chat widgets &hidemsg=true
hidecookie Hide cookie banners &hidecookie=true

Example Formulas

Mobile Screenshot (iPhone 12 size)

=IMAGE("https://api.rasterwise.com/v1/get-screenshot?apikey=YOUR_API_KEY&url=https://example.com&width=390&height=844")

Full Page Screenshot

=IMAGE("https://api.rasterwise.com/v1/get-screenshot?apikey=YOUR_API_KEY&url=https://example.com&fullpage=true")

Clean Screenshot (No Popups)

=IMAGE("https://api.rasterwise.com/v1/get-screenshot?apikey=YOUR_API_KEY&url=https://example.com&hidemsg=true&hidecookie=true")

High-Resolution Retina Screenshot

=IMAGE("https://api.rasterwise.com/v1/get-screenshot?apikey=YOUR_API_KEY&url=https://example.com&devicefactor=2")

Dynamic URL from Cell with Parameters

If URL is in A2 and you want a full-page mobile screenshot:

=IMAGE("https://api.rasterwise.com/v1/get-screenshot?apikey=YOUR_API_KEY&url=" & ENCODEURL(A2) & "&width=375&fullpage=true")

IMAGE Function Modes

The IMAGE() function accepts an optional second parameter for sizing:

Mode Description
1 (default) Resize image to fit cell, maintain aspect ratio
2 Stretch image to fill cell
3 Use original image size
4 Custom size with width and height parameters

Example with fit-to-cell mode:

=IMAGE("https://api.rasterwise.com/v1/get-screenshot?apikey=YOUR_API_KEY&url=https://example.com", 1)

Batch Processing Tips

Setting Up a Screenshot Table

  1. Create a column for URLs (Column A)
  2. Create a column for screenshots (Column B)
  3. Use a formula in B2 that references A2
  4. Copy the formula down for all rows

Example structure:

A (URL) B (Screenshot)
https://example.com =IMAGE(...&url=" & ENCODEURL(A2) & "...")
https://google.com =IMAGE(...&url=" & ENCODEURL(A3) & "...")

Rate Limiting Considerations

  • Each formula triggers an API call when the sheet loads or refreshes
  • Large sheets with many screenshot formulas may hit rate limits
  • Consider using manual refresh or limiting active screenshot cells
  • API calls count against your monthly quota

Caching Behavior

  • Google Sheets caches IMAGE() results
  • Screenshots may not update immediately when target pages change
  • To force refresh, modify the formula slightly (add/remove a space) or use a cache-busting parameter

Advanced Usage

Using Named Ranges for API Key

Store your API key in a named range to avoid repeating it:

  1. Enter your API key in a cell (e.g., Z1)
  2. Go to Data > Named ranges
  3. Create a range named APIKey pointing to Z1
  4. Use in formula: =IMAGE("https://api.rasterwise.com/v1/get-screenshot?apikey=" & APIKey & "&url=" & A2)

Conditional Screenshots

Only load screenshots for non-empty URLs:

=IF(A2<>"", IMAGE("https://api.rasterwise.com/v1/get-screenshot?apikey=YOUR_API_KEY&url=" & ENCODEURL(A2)), "")

Error Handling

Wrap in IFERROR() to handle failed screenshots gracefully:

=IFERROR(IMAGE("https://api.rasterwise.com/v1/get-screenshot?apikey=YOUR_API_KEY&url=" & A2), "Screenshot failed")

Troubleshooting

Screenshot not loading

  • Verify your API key is correct
  • Check that the URL is properly formatted with https://
  • Ensure the target website is accessible

Image appears broken

  • The target URL may be invalid or unreachable
  • Your API quota may be exhausted
  • Try adding ENCODEURL() around the URL

Screenshot is outdated

  • Google Sheets caches images
  • Add a timestamp parameter to force refresh: &t= & NOW()
  • Note: This will use an API call on every refresh

“Loading…” appears indefinitely

  • The screenshot is taking too long to generate
  • Try a simpler page or add wait time parameters

Quota running out quickly

  • Each cell with an IMAGE formula uses an API call
  • Reduce the number of active screenshot formulas
  • Consider using the API directly for batch processing

Alternative: Apps Script Integration

For more control, you can use Google Apps Script to fetch screenshots and insert them programmatically. This is useful for:

  • Scheduled screenshot updates
  • Processing large batches
  • Storing screenshots in Google Drive

See our API Reference for endpoint details.


Support

  • API Reference: API Docs
  • Support Email: support@rasterwise.com

Integrate with n8n

Related Docs