Scrape Images from Websites into Google Sheets
BackGuides

Scrape Images from Websites into Google Sheets

Phil
Phil
8 min read

You need 200 product images in a spreadsheet. Here is the fast way.

Competitor research, supplier catalogs, brand monitoring. They all need image URLs. And the usual workflow is brutal. You open a page, right-click an image, copy the URL, paste it into a cell, and repeat. Fifty images later your hand hurts and you still have 150 to go.

SheetMagic has a formula called =GETIMG() that pulls every image URL from a webpage into your sheet. One formula per page. Drag it down a column of URLs and you have a complete image library in minutes.

Formula
=GETIMG(A2)

Returns all image URLs found on the webpage at A2. Each image URL lands in its own row.

That is it. Paste a URL in A2, put the formula in B2, and every image on that page shows up as a clean URL you can use. No browser extensions. No Python scripts. No copy-paste marathon.

This guide covers five practical ways to scrape images from websites into Google Sheets. Product image research, image SEO audits, visual mood boards, batch collection from multiple pages, and working around tricky image loading techniques.

For a broader overview of all scraping tools, see the complete web scraping guide.


Pull every image from a product page

The most common use case is product research. You want to see what images a competitor uses on their product pages. Or you need to catalog images from a supplier's website.

Formula
=GETIMG("https://example-store.com/products/wireless-headphones")

Returns every image URL from the product page. Includes hero images, thumbnails, lifestyle shots, and gallery images.

The formula returns one URL per row. You get the full list of images on that page, from the main product photo down to tiny icons in the footer.

Filter out the noise

Most product pages have navigation icons, social media badges, and footer logos mixed in with the actual product images. You can use =AITEXT() to sort through them.

Formula
=AITEXT("Look at this image URL. Is it a product image or a site UI element like an icon, logo, or badge? Return only: product or ui", B2)

Classifies each image URL as a product image or a UI element. Filter column C for product to keep only the images you care about.

Put this in column C next to your image URLs. Then filter for "product" to get a clean list.

Product image URLs often contain clues like "product," "catalog," or size dimensions (800x800). UI elements tend to have words like "icon," "logo," or "sprite" in their paths. The AI picks up on these patterns quickly.


Build a competitor product image library

This is where image scraping gets really useful. You have a list of competitor product pages and you want to build a visual catalog of their entire product line.

1

Collect competitor product page URLs

Use =SERP() to find competitor product pages, or paste URLs you already have into column A.

Formula
=SERP("wireless headphones site:competitor-store.com")

Pulls product page URLs from a specific competitor's site. Copy the URLs into column A of a new sheet.

2

Scrape images from each page

Formula
=GETIMG(A2)

Extracts all image URLs from the product page. Put in B2 and drag down for each URL in column A.

Each cell will contain multiple image URLs (one per row in the output). You now have raw image data for every product page.

3

Extract image metadata with AI

Formula
=AITEXT("Look at these image URLs from a product page. Pick the one most likely to be the main product hero image (usually the largest, highest resolution image without words like thumbnail or icon). Return only that single URL.", B2)

Identifies the hero product image from the full list. Gives you one clean image per product.

This narrows down each page to a single hero image. Put the formula in column C.

4

Add product context

Formula
=GETMETATITLE(A2)

Pulls the page title, which usually contains the product name. Put in column D for easy reference.

Now you have four columns: URL, all images, hero image, and product name. That is a complete competitor image catalog.

You can try all of this on the free tier. No credit card needed. You get 10 integration credits (one-time trial), enough to scrape images from 10 pages and see how the workflow fits your research process.


Run an image SEO audit on your own site

Images affect your search rankings more than most people realize. Missing alt text, oversized files, and broken image links all hurt your SEO. You can audit all of this from a spreadsheet.

Check which images your pages are using

Formula
=GETIMG(A2)

Returns all image URLs on your page. Put your sitemap URLs in column A and drag the formula down.

Extract alt text with CSS selectors

The =GETSELECTOR() formula lets you target specific HTML attributes. You can use it to pull alt text from every image on a page.

Formula
=GETSELECTOR(A2, "img[alt]")

Returns image elements that have alt attributes. Shows you which images have alt text and what it says.

Find images missing alt text

Formula
=GETSELECTOR(A2, "img:not([alt])")

Returns images without any alt attribute. These are SEO issues you should fix.

Some websites render images using JavaScript after the page loads. If =GETIMG() returns fewer images than you see in your browser, the page might use lazy loading or a JavaScript gallery. Try =VISIT() combined with =AITEXT() as an alternative approach (covered in the next section).

Build the full audit sheet

Here is a complete image SEO audit layout:

  • Column A: Your page URLs (from your sitemap)
  • Column B: =GETIMG(A2) to pull all image URLs
  • Column C: =GETSELECTOR(A2, "img[alt]") to check alt text coverage
  • Column D: =GETSELECTOR(A2, "img:not([alt])") to find missing alt text
  • Column E: =AITEXT("How many images on this page are missing alt text? Count the images in this list: "&D2&". Return only a number.", "") for a quick count

For a deeper SEO audit workflow that includes meta tags, headings, and content analysis alongside images, see the on-page SEO audit guide when it publishes.


Grab Open Graph and social media images

Every well-built webpage has an Open Graph image. That is the image that shows up when you share a link on social media or in Slack. You can pull these with a targeted CSS selector.

Formula
=GETSELECTOR(A2, "meta[property=og:image]")

Extracts the Open Graph image URL. This is the social sharing preview image for the page.

This is great for a few things. You can audit your own site to make sure every page has an OG image. You can check competitors to see what images they use for social sharing. And you can build a visual preview sheet for any list of URLs.

Pull Twitter card images too

