Google Images Scraper or API: What You Get
A Google Images scraper is code that runs an image search, reads the results grid and recovers, for each result, the page it came from, the full-size file and its dimensions. The other route is GET /v1/google-images/images, which returns those fields as a JSON array for 1 credit per successful call. A scraper costs upkeep; the endpoint costs credits per query per page. This post compares the two field by field, prices a tracked query, and gives a verdict per job.
Which fields would a scraper have to recover?
Every field a scraper would recover is already a named key in the endpoint's response, so the useful comparison is per field. The table pairs each field with what a scraper has to do to get it. Most of the work sits in three of them: the result's position, the full-size file and its dimensions, because a results grid is built for looking at previews, not for handing over file addresses.
| Field | What it holds (recorded coffee search) |
What a scraper has to do for it |
|---|---|---|
position |
Rank in the results: 1, 2, … |
Count results in page order, and keep counting across pages |
thumbnail |
The preview image URL | Read the preview off the grid |
source |
The site's display name, such as Wikipedia |
Read the label under each preview |
title |
The page title, such as Coffee - Wikipedia |
Read the caption text |
link |
The page the image appears on | Find the destination of each result |
original |
The full-size image file URL | Find the file address, which isn't the preview |
original_width, original_height |
Pixel size of the original, such as 3200 × 2000 |
Find the dimensions, or download the file to measure it |
is_product |
true when the result is flagged as a product |
Detect product markers in the result |
Here is the recorded call and the first two results, trimmed:
curl "https://api.perceptlayer.com/v1/google-images/images?q=coffee" \
-H "X-API-Key: $API_KEY"
[
{
"position": 1,
"thumbnail": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQtHO98ebb559chzTw8eP9ZaeLZwr3h70NaxQ66SUO4_A&s",
"source": "Wikipedia",
"title": "Coffee - Wikipedia",
"link": "https://en.wikipedia.org/wiki/Coffee",
"original": "https://upload.wikimedia.org/wikipedia/commons/e/e4/Latte_and_dark_coffee.jpg?…",
"original_width": 3200,
"original_height": 2000,
"is_product": false
},
{
"position": 2,
…
"source": "InstaCuppa Store",
"title": "Easy Coffee Recipe at Home: Simple Cafe-Style Coffee in 2 Minutes",
"link": "https://instacuppastore.com/blogs/recipes/easy-coffee-recipe-at-home?…",
"original": "https://instacuppastore.com/cdn/shop/articles/blog-easy-coffee-recipe-at-home-cover_ce3809b1-35ce-4721-b2df-d8fc77e8ce20.jpg?…",
"original_width": 1100,
"original_height": 738,
"is_product": true
},
…
]
The two results show why every field matters. The first is a 3200 × 2000 file on one host, shown on a page on another domain. The second is a 1100 × 738 file on a shop's own domain, flagged is_product: true. In both, thumbnail sits on a different host from original, so a scraper that stores only what the grid shows ends up with previews, not the files or the pages behind them.
What goes wrong in a scraper that the response shape avoids?
Most of an image scraper's bugs come from mixing up three things: the preview, the file and the page. Each lives at its own address, and a scraper has to keep them apart through every page change. Add filters, paging and duplicates, and you get the four failure points below. The endpoint removes the parsing side of each; deciding what to do with the files stays with you.
1. Previews stored as images
The visible grid is previews. A scraper that saves what it sees saves small files and no dimensions. The endpoint keeps thumbnail and original as separate fields, with original_width and original_height, so you can filter by size without downloading anything.
2. Filters rebuilt by hand
Size, type, colour and shape filters are clicks in a browser, which a scraper has to turn into requests and keep working when the controls change. On the endpoint they are parameters with fixed values: imgsz (large, medium, icon), imgtype (photo, clipart, lineart, gif, face), imgcolor (color, gray, trans and eleven colours), imgar (tall, square, wide) and safe (active, off). Use only the listed values; a call that fails, for example with invalid_parameters (422), costs nothing.
3. Paging and duplicates
Results arrive in pages, and a scraper has to fetch each page, keep position continuous and drop repeats. The endpoint takes an integer page; how many results one page holds isn't documented, so check it in the playground for your query before you plan a run. De-duplicate on original or link, whichever matches your unit.
4. Silent breakage and blocks
When a page layout changes, a scraper often returns empty fields rather than an error, and a week of blank original values looks like a quiet week. At volume, a large site will also slow or refuse automated requests. If that happens, stop; getting around a site's protections with rotating proxies or CAPTCHA solvers isn't a fix we'd recommend. On the endpoint, a failed call returns an error code and X-Credits-Used: 0.
How do a scraper and the endpoint compare?
A scraper has no per-call bill but owns the fetch, the parsing and the repairs; the endpoint charges 1 credit per successful call and owns none of that on your side. The table assumes a recurring job: the same queries, checked on a schedule. For a single look at one query, a browser is enough and neither route is worth building.
| DIY Google Images scraper | Google Images endpoint | |
|---|---|---|
| Setup | Browser or fetch layer, grid parser, filter mapping, paging | API key in the X-API-Key header |
| Per result | Whatever you can recover from the page | position, thumbnail, source, title, link, original, original_width, original_height, is_product |
| Filters | Rebuilt clicks | imgsz, imgtype, imgcolor, imgar, safe, tbs (up to 500 characters) |
| Language and country | Session or URL settings you manage | hl and gl, two characters each |
| When the page changes | Fields go empty until you fix the parser | You read named JSON fields |
| Blocks | Yours to handle | Not yours; failed calls cost 0 |
| Throughput | As fast as the site tolerates | 1 request a second free, at least 5 a second paid |
| Cost | Hosting and your time | 1 credit per successful call |
| Rights to the images | None granted | None granted |
The last row is the same on both sides on purpose. The endpoint returns data collected from publicly available sources as found at the time of the call. It tells you where an image appears; it doesn't license the file. Before you download or republish anything from original, read the licence on the page in link, and the site's terms.
What does a tracked image query cost?
On the endpoint, cost follows calls: each query, with each filter combination and each page, is 1 call × 1 credit. So the item you price is a query-page, refreshed on a schedule. The useful question is how many variants of each query you need, because filters multiply calls. A colour study across three imgcolor values is three series, not one.
| Plan | Calls a month | Credits a month |
|---|---|---|
| 100 queries, page 1, weekly | 100 × 4 = 400 | 400 |
| 100 queries, pages 1 and 2, weekly | 100 × 2 × 4 = 800 | 800 |
100 queries × 3 imgcolor values, page 1, weekly |
300 × 4 = 1,200 | 1,200 |
| 500 queries, page 1, daily | 500 × 30 = 15,000 | 15,000 |
| 2,000 queries, pages 1 and 2, daily | 2,000 × 2 × 30 = 120,000 | 120,000 |
The 100 free credits on signup cover one weekly run of the first plan. The Starter pack's 10,000 covers each of the first three plans for at least eight months, the 500-query daily run needs the Build pack's 50,000, and the last needs the Growth pack's 200,000. Purchased credits last 12 months, with no subscription. See pricing for what credits cost, and the credits docs for how the X-Credits-Used and X-Credits-Remaining headers report each debit.
How do you track where a site's images rank?
A common recurring job is position tracking: for a list of queries, where do a given site's images appear, and are they flagged as products? The script below runs each query once, finds results whose link is on your domain, and records position, original_width, original_height and is_product to a CSV with the date. It reads only fields in the recorded response.
import csv
import datetime
import os
from urllib.parse import urlparse
import requests
DOMAIN = "instacuppastore.com"
QUERIES = ["coffee", "coffee recipe"]
today = datetime.date.today().isoformat()
with open("image_positions.csv", "a", newline="") as f:
out = csv.writer(f)
for q in QUERIES:
resp = requests.get(
"https://api.perceptlayer.com/v1/google-images/images",
headers={"X-API-Key": os.environ["API_KEY"]},
params={"q": q, "gl": "us", "hl": "en"},
timeout=30,
)
resp.raise_for_status()
hits = [
r for r in resp.json()
if urlparse(r["link"]).hostname
and urlparse(r["link"]).hostname.endswith(DOMAIN)
]
if not hits:
out.writerow([today, q, "", "", "", ""])
for r in hits:
out.writerow([today, q, r["position"], r["original_width"],
r["original_height"], r["is_product"]])
print(q, len(hits), "hits, credits left",
resp.headers.get("X-Credits-Remaining"))
A row with an empty position records that the domain wasn't on the page that day, which a tracker needs as much as the hits. The script stores no image files, only positions and sizes. Add a retry that waits for Retry-After on 429 and 503, and see the errors docs for the full list of codes.
Which route fits your job?
Choose by what you'll keep from each result. If you keep metadata and pointers, the endpoint covers it at 1 credit a query-page. If you need the files themselves, both routes leave the licensing question with you, and a licensed image library may fit better than any search.
- Image position tracking for a site or brand: use the endpoint on a weekly schedule and store
position,linkandis_product. 100 queries weekly is 400 credits a month. - Product visibility in image results: filter on
is_productand record whichsourcevalues show up for your product queries. - Building a shortlist of candidate images: use
imgsz=largeandimgtype=photo, keeporiginal_width,original_heightandlink, then clear each image with its owner before you use it. - A training set or archive of image files: neither a scraper nor a search result grants rights to the files. Use a licensed source or images you own.
- An agent that needs to cite where an image appears: give it the endpoint through the MCP server;
call_endpointspends credits only on success. The AI agents docs cover setup. - Learning how scraping works: build against a practice site, not a search engine.
If you're also tracking web results, Rank Tracking API: Track Google Positions as JSON covers positions in regular search, and the search engines APIs page lists the rest. To check the fields for your own queries, run the Images endpoint in the playground on the Google Images API page, then get a free API key.
APIs in this post
Frequently asked questions
Is scraping Google Images allowed?
That depends on Google's terms, the terms of the sites whose images appear, and the law where you operate, so read them and take legal advice for commercial use. Don't work around blocks or challenges. Collecting result metadata and links is a different question from copying image files, which are usually someone else's work.
Can I download the images the endpoint returns?
The endpoint returns URLs, not files. original points to the full-size file on its host, and link to the page that shows it. Downloading or republishing a file is your own request to someone else's site, and a search result doesn't license it. Check the licence on the link page first.
How many results does one call return?
The page size isn't documented, so don't build on a fixed number. The recorded coffee call returns an array starting at position 1, and the page parameter takes an integer for later pages. Run your query in the playground to see how many results come back before you plan credits per result.
Does a failed Google Images call cost credits?
No. Only a successful response debits credits. A failed call returns an HTTP status and a JSON body with a code, a message and a request_id, plus X-Credits-Used: 0. Bad parameters return invalid_parameters (422). Rate-limited responses (429) carry a Retry-After header with the seconds to wait.
How fast can I run a daily image query list?
Limits are per account, shared by all its keys, and counted per minute. A free account gets 1 request a second (60 a minute), so 500 queries take a little over eight minutes. Paying accounts run at least 5 a second (300 a minute), and the rate limits docs list each pack's rate.