Google Lens Scraper avatar

Google Lens Scraper

Pricing

from $1.99 / 1,000 results

Go to Apify Store
Google Lens Scraper

Google Lens Scraper

Google Lens Scraper runs reverse image search on any image URL and returns visual matches, extracted text and result counts across search types. πŸ”Ž Use it for product matching, counterfeit detection, OCR and visual competitor research.

Pricing

from $1.99 / 1,000 results

Rating

0.0

(0)

Developer

Scrapers Hub

Scrapers Hub

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

5 days ago

Last modified

Share

πŸ”Ž Google Lens Scraper – Reverse Image Search, Visual Match & OCR Extraction

The Google Lens Scraper runs your images through Google Lens and returns the reverse image search results as structured JSON β€” matching page URLs, their titles, and the visible text Google reads off the image. Point it at one or more public image URLs and it opens a real browser session on a residential proxy, submits the image to Google Lens, and parses the response into dataset records you can query, join and store.

Reverse image search is one of the few data sources that lets you start from a picture rather than a keyword. That makes this Google Lens scraper useful for brand protection teams tracking where a product photo has been republished, e-commerce researchers finding which retailers list a given item, journalists verifying where an image first appeared, and anyone who needs OCR text pulled out of screenshots and photographs at scale.


πŸ“Š What Data Can You Extract with This Google Lens Scraper?

Every dataset item records which Lens view produced it and which source image it came from. The fields below are everything the actor writes.

CategoryFieldsWhat it gives you
🧭 Record typeviewWhich Lens view the record represents β€” the requested search type, ocr, or globalErrors for images that could not be processed
πŸ–ΌοΈ Source imageimageUrlThe public image URL you submitted, so results always trace back to their input
πŸ”— Match resultsresultsThe array of matches found for the image, each entry carrying href and title
πŸ”’ Result volumeresultsCountHow many matches were parsed for that image and view
πŸ“ Text extractiontextThe visible text read from the Lens page for the image, returned on ocr records
⚠️ Failure detailerrorThe reason an image could not be processed, on records where view is globalErrors

The field that does the most work is results. Each entry is a { "href": ..., "title": ... } pair pointing at a page where the image β€” or something visually close to it β€” was found. Deduplicating href values across a batch of product photos is often the fastest way to build a list of sites republishing your imagery.


🌟 Key Features of the Google Lens Scraper

FeatureDescription
πŸ–ΌοΈ Batch image processingSubmit many image URLs in one run; each is processed in turn and tagged with its imageUrl in the output
πŸ” Automatic retry on blocksmaxRetriesPerImage opens a fresh browser session on a new residential proxy IP each time Google throws a CAPTCHA or JS challenge
🌐 Configurable residential proxyproxyConfiguration is fully user-configurable and defaults to Apify's RESIDENTIAL group, which is what Google Lens realistically requires
πŸ—‚οΈ Multiple search viewssearchTypes accepts all, exact-match, visual-match and ocr, and one run can emit records for several views at once
πŸ“ Built-in OCR viewRequesting ocr returns the visible text read from the image in the text field, no separate OCR service needed
🌍 Language controlThe language field sets the Lens result locale (en, fr, bn and so on) so you can compare results across markets
πŸ› Debug HTML captureWith saveDebugHtmlOnFailure on, blocked or empty-parse pages are saved to the key-value store for inspection
🧾 Errors kept in the datasetImages that fail after all retries are written as globalErrors records with an error message rather than silently dropped
🎭 Real browser renderingThe scraper drives an actual browser rather than issuing bare HTTP requests, which is necessary for Lens to respond at all

πŸš€ Why Choose This Google Lens Scraper?

Purpose-built for Google's anti-automation defences. Google aggressively challenges automated traffic on Search and Lens. This actor treats that as the normal case rather than an exception: each retry gets a brand new browser session on a fresh residential IP, and the retry budget is yours to set through maxRetriesPerImage.

Every result traces back to its source image. Because imageUrl is written on every record β€” including error records β€” you can submit a hundred images in a single run and still reconcile every row back to the exact input that produced it. No positional matching, no guesswork.

