Download Google Images results in bulk, with original URLs and sizes

· All my Apify Actors

Download Google Images results in bulk, with original URLs and sizes

Google Images is the quickest way to find a few hundred pictures of anything. It's also awkward to get them out: right-click gives you a thumbnail, and the full-size file, its dimensions and the page it came from are a click or two further in. If you're building a dataset for a vision model, looking for Creative Commons photos, or checking which sites use your product shots, you want all of that as rows.

I built a scraper that turns a Google Images search into one row per image, with the original file's URL and size. Here's what I learned about Google's image results along the way.

What to watch for

Getting the data

I packaged this as an Apify Actor, Google Images Scraper. An image from a "red sports car" search comes back like this (trimmed):

{
  "id": "yY7DDXRl0uutDM",
  "position": 2,
  "page": 1,
  "query": "red sports car",
  "imageUrl": "https://static0.carbuzzimages.com/wordpress/wp-content/uploads/2024/09/mazda-rx-7-front.jpg",
  "width": 1920,
  "height": 1080,
  "thumbnailWidth": 738,
  "thumbnailHeight": 414,
  "title": "10 Red Sports Cars That Shouldn't Be Painted Any Other Color",
  "sourcePageUrl": "https://carbuzz.com/red-sports-cars-that-shouldnt-be-painted-any-other-color/",
  "sourceDomain": "carbuzz.com",
  "sourceName": "CarBuzz",
  "fileSize": "300KB",
  "fileSizeBytes": 307200,
  "dominantColor": "#f8788b",
  "resultType": "image",
  "isLicensable": false,
  "licenseUrl": null,
  "creditText": null,
  "storedImageUrl": null
}

Where Google shows them, isLicensable, licenseUrl, licenseDetailsUrl, creator and creditText tell you the licence page and how to credit the image. Large Creative Commons landscape photos:

curl -X POST "https://api.apify.com/v2/acts/rjmacarthy~google-images-scraper/run-sync-get-dataset-items?token=YOUR_APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "queries": ["mountain landscape"],
    "usageRights": "creativeCommons",
    "size": "large",
    "maxItems": 100
  }'

The other filters are color (including transparent and blackAndWhite), type (clipart, lineart, animated), time (day to year) and safeSearch. country and language set which Google results you get. A 100-image search is a single page request, so it finishes in seconds; each page takes about 3 to 30 seconds and pages run in parallel.

Saving the originals

Turn on downloadImages and the scraper also saves each full-size file to the run's key-value store:

{
  "queries": ["golden retriever puppy"],
  "maxItems": 20,
  "downloadImages": true
}
  1. Each row gets a storedImageKey and a storedImageUrl pointing at its saved file.
  2. Download them from the key-value store, or fetch storedImageUrl from your own pipeline.
  3. Check downloadError for the ones the source site wouldn't hand over. You're only charged for images actually saved.

Images are usually protected by copyright, so check the licence on the source site before you reuse one. usageRights narrows the search, but the source page is what counts.

Pricing

Pay per result, no run fee and no monthly rental:

Platform compute is included in those prices. On the free Apify plan each run is limited to 5 result pages, about 500 images. Any paid plan removes the limit. You can also set a maximum cost per run and the Actor stops cleanly when it's reached.

It reads public Google Images results only, with no login, and collects no personal contact data.