Menu

Build a filtered image dataset from Google Images with Python or Node
📰

Build a filtered image dataset from Google Images with Python or Node

DEV Community: javascript·Big Man·about 9 hours ago
#H3i2ZoRB
#devtojavascript#devto#dev#google#imagewidth
Reading 0:00
15s threshold

Google Images is a good place to collect reference pictures, product shots or training images, but downloading results one by one doesn't scale, and the full-size image URL and dimensions aren't on the results page. This tutorial builds a small, filtered image dataset from Google Images in a few lines of Python or Node. You get a CSV of large landscape photos, each with its full-size URL, width, height and source page.

It uses Google Images Scraper , an Apify actor I built. ( An earlier post covers the basics; this one is about filtering.) I ran both scripts below end to end before publishing.

The idea

Ask Google Images for large photos only, using the actor's imageSize and imageType filters (the same filters as Google's Tools menu).

Each result already includes imageWidth and imageHeight , so you can filter by exact size or orientation without downloading anything.

Save what's left to CSV or JSON, with the source page for attribution.

Input

{ "queries" : [ "lighthouse watercolor" ] ,…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.