Formula
=GETSELECTOR(A2, "meta[name=twitter:image]")

Extracts the Twitter card image URL. Some sites use different images for Twitter than for Open Graph.

Combine everything in one sheet

1

List your URLs

Put your page URLs in column A. These could be your own pages or competitor pages.

2

Pull the page title for context

Formula
=GETMETATITLE(A2)

Gives you the page title in column B so you know what each row represents.

3

Extract the OG image

Formula
=GETSELECTOR(A2, "meta[property=og:image]")

Open Graph image in column C.

4

Count total page images

Formula
=GETIMG(A2)

All images in column D. Count the rows to see how many images each page has.

You now have a social media image audit for every page on your list. Missing OG images mean your pages look plain when shared on social platforms. Finding those gaps takes a few seconds with this setup.


Batch scraping: images from 50+ pages at once

When you need images from dozens of pages, a few practices keep things smooth.

Work in batches of 50. Do not drag the formula down 500 rows at once. Start with 50 URLs. Check the results. Then continue with the next batch. This catches problems early, like a site that blocks automated requests or pages that return no images.

Use IFERROR for resilience. Some pages will fail. Maybe the URL changed, or the site blocks scrapers.

Formula
=IFERROR(GETIMG(A2), "FAILED")

Returns FAILED instead of an error when a page cannot be scraped. Filter for FAILED to find problem URLs.

Take advantage of caching. SheetMagic caches scraping results for 30 minutes. If you need to reprocess results with a different AI prompt, the cached page data gets reused. No extra credits spent on the scraping step.

Combine with VISIT for tricky pages. When =GETIMG() returns incomplete results (usually because of lazy loading), try this approach:

Formula
=AITEXT("From this page content, find and list every image URL. Include URLs from src, data-src, srcset, and background-image properties. Return one URL per line.", VISIT(A2))

Uses AI to find image URLs in the full page text, including lazy-loaded images that basic scraping might miss.

This works because =VISIT() renders the page (including JavaScript) before extracting content. The AI then picks out image URLs from the rendered text.

Each =GETIMG() call uses 1 integration credit. Each =VISIT() call also uses 1 credit. If you combine =VISIT() with =AITEXT(), that is 1 integration credit plus AI tokens. Plan your approach based on what data you need and your remaining credits.


Handling lazy-loaded images and JavaScript galleries

Modern websites often load images lazily. The images only appear in the HTML after you scroll down or click a button. This means a basic scrape might miss some of them.

Here is how SheetMagic handles this.

=GETIMG() catches the most common lazy loading patterns. It reads data-src, data-srcset, and srcset attributes alongside regular src attributes. So most lazy-loaded images still get captured.

JavaScript-rendered galleries are trickier. If a page loads its gallery through a JavaScript framework (React, Vue, or a custom lightbox), the image URLs might not be in the initial HTML at all. For these cases, =VISIT() plus =AITEXT() is your best option. =VISIT() supports JavaScript rendering, so it sees the page after scripts have run.

CDN URL patterns can look strange. Image URLs from content delivery networks often have long query strings, size parameters, or hash values. The URLs are valid even if they look messy. You can use =AITEXT() to clean them up:

Formula
=AITEXT("This is a CDN image URL. Strip any size or quality parameters and return the base image URL at its highest resolution. If you cannot determine the base URL, return the original.", B2)

Cleans up CDN image URLs by removing size constraints and quality parameters.


Three real-world image scraping projects

1. Supplier product catalog

You work with five suppliers. Each has a website with product pages. You want a single spreadsheet with every product image, organized by supplier.

Create one sheet tab per supplier. Put their product page URLs in column A. Run =GETIMG(A2) in column B. Add =GETMETATITLE(A2) in column C for product names. In fifteen minutes you have a visual catalog across all suppliers.

2. Brand image monitoring

You want to know where your product images appear on other websites. Start with a reverse image search or SERP search for your brand name. Put the result URLs in column A. Run =GETIMG(A2) to see what images those pages use. Then use =AITEXT() to check if any of the image URLs match your brand's CDN domain.

Formula
=AITEXT("Do any of these image URLs contain the domain yourbrand.com or your-cdn.com? List the matching URLs. If none match, return NO MATCH.", B2)

Scans image URLs for your brand's domain. Helps you find where your images are being used (or reused).

3. Visual mood board for design projects

You are designing a new landing page and want inspiration. Search for pages in your niche, scrape their hero images, and build a visual reference sheet.

Formula
=GETSELECTOR(A2, "meta[property=og:image]")

Pulls the Open Graph hero image from each inspiration page. OG images are usually the highest-quality visual on the page.

Collect 20 to 30 OG images from top-performing pages in your space. That is your mood board, built in a spreadsheet.


Putting it all together

Image scraping in Google Sheets comes down to three formulas working together:

FormulaWhat it doesBest for
=GETIMG(A2)Pulls all image URLs from a pageProduct catalogs, image audits
=GETSELECTOR(A2, "img[alt]")Targets specific image attributesAlt text audits, OG images
=VISIT(A2) + =AITEXT()AI-powered image extractionLazy-loaded images, metadata extraction

Start with =GETIMG() for most jobs. Move to =GETSELECTOR() when you need specific attributes. Fall back to =VISIT() + =AITEXT() for JavaScript-heavy pages.

Formula
=GETIMG("https://example.com")

Try this now. Replace the URL with any page you want to pull images from.

You can try all of this on the free tier. No credit card needed. You get 10 integration credits (one-time trial), enough to scrape images from 10 pages and see how it fits your workflow.

Install SheetMagic free from the Google Workspace Marketplace and scrape your first image URLs in the next sixty seconds.


More web scraping guides: Complete scraping guide | Extract text and headings | CSS selector scraping | SEO workflows