OCR and reverse image search from one submission. Including ocr in searchTypes alongside a match view means one Lens session produces both the visible text and the matching pages. That halves the work when you are processing screenshots, product packaging or documents.

Transparent failure handling. Blocked images become globalErrors records with a readable error string, and the raw page HTML is preserved in the key-value store when saveDebugHtmlOnFailure is enabled. When something goes wrong you get evidence, not an empty dataset.


πŸ“₯ Input

{
"searchTypes": ["all"],
"imageUrls": [
{ "url": "https://upload.wikimedia.org/wikipedia/commons/thumb/e/e9/Felis_silvestris_silvestris_small_gradual_decrease_of_quality.png/200px-Felis_silvestris_silvestris_small_gradual_decrease_of_quality.png" }
],
"language": "en",
"maxRetriesPerImage": 5,
"saveDebugHtmlOnFailure": true,
"proxyConfiguration": {
"useApifyProxy": true,
"apifyProxyGroups": ["RESIDENTIAL"]
}
}

πŸ”§ Google Lens Scraper Input Fields

FieldTypeRequiredDefaultDescription
searchTypesarrayβœ… Yes["all"]Which Google Lens result types to extract. Implemented values are all, exact-match, visual-match and ocr. translate-ocr, ai-mode, products and homework are not implemented yet in this version
imageUrlsarrayβœ… Yesprefilled example imagePublic URLs of images to run through Google Lens
languagestringNo"en"Language for Google Lens results (e.g. en, fr, bn)
maxRetriesPerImageintegerNo5Google frequently blocks automated requests with a CAPTCHA/JS challenge. Each retry opens a fresh browser session on a new residential proxy IP
saveDebugHtmlOnFailurebooleanNotrueWhen a run gets blocked or the parser finds nothing, save the raw page HTML to the key-value store so it can be inspected and used to improve the parser
proxyConfigurationobjectNo{"useApifyProxy": true, "apifyProxyGroups": ["RESIDENTIAL"]}Google aggressively blocks datacenter IPs for Search/Lens. Residential proxy is effectively required

πŸ’‘ Input Examples

Reverse image search on a single product photo

{
"searchTypes": ["all"],
"imageUrls": [{ "url": "https://cdn.example.com/products/chair-front.jpg" }],
"language": "en"
}

OCR only β€” pull text out of screenshots

{
"searchTypes": ["ocr"],
"imageUrls": [
{ "url": "https://cdn.example.com/screenshots/invoice-01.png" },
{ "url": "https://cdn.example.com/screenshots/invoice-02.png" }
]
}

Batch run with a higher retry budget and a French locale

{
"searchTypes": ["visual-match", "ocr"],
"imageUrls": [
{ "url": "https://cdn.example.com/img/a.jpg" },
{ "url": "https://cdn.example.com/img/b.jpg" },
{ "url": "https://cdn.example.com/img/c.jpg" }
],
"language": "fr",
"maxRetriesPerImage": 10,
"proxyConfiguration": {
"useApifyProxy": true,
"apifyProxyGroups": ["RESIDENTIAL"]
}
}

πŸ“€ Output

A match record produced for a requested search view:

{
"view": "all",
"imageUrl": "https://cdn.example.com/products/chair-front.jpg",
"resultsCount": 2,
"results": [
{
"href": "https://shop.example.org/living-room/lounge-chair",
"title": "Lounge Chair – Oak and Wool"
},
{
"href": "https://blog.example.net/2024/interiors-roundup",
"title": "Twelve chairs worth the money"
}
]
}

An OCR record for the same image:

{
"view": "ocr",
"imageUrl": "https://cdn.example.com/products/chair-front.jpg",
"text": "LOUNGE CHAIR OAK / WOOL MADE IN PORTUGAL"
}

An error record when an image could not be processed:

{
"view": "globalErrors",
"imageUrl": "https://cdn.example.com/products/broken.jpg",
"error": "Blocked by Google after all retries"
}

🧾 Google Lens Output Fields

FieldTypeDescription
viewstringThe Lens view this record belongs to β€” the requested search type, ocr, or globalErrors
imageUrlstringThe source image URL this record was produced from
resultsarrayMatches parsed from the Lens response; each entry has href and title
resultsCountintegerNumber of matches in results
textstringVisible text extracted from the page for the image, present on ocr records
errorstringError message, present when the image failed to process

