APIs / Google Lens / Lens
Google Lens: Lens
Lens from Google Lens as JSON. 1 credit per successful call.
GET /v1/google-lens/lens
Parameters
Send parameters in the query string.
| Parameter | Type | Required | Allowed values |
|---|---|---|---|
url | string | Required | Up to 2,048 characters A public image URL. Google downloads the image itself, so the URL must load for an automated client without a login, hotlink or bot protection. A signed URL should stay valid for at least 10 to 15 minutes. An image Google can't download returns 422 invalid_parameters, not charged. |
q | string | Optional | Up to 500 characters |
type | string | Optional | all, products, exact_matches, visual_matches |
Example request
Google Lens
GET/v1/google-lens/lens?url=https%3A%2F%2Fupload.wikimedia.org%2Fwikipedia%2Fcommons%2F4%2F45%2FA_small_cup_of_coffee.JPG&type=visual_matches
{
"search_parameters": {
"url": "https://upload.wikimedia.org/wikipedia/commons/4/45/A_small_cup_of_coffee.JPG",
"type": "visual_matches"
},
"visual_matches": [
{
"source": "google.com",
"title": "Coffee - Wikipedia",
"link": "https://www.google.com/goto?url=CAESYAHrOzAVjqyZsRw2qYBWnGTQxvo0jp82FNgkFtdeekgdFsMzllECFQuW0N_YE0jQU21l8peWTBGW9imMZMQnJR97PbsxrAVhJlwl7Y3TiYThovCMSqoX1PYgBXCFNpdxoA",
"position": 1
},
{
"source": "google.com",
"title": "Un espresso con carácter: tueste oscuro, aroma a chocolate y ...",
"link": "https://www.google.com/goto?url=CAESYwHrOzAVNdoGpK3FtZxCqcuZTEUq7d9luEWqqwu14ENvcGHD8sy55sN4m7HGYYUpQ0EeamvXBbXOfY-pkMl80yJ8WBgs9vWiCC9-HhswGQ8J1dWANIdzkP-CGSaRHhITUR8JuA",
"position": 2
},
{
"source": "google.com",
"title": "Francisco de la Torre 🥑 على X: \"El kopi luwak es un café ...",
"link": "https://www.google.com/goto?url=CAEScwHrOzAVObEIxcvkJ2s6_wpYlHV501SbYNAkL8tWkvcU35OuZQKQIzv38dIK9tcN0ZgzbEJoj9j8rkWQqMDHLPRkMELJk3Nytab8SsD0Y4_qbvsb5IKFoXbVSokCXzprx8ppw1iNE7JIWogUstyAQU8Depo",
"position": 3
}
]
}200 OKJSONX-Credits-Used: 1
Recorded from our API and shortened.
Run this endpoint in the playground with your own parameters. 1 credit per successful call; failed calls are free.
Response fields
Each item in visual_matches has these 4 fields, read from a recorded call. The recording leaves out fields that were empty, so a live call can return more.
| Field | Type |
|---|---|
source | string |
title | string |
link | url |
position | integer |