Google Lens lets you search the web using an image instead of text. Point it at a product, a plant, a landmark, or a screenshot, and it returns visual matches, source links, and related content in seconds.
That’s powerful on its own. But what if you need to do this at scale? Manually running images through Google Lens one by one isn’t viable when you’re building a price comparison tool, training an image classifier, or monitoring how your product images appear across the web. You need to scrape Google Lens programmatically, and that’s exactly what this guide covers.
In this tutorial, you’ll learn how to scrape Google Lens using Python and Scrapingdog’s Google Lens API. The API handles JavaScript rendering, CAPTCHAs, and IP rotation on the backend so you get clean JSON results without fighting Google’s bot detection.
By the end, you’ll be able to pass any image URL to the API and extract titles, source domains, links, and thumbnails from Google Lens results in a few lines of Python.
What Can You Do with Google Lens Scraped Data?
Scraped Data from Google Lens can be used in various places:
- For the identification of products from images for price comparisons, or inventory management.
- In training machine learning models for image classification, facial and object recognition.
- To search for related products similar to the object in the image on the internet.
- To create interactive applications that can identify objects in the surroundings and provide information about them.
Why Use Scrapingdog to Scrape Google Lens?
No CAPTCHA Headaches- Google aggressively blocks automated requests. Scrapingdog handles CAPTCHA solving at the backend so your requests go through without interruption.
Rotating Proxies Built-In- Every request is routed through a large pool of residential and datacenter proxies. No IP bans, no manual proxy management on your end.
Clean JSON Output- Results come back as structured JSON — no HTML parsing, no XPath selectors, no fragile regex. Just the data you can use immediately.
Real-Time Results- The API returns live Google Lens data, not cached snapshots. What you get reflects what Google Lens returns at the time of the request.
Simple Integration- One GET request with two parameters, your API key and the image URL. Works with any language that can make an HTTP call.
Prerequisites
You’ll need the following before writing any code:
- Python 3.x is installed on your machine.
You can learn web scraping with Python as well, before moving ahead with this blog.
- A Scrapingdog account to get 1,000 free API credits, no credit card required.
- Basic familiarity with Python and the
requestslibrary
Project Setup
Create a project folder and navigate into it:
mkdir lens && cd lens
Now install the only dependency you’ll need:
pip install requests
requests handles the HTTP call to Scrapingdog’s API endpoint. That’s the only external library this tutorial requires.
Getting Your API Key
Once you’ve signed up, your API key is available on the dashboard. Copy it, you’ll need it in the next step.
How to Scrape Google Lens with Python
For this example, we’ll use an image of a Blakiston’s Fish Owl. One of the rarest owl species on the planet, native to the Russian Far East. It’s a good test case because it’s obscure enough that Google Lens has to work hard to identify it, which makes the results more interesting to inspect.
We’re trying to extract the data shown in the image below. This is the default search.

Start by importing the requests library:
import requests
Now build the API call. Pass your API key and the image URL as query parameters:
payload = {
'api_key': 'YOUR_API_KEY',
'url': 'https://lens.google.com/uploadbyurl?url=https://www.oiseaux-birds.com/strigiformes/strigides/ketoupa-blakiston/ketoupa-blakiston-aa2.jpg'
}
resp = requests.get('https://api.scrapingdog.com/google_lens', params=payload)
data = resp.json()
print(data["lens_results"])
Replace YOUR_API_KEY with the key from your Scrapingdog dashboard. If you skip this, the API will return a 401 error. You can even copy this code directly from the dashboard.

Run the script, and you’ll get a response like this:
{
"lens_results": [
{
"position": 1,
"title": "Plumage Collection of Photo Prints and Gifts",
"source": "natureplprints.com",
"source_favicon": "https://encrypted-tbn0.gstatic.com/favicon-tbn?q=tbn:ANd9Gc...",
"link": "https://www.natureplprints.com/galleries/plumage",
"thumbnail": "https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9Gc..."
},
{
"position": 2,
"title": "Toud-pesketaer rous - Wikipedia",
"source": "wikipedia.org",
"source_favicon": "https://encrypted-tbn3.gstatic.com/favicon-tbn?q=tbn:ANd9Gc...",
"link": "https://br.wikipedia.org/wiki/Toud-pesketaer_rous",
"thumbnail": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9Gc..."
}
]
}
Each result in lens_results is a visual match Google found for the image. Here’s what each field gives you:
position — Rank of the result in Google Lens output
title — Page title of the matched source
source — Domain name of the matching website
source_favicon — Favicon URL of the source domain
link — Direct URL to the matched page
thumbnail — Google-cached thumbnail of the matched image
You will also get the AI Overview section within the JSON.

Scraping Exact Matches from Google Lens
Now, if you want to scrape the Exact Matches with the API, then you have to use the exact_matches parameter of the API. It is a boolean parameter, and you just have to set it to true.
import requests
url = "https://api.scrapingdog.com/google_lens"
params = {
"api_key": "YOUR_API_KEY",
"url": "https://www.oiseaux-birds.com/strigiformes/strigides/ketoupa-blakiston/ketoupa-blakiston-aa2.jpg",
"country": "us",
"exact_matches": "true"
}
response = requests.get(url, params=params)
print(response.json())
Once you run this, you will get the JSON data based on an exact match from Google Lens.

Scraping Visual Matches from Google Lens

For scraping visual match from Google Lens, you have to use the visual_matches parameter.
import requests
url = "https://api.scrapingdog.com/google_lens"
params = {
"api_key": "YOUR_API_KEY",
"url": "https://www.oiseaux-birds.com/strigiformes/strigides/ketoupa-blakiston/ketoupa-blakiston-aa2.jpg",
"country": "us",
"visual_matches": "true"
}
response = requests.get(url, params=params)
print(response.json())
Scrapingdog handles JavaScript rendering, CAPTCHA solving, and IP rotation on the backend. So this call works reliably at scale without you managing any proxy infrastructure.
Saving Google Lens Results to a CSV File
Printing results to the terminal is fine for testing, but in practice, you’ll want to store them. Here’s how to save the full lens_results output to a CSV file using pandas.
First, install pandas if you haven’t already:
pip install pandas
Now update your script to import pandas and save the results:
import requests
import pandas as pd
payload = {
'api_key': 'YOUR_API_KEY',
'url': 'https://lens.google.com/uploadbyurl?url=https://www.oiseaux-birds.com/strigiformes/strigides/ketoupa-blakiston/ketoupa-blakiston-aa2.jpg'
}
resp = requests.get('https://api.scrapingdog.com/google_lens', params=payload)
data = resp.json()
results = data["lens_results"]
df = pd.DataFrame(results)
df.to_csv("lens_results.csv", index=False)
print(f"Saved {len(results)} results to lens_results.csv")
Running this script will produce a lens_results.csv file in your project folder.
Key Takeaways
- The blog explains what Google Lens is and how it enables visual-based search using images instead of text queries.
- It highlights why scraping Google Lens is challenging due to heavy JavaScript rendering and strict bot-detection mechanisms.
- The article shows how using a scraping API simplifies Google Lens data extraction by handling rendering, headers, and blocking issues.
- It demonstrates how image-based search results can be programmatically collected for analysis, research, and automation workflows.
- The post emphasizes real-world use cases such as visual product research, image-based SEO insights, and competitive analysis.
Additional Resources
- Scrape Google Images using Python
- Web Scraping Google Search Results
- Web Scraping Google Scholar
- Web Scraping with Python (A Comprehensive Guide)
- Web Scraping Google Shopping using Python
- Web Scraping Google Patents using Python
- Web Scraping Google News using Python
- Web Scraping Google Maps using Python
- Scrape Google Scholar Using Python
- How to scrape Google AI Overviews using Python
- How to Scrape Google AI Mode Using Python

