Google Lens
Google Lens: Lens
Lens from Google Lens. Costs 1 credit per successful call.
GET
https://api.perceptlayer.com
/
v1
/
google-lens
/
lens
Lens
curl --request GET \
--url https://api.perceptlayer.com/v1/google-lens/lens \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.perceptlayer.com/v1/google-lens/lens"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.perceptlayer.com/v1/google-lens/lens', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://api.perceptlayer.com/v1/google-lens/lens';
const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.perceptlayer.com/v1/google-lens/lens"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.perceptlayer.com/v1/google-lens/lens",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}require 'uri'
require 'net/http'
url = URI("https://api.perceptlayer.com/v1/google-lens/lens")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_bodyHttpResponse<String> response = Unirest.get("https://api.perceptlayer.com/v1/google-lens/lens")
.header("X-API-Key", "<api-key>")
.asString();{
"endpoint": "google-lens.lens",
"params": {
"url": "https://upload.wikimedia.org/wikipedia/commons/4/45/A_small_cup_of_coffee.JPG",
"type": "visual_matches"
},
"response": {
"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
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}1 credit per successful call; failed calls are free. See the Google Lens API overview for every Google Lens endpoint.
Authorizations
Query Parameters
Maximum string length:
2048Maximum string length:
500Available options:
all, products, exact_matches, visual_matches Was this page helpful?
⌘I
Lens
curl --request GET \
--url https://api.perceptlayer.com/v1/google-lens/lens \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.perceptlayer.com/v1/google-lens/lens"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.perceptlayer.com/v1/google-lens/lens', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://api.perceptlayer.com/v1/google-lens/lens';
const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.perceptlayer.com/v1/google-lens/lens"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.perceptlayer.com/v1/google-lens/lens",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}require 'uri'
require 'net/http'
url = URI("https://api.perceptlayer.com/v1/google-lens/lens")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_bodyHttpResponse<String> response = Unirest.get("https://api.perceptlayer.com/v1/google-lens/lens")
.header("X-API-Key", "<api-key>")
.asString();{
"endpoint": "google-lens.lens",
"params": {
"url": "https://upload.wikimedia.org/wikipedia/commons/4/45/A_small_cup_of_coffee.JPG",
"type": "visual_matches"
},
"response": {
"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
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}