Note that resultsCount and results appear on match records, text appears on ocr records, and error appears on globalErrors records. Filter on view before reading the rest of the row.


πŸ’» How to Use the Google Lens Scraper (Step by Step)

Step 1: Prepare publicly reachable image URLs

The Google Lens scraper submits image URLs to Lens, so every image must be fetchable from the public internet without a login, signed URL or IP allowlist. Images sitting behind a private CDN rule, an S3 bucket policy or a corporate VPN will not work. If your source images are private, upload copies to a public bucket or use Apify's key-value store to host them before the run.

Step 2: Choose your search types

searchTypes is required and defaults to ["all"]. Use all when you want the broadest set of matches, exact-match or visual-match when you want to think in terms of Lens's own result tabs, and ocr when you want the text read off the image. You can request several at once β€” each requested view produces its own dataset record per image, all sharing the same imageUrl.

Step 3: Set the language

The language field controls the locale Lens responds in and defaults to en. If you are researching a specific market, set it to that market's code β€” fr, de, es, bn and so on. Running the same images at two different language settings and comparing the results arrays is a practical way to see how visibility differs by region.

Step 4: Configure the residential proxy

proxyConfiguration is the single most important setting for a successful run. It defaults to Apify Proxy with the RESIDENTIAL group, which is what Google Lens effectively requires. Datacenter IPs are challenged almost immediately. Unless you have a specific reason to change it, leave the default in place β€” and if you supply a custom configuration, make sure it resolves to residential exit nodes.

Step 5: Tune the retry budget

maxRetriesPerImage defaults to 5, and each retry opens a completely fresh browser session on a new proxy IP. For small, high-value batches it is worth raising this to 10 or more so that a temporary block does not cost you a result. For large exploratory batches, keep it lower so the run does not spend all its time fighting one stubborn image.

Step 6: Run and check the log

Start the run. The log prints a line per image as it is processed, and warns when the parser finds zero results. If saveDebugHtmlOnFailure is enabled, the raw HTML for those empty parses is written to the key-value store under a debug-empty-parse-* key β€” open it to see whether you were served a challenge page or a genuinely empty result set.

Step 7: Read the dataset by view

In the Dataset tab, filter or group by view first. Match records carry resultsCount and results; OCR records carry text; globalErrors records carry error. Export to JSON if you want the nested results array intact, or flatten to CSV if you only need one row per match URL.


πŸ”Œ API Access & Integrations

Run the Google Lens scraper over HTTP and get dataset items back in the same call:

curl -X POST "https://api.apify.com/v2/acts/scrapers-hub~google-lens-scraper/run-sync-get-dataset-items?token=YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"searchTypes": ["all"],
"imageUrls": [{ "url": "https://cdn.example.com/products/chair-front.jpg" }],
"language": "en",
"maxRetriesPerImage": 5,
"proxyConfiguration": { "useApifyProxy": true, "apifyProxyGroups": ["RESIDENTIAL"] }
}'

With the Python client:

from apify_client import ApifyClient
client = ApifyClient("YOUR_TOKEN")
run = client.actor("scrapers-hub/google-lens-scraper").call(run_input={
"searchTypes": ["all", "ocr"],
"imageUrls": [
{"url": "https://cdn.example.com/img/a.jpg"},
{"url": "https://cdn.example.com/img/b.jpg"},
],
"language": "en",
"maxRetriesPerImage": 8,
"proxyConfiguration": {"useApifyProxy": True, "apifyProxyGroups": ["RESIDENTIAL"]},
})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
if item["view"] == "ocr":
print(item["imageUrl"], "->", item.get("text"))
elif item["view"] == "globalErrors":
print("FAILED:", item["imageUrl"], item.get("error"))
else:
for match in item.get("results") or []:
print(match["href"], match.get("title"))

Results can also be routed into Zapier, Make, Google Sheets or Slack, or delivered to your own service using an Apify webhook on run completion.


πŸ’‘ Best Use Cases for Google Lens Data

πŸ›‘οΈ Brand Protection and Image Theft Detection

Submit your own product photography and campaign creative, then review the href values in results. Any domain you do not recognise is a candidate for unlicensed reuse. Because each record carries imageUrl, you can run a full asset library through the Google Lens scraper and produce a per-asset infringement list rather than checking images one at a time.

πŸ›’ E-commerce Product Matching

Retailers and marketplaces often list the same item using the manufacturer's press photo. Reverse image searching that photo surfaces the competing listings in results, complete with page title, which is usually enough to identify the retailer and product name without visiting each page. It is a fast route to a price-comparison shortlist.

πŸ“° Image Provenance and Fact-Checking

Journalists and OSINT researchers use reverse image search to find where a photograph appeared previously. Sorting the results array by domain and cross-referencing publication dates helps establish whether an image is genuinely new or recycled from an earlier event. The text field from an ocr record adds any captions or watermarks burned into the picture.

πŸ“„ Bulk OCR for Screenshots and Documents

Requesting the ocr view turns the actor into a batch text-extraction pipeline. Feed it screenshots, scanned notices, product packaging or signage photos and read the text field from each record. Because imageUrl is preserved, extracted text stays joined to its source file with no extra bookkeeping.

🎨 Visual Content Discovery and Trend Research

Designers and content teams can submit a reference image and use results to find visually similar pages across the web. The combination of href and title gives enough context to triage which matches are worth opening, and resultsCount gives a rough signal for how visually distinctive an image is.

🌍 Cross-Market Visibility Comparison

Run the same image set twice with different language values and compare the results arrays. Divergence between locales tells you which markets already surface your imagery and which do not β€” useful input for localisation and international SEO planning.

πŸ” Duplicate Asset Auditing in Large Libraries

Media teams sitting on tens of thousands of assets can use reverse image search to find where their own images already live online, including on their own subdomains and partner sites. Deduplicating href across a batch produces a distribution map of an asset library that no internal DAM report can give you.


βš™οΈ Tips for Better Google Lens Scraping Results

  • Keep the residential proxy default. Google Lens challenges datacenter IPs almost immediately. If you override proxyConfiguration, make sure the replacement is residential, or expect most images to end up as globalErrors.
  • Raise maxRetriesPerImage for small, important batches. Each retry is a fresh session on a fresh IP, so a higher budget genuinely improves the hit rate when you only have a handful of images that matter.
  • Verify image URLs are public before running. A signed or expiring URL that works in your browser may already be dead by the time Lens fetches it. Test with an incognito window or a plain curl.
  • Leave saveDebugHtmlOnFailure enabled while you are tuning. The saved HTML is the only reliable way to distinguish "Google blocked us" from "Lens genuinely returned nothing for this image".
  • Batch in moderate sizes. Very large image lists in a single run take longer and give you less granular restart points. Several medium runs are usually easier to manage and re-run selectively.
  • Filter on view before parsing. The three record shapes carry different fields. Reading results on an ocr record or text on a match record will simply give you nothing.

πŸ› οΈ Troubleshooting

All my images came back as globalErrors. This is almost always a proxy problem. Confirm proxyConfiguration uses Apify Proxy with the RESIDENTIAL group. Datacenter and free proxies are blocked by Google Search and Lens very quickly. Raising maxRetriesPerImage helps at the margin, but it cannot compensate for the wrong IP type.

The run finished but results is empty and resultsCount is 0. Either Lens genuinely found no matches for that image, or the page returned was a challenge rather than a result set. With saveDebugHtmlOnFailure on, open the debug-empty-parse-* entry in the key-value store β€” a CAPTCHA page is immediately recognisable and means you should retry with a higher retry budget.

I asked for products or ai-mode and got nothing. Those views, along with translate-ocr and homework, are not implemented in this version. Only all, exact-match, visual-match and ocr produce records; unrecognised values are dropped and the run falls back to all.

The text field is empty on my OCR records. The OCR view returns the visible text from the Lens page for that image. Low-resolution images, heavily stylised type, or photographs with no legible text will produce little or nothing. Try a higher-resolution version of the same image.

Nothing ran and the log says no image URLs were provided. imageUrls expects a list of objects with a url key, matching the request-list format shown in the input examples. A plain array of bare strings will not be picked up.


❓ Frequently Asked Questions About Google Lens Scraping

What does the Google Lens Scraper do? It submits public image URLs to Google Lens through a real browser session and returns the reverse image search results β€” matching page URLs and titles in results, plus optional OCR text in text β€” as structured dataset records.

Do I need a Google account or API key? No. The actor drives Google Lens through a browser session on a residential proxy. You only need your Apify token to start runs via the API.

Can I search using an image file from my computer? Not directly. The input takes URLs, so the image must be hosted somewhere publicly reachable first. Uploading to a public bucket or Apify's key-value store and passing that URL is the usual workaround.

Why is a residential proxy required for the Google Lens scraper? Google aggressively blocks datacenter IP ranges on Search and Lens with CAPTCHA and JavaScript challenges. Residential exit nodes look like ordinary consumer traffic, which is why the default proxyConfiguration uses the RESIDENTIAL group.

How many images can I process in one run? There is no fixed cap in the input schema β€” imageUrls is a list and each entry is processed in turn. Practical batch size depends on how long you want the run to take and how much retry budget you have allocated per image.

What is the difference between exact-match and visual-match? They correspond to different Google Lens result views: exact matches of the same image versus visually similar imagery. Both are written as records with the same field shape, distinguished by the view value.

Can the Google Lens scraper extract text from images? Yes. Include ocr in searchTypes and each image produces a record with view set to ocr and the extracted text in the text field.

Does it work in languages other than English? Yes. Set language to the locale code you want, such as fr or bn. This changes the locale Lens responds in, which can change both the results and their titles.

What happens to images that fail? They are written to the dataset as records with view set to globalErrors, carrying the source imageUrl and a human-readable error message. Nothing is silently dropped.

How do I debug an empty result set? Keep saveDebugHtmlOnFailure at its default of true. The raw HTML of the page that produced zero results is saved to the run's key-value store, so you can inspect whether you were served a challenge or a genuine no-match page.

Can I get the price or seller of a matched product? Not in this version. The parser returns href and title for each match. If you need commercial detail, use the returned URLs as input to a scraper for that specific site.

Is the output the same for every search type? Match views (all, exact-match, visual-match) produce resultsCount and results. The ocr view produces text. Error records produce error. Always branch on view when parsing.

Can I schedule recurring reverse image searches? Yes. Save the input and use Apify's Scheduler to re-run it on a cadence β€” a common pattern for brand protection, where you want to know when new sites start hosting your imagery.

How do I export the Google Lens results? Use the dataset export options in the Apify Console (JSON, CSV, Excel, XML) or call run-sync-get-dataset-items to receive the items directly in the API response. JSON is recommended because results is a nested array.

Does this scraper collect anything beyond what Google Lens shows? No. It returns what the Lens response contains for the images you submit β€” matching page URLs, their titles, and the visible text on the page. It does not access any private or authenticated source.


πŸ†˜ Support & Feedback

Hit a bug, an unhandled edge case, or a parsing gap? Open a ticket in the Issues tab on the actor page, and include the image URL and run ID so the problem can be reproduced quickly.

Need a customised build β€” additional Lens views, a different output shape, or integration with your own asset pipeline? Email scraperhubapi@gmail.com with the details.

If the Google Lens scraper is useful to you, a rating and a short review on the actor page genuinely helps and guides what gets improved next.


βš–οΈ Disclaimer

This Google Lens scraper retrieves only publicly available reverse image search results for images you supply. It does not bypass authentication, access private galleries, or retrieve anything a normal Google Lens user could not see.

You are responsible for how you use this actor and the data it produces. That includes having the right to submit the images you process, complying with Google's terms of service, and complying with the terms of any site you subsequently visit or scrape based on the returned URLs.

Where images or extracted text contain personal data β€” faces, names, addresses or other identifiers β€” you act as the data controller for whatever you store, and you must handle it in accordance with GDPR, CCPA and any other privacy regulation applicable to you. Reverse image search on photographs of identifiable individuals carries particular privacy risk; make sure you have a lawful basis before doing it.

If you believe data collected through this actor should be removed, contact scraperhubapi@gmail.com with the details and the request will be addressed.