Google Lens API
The Google Lens API, accessible via the /api/v1/search?engine=google_lens
endpoint, enables real-time scraping of visual search results. This powerful tool transforms images into actionable insights.
Use the Google Lens API engine for tasks such as:
- Recognizing landmarks, objects, or animals.
- Extracting and translating text from images.
- Discovering shopping products from photos.
- Finding similar and exactly same images.
Changelog (New vs Old Layout)
On 2025-01-02, Google Lens transitioned its desktop interface to the new layout. Support for the updated layout was added within an hour.
- [BREAKING] Google has updated the layout for the Google Lens engine. It now has 4 different tabs of results, accessible via a new request parameter:
search_type
. The available options are:all
(DEFAULT),exact_matches
,visual_matches
, andproducts
. - [BREAKING] The keys
visual_matches.exact_price
is no longer supported. - [NEW] A new key,
exact_matches.extensions
, has been added.
API Parameters
Search Query
-
- Name
-
url
- Required
- Required
- Description
-
Parameter defines the image url. This is the direct link to the image you want Google Lens to analyze. Ensure the URL points to a valid image format (e.g., .jpg, .png) and is accessible publicly.
-
- Name
-
q
- Required
- Optional
- Description
-
Specifies the text query to be searched alongside the image. The
q
parameter is only applicable whensearch_type
is set toall
,visual_matches
, orproducts
.
Localization
-
- Name
-
hl
- Required
- Optional
- Description
-
The default parameter
en
defines the interface language of the search. Check the full list of supported Googlehl
languages.
-
- Name
-
country
- Required
- Optional
- Description
-
Two-letter country code to tailor results to a specific location. Defaults to
US
. Check the full list of supported Google Lenscountry
codes.
Shopping results in Google Lens API are available in Austria, Australia, Belgium, Brazil, Canada, Chile, Colombia, Czech Republic, Denmark, France, Germany, India, Indonesia, Ireland, Italy, Japan, Malaysia, Mexico, Netherlands, New Zealand, Norway, Philippines, Poland, Portugal, Russia, Singapore, South Africa, South Korea, Spain, Sweden, Switzerland, Turkey, UAE, United Kingdom, and United States.
Device
-
- Name
-
device
- Required
- Optional
- Description
-
The default parameter
desktop
defines the search on a desktop device. Themobile
parameter defines the search on a mobile device. Google Lens is not available on tablets.
Filters
-
- Name
-
search_type
- Required
- Optional
- Description
-
The
search_type
parameter allows you to filter the search results. Supported values areall
,products
,visual_matches
, andexact_matches
.
Engine
-
- Name
-
engine
- Required
- Required
- Description
-
Parameter defines an engine that will be used to retrieve real-time data. It must be set to
google_lens
.
API key
-
- Name
-
api_key
- Required
- Required
- Description
-
The
api_key
authenticates your requests. Use it as a query parameter (https://www.searchapi.io/api/v1/search?api_key=YOUR_API_KEY
) or in the Authorization header (Bearer YOUR_API_KEY
).
API Examples
Search Type - All
Integration tips:
- Changing
country
parameter changes results and prefers that country currency.
https://www.searchapi.io/api/v1/search?engine=google_lens&search_type=all&url=https%3A%2F%2Fupload.wikimedia.org%2Fwikipedia%2Fen%2F7%2F7a%2FHarry_Potter_and_the_Philosopher%2527s_Stone_banner.jpg
- Python
- Node
- Ruby
- Java
- Go
- PHP
- Bash
- R
- Kotlin
- Swift
- C#
- C
- C++
- requests
import requests
url = "https://www.searchapi.io/api/v1/search"
params = {
"engine": "google_lens",
"search_type": "all",
"url": "https://upload.wikimedia.org/wikipedia/en/7/7a/Harry_Potter_and_the_Philosopher%27s_Stone_banner.jpg"
}
response = requests.get(url, params=params)
print(response.text)
{
"visual_matches": [
{
"position": 1,
"title": "Harry Potter movie poster The Philosopher's Stone movie poster - 12 x 16 inches | eBay",
"link": "https://www.ebay.com/itm/392735195626",
"image": {
"link": "https://i.ebayimg.com/images/g/fhQAAOxyA4ZRXbWi/s-l1200.jpg",
"height": 702,
"width": 956
},
"source": "eBay",
"price": "$14*",
"extracted_price": 14,
"currency": "USD",
"stock_information": "In stock",
"thumbnail": "https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcS8fH3fwLVC8JK_l7VvEYd1o40bJH2khbmNYHPPmXU1s75YQGqr"
},
...
],
"related_searches": [
{
"title": "Harry Potter and the Sorcerer's Stone",
"link": "https://lens.google.com/search?sca_esv=dfa57c05b4e3cad6&hl=en&q=Harry+Potter+and+the+Sorcerer%27s+Stone&kgmid=/m/03176f&sa=X&ved=2ahUKEwi0vqn33teKAxXAMlkFHWHrH-0Q9_gLKAB6BAhpEAE",
"thumbnail": "data:image/jpeg;base64,..."
},
...
]
}
Search Type - Products
https://www.searchapi.io/api/v1/search?engine=google_lens&search_type=products&url=https%3A%2F%2Fi.ibb.co%2FDrdLBQf%2F1683889779-anaclui-75ed8c7f027b6d0e7aedeed7b1b3fd94-2.jpg
- Python
- Node
- Ruby
- Java
- Go
- PHP
- Bash
- R
- Kotlin
- Swift
- C#
- C
- C++
- requests
import requests
url = "https://www.searchapi.io/api/v1/search"
params = {
"engine": "google_lens",
"search_type": "products",
"url": "https://i.ibb.co/DrdLBQf/1683889779-anaclui-75ed8c7f027b6d0e7aedeed7b1b3fd94-2.jpg"
}
response = requests.get(url, params=params)
print(response.text)
{
"visual_matches": [
{
"position": 1,
"title": "Raelyn All Weather Wicker Outdoor End Table - World Market",
"link": "https://www.worldmarket.com/p/raelyn-all-weather-wicker-outdoor-end-table-597247.html",
"image": {
"link": "https://images.dashhudson.com/aHR0cHM6Ly9jZG4uZGFzaGh1ZHNvbi5jb20vbWVkaWEvZnVsbC8xNjgzNDk4NzU3LjM3ODIyMzQyMjQzNy5qcGVn.jpg?w=400&h=400&fit=cover",
"height": 400,
"width": 400
},
"source": "World Market",
"price": "$130*",
"extracted_price": 130,
"currency": "USD",
"stock_information": "Out of stock",
"thumbnail": "https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcQMYZXyriisfp_xRZlRAwViRY3-fqJ8vgpzKuxm856lOK5Z9YWT"
},
...
]
}
Search Type - Visual Matches
https://www.searchapi.io/api/v1/search?engine=google_lens&search_type=visual_matches&url=https%3A%2F%2Fi.ibb.co%2F12qRDsk%2Ftower.png
- Python
- Node
- Ruby
- Java
- Go
- PHP
- Bash
- R
- Kotlin
- Swift
- C#
- C
- C++
- requests
import requests
url = "https://www.searchapi.io/api/v1/search"
params = {
"engine": "google_lens",
"search_type": "visual_matches",
"url": "https://i.ibb.co/12qRDsk/tower.png"
}
response = requests.get(url, params=params)
print(response.text)
{
"visual_matches": [
{
"position": 1,
"title": "Sheer Window Curtain Paris Tower - PIXERS.HK",
"link": "https://pixers.hk/sheer-window-curtains/paris-tower-48878913",
"image": {
"link": "https://img.pixers.pics/pho_wat(s3:700/FO/48/87/89/13/700_FO48878913_be6ca6191cc09f681cd2c5ab7e99ac1a.jpg,467,700,cms:2018/10/5bd1b6b8d04b8_220x50-watermark.png,over,247,650,jpg)/sheer-window-curtains-paris-tower.jpg.jpg",
"height": 700,
"width": 467
},
"source": "pixers.hk",
"price": "$120*",
"extracted_price": 120,
"currency": "USD",
"stock_information": "In stock",
"thumbnail": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTnZlkvd-QIGB3JKe7Ao6NGxFmN0gHrri38SFEgO1DKBvD17AGD"
},
...
]
}
Search Type - Exact Matches
https://www.searchapi.io/api/v1/search?engine=google_lens&search_type=exact_matches&url=https%3A%2F%2Fstore.storeimages.cdn-apple.com%2F4982%2Fas-images.apple.com%2Fis%2Fiphone-15-pro-finish-select-202309-6-1inch-bluetitanium%3Fwid%3D2560%26hei%3D1440%26fmt%3Dp-jpg%26qlt%3D80%26.v%3D1692846360609
- Python
- Node
- Ruby
- Java
- Go
- PHP
- Bash
- R
- Kotlin
- Swift
- C#
- C
- C++
- requests
import requests
url = "https://www.searchapi.io/api/v1/search"
params = {
"engine": "google_lens",
"search_type": "exact_matches",
"url": "https://store.storeimages.cdn-apple.com/4982/as-images.apple.com/is/iphone-15-pro-finish-select-202309-6-1inch-bluetitanium?wid=2560&hei=1440&fmt=p-jpg&qlt=80&.v=1692846360609"
}
response = requests.get(url, params=params)
print(response.text)
{
"exact_matches": [
{
"position": 1,
"title": "Apple iPhone 15 Pro Max 17 cm (6.7\") Doppia SIM iOS 17 5G USB ...",
"link": "https://www.ebay.com/itm/196027442194",
"source": "eBay",
"price": "€1,700.90",
"extracted_price": 1700.9,
"currency": "EUR",
"stock_information": "In stock",
"thumbnail": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAAABLUlEQVR4Ae3WJUADYRjG8UMzDpmCJNyl4ZpxSbhrQ9viGu4Oc+8BJ7KCR5y2vXzPrOCypS/8J2e/8zshu63ApXHw3ZpbWkKR08G2trZS1hrrBNl+lzoDBNbMugPU2tYmQjYUw5r/Fewersi0LXha3FUYYh+O3xiGcZjm30D71rx33DDMvtV/Ao1J6XH2xvtrDdWNYyrfuqNYe/cbfo4wHmErx1RBEehH4FVMUjjr6SY6gZA6o8ocWa42CfUnZKnCSCQT6GXLzdL5lmCalPmaR1XBhMZUwU9Afw1qMyopokJDH4GX2140pfCn74Mc5CAHOYinwF9BLOPbIGLQwm9BkSpw5VePp73kYjFgfEeUayQMs1ZxKmGg5HnLXcJAyeW2twQIYls3yN/a/jUOvgKkonKBWnbPogAAAABJRU5ErkJggg==",
"extensions": ["€1,700.90", "In stock", "400x400"]
},
...
]
}
Search Type - Products with Query
https://www.searchapi.io/api/v1/search?engine=google_lens&q=eBay&search_type=products&url=https%3A%2F%2Fstore.storeimages.cdn-apple.com%2F4982%2Fas-images.apple.com%2Fis%2Fiphone-15-pro-finish-select-202309-6-1inch-bluetitanium%3Fwid%3D2560%26hei%3D1440%26fmt%3Dp-jpg%26qlt%3D80%26.v%3D1692846360609
- Python
- Node
- Ruby
- Java
- Go
- PHP
- Bash
- R
- Kotlin
- Swift
- C#
- C
- C++
- requests
import requests
url = "https://www.searchapi.io/api/v1/search"
params = {
"engine": "google_lens",
"search_type": "products",
"q": "eBay",
"url": "https://store.storeimages.cdn-apple.com/4982/as-images.apple.com/is/iphone-15-pro-finish-select-202309-6-1inch-bluetitanium?wid=2560&hei=1440&fmt=p-jpg&qlt=80&.v=1692846360609"
}
response = requests.get(url, params=params)
print(response.text)
{
"visual_matches": [
{
"position": 1,
"title": "Apple iPhone 14 Pro - 128GB - Space Black (Unlocked) For Any Carrier Worldwide | eBay",
"link": "https://www.ebay.com/itm/126833666037",
"image": {
"link": "https://i.ebayimg.com/00/s/MTYwMFgxMjg3/z/h0oAAOSwEfxlqJsc/$_57.JPG?set_id=880000500F",
"height": 1600,
"width": 1287
},
"source": "eBay",
"thumbnail": "https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcSFSYaObhohtjZcSdLx2q6CRrB4xERE4eXO-5L1ul_HY5neNncC"
},
...
]
}