Google Lens Mobile 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.
The main difference is that mobile API returns higher resolution images and has a different layout compared to the desktop API. The mobile API has 4 different tabs of results: all
(DEFAULT), exact_matches
, visual_matches
, and products
.
Changelog (Desktop vs Mobile Layout)
- [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.
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
-
Device must be set to
mobile
to use this engine.
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 (default tab)
Integration tips:
- Google Lens returns larger images on mobile devices. Check
image
key. - Changing
country
parameter changes results and prefers that country currency.
https://www.searchapi.io/api/v1/search?device=mobile&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",
"device": "mobile",
"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": "Amazon.com: Trends International Harry Potter and the Sorcerer's Stone - Candles One Sheet Wall Poster, 22.375\" x 34\", Premium Print and Beechwood Hanger Bundle: Posters & Prints",
"link": "https://www.amazon.com/Trends-International-Harry-Potter-Sorcerers/dp/B08L4B26J2",
"image": {
"link": "https://m.media-amazon.com/images/I/815UJXwu2bL.jpg",
"height": 1800,
"width": 1152
},
"source": "Amazon.com",
"price": "$40*",
"extracted_price": 40,
"currency": "USD",
"stock_information": "In stock",
"thumbnail": "https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcSI1W2xzTH3wQgNnJtudjtD_fwMHR9IwHDLVM1jXBFaF30Qqxjl"
},
...
],
"related_searches": [
{
"title": "Harry Potter and the Sorcerer's Stone",
"link": "https://www.google.com/search?sca_esv=a70c56ff7b649c8e&hl=en&q=Harry+Potter+and+the+Sorcerer%27s+Stone&kgmid=/m/03176f&sa=X&ved=2ahUKEwj3kOHq9K6KAxVfEFkFHT9SODkQ9_gLKAB6BAhdEAE",
"thumbnail": "data:image/jpeg;base64,..."
},
...
]
}
Search Type - Products
https://www.searchapi.io/api/v1/search?device=mobile&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",
"device": "mobile",
"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",
"thumbnail": "https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcQMYZXyriisfp_xRZlRAwViRY3-fqJ8vgpzKuxm856lOK5Z9YWT"
},
...
{
"position": 3,
"title": "Highland Dunes Wiebe Folding Wooden Side Table & Reviews | Wayfair",
"link": "https://www.wayfair.com/outdoor/pdp/highland-dunes-tywonne-square-236-l-x-236-w-outdoor-dining-table-w000294216.html",
"image": {
"link": "https://assets.wfcdn.com/im/27526687/resize-h400-w400^compr-r85/1917/191704989/default_name.jpg",
"height": 400,
"width": 400
},
"source": "Wayfair",
"price": "$134*",
"extracted_price": 134,
"currency": "USD",
"stock_information": "In stock",
"thumbnail": "https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcTHlm38yn3RO-7GngQAeqKBi-W31VqMp-xXBcNTIG5rDJpXcZDX"
},
...
]
}
Search Type - Visual Matches
https://www.searchapi.io/api/v1/search?device=mobile&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",
"device": "mobile",
"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?device=mobile&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",
"device": "mobile",
"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": "Free Shipping! Straight Talk Apple iPhone 15 Pro Max, 1TB, Black",
"link": "https://www.walmart.com/ip/Straight-Talk-Apple-iPhone-15-Pro-Max-1TB-Black-Prepaid-Smartphone/5059752586",
"source": "Walmart",
"price": "$1,499.00",
"extracted_price": 1499.0,
"currency": "USD",
"stock_information": "In stock",
"thumbnail": "data:image/png;base64,...",
"extensions": ["$1,499.00", "In stock", "264x264"]
},
...
]
}