Google Lens Search API

Google Lens Search API

Our Google Lens API allows you to scrape results from the Google Lens page when performing an image search. The results related to the image could contain visual matches and other data.

The API is accessed through the following endpoint: /search?engine=google_lens

Api Details

Endpoint GET https://serpapi.abcproxy.com/search

Description Retrieve comprehensive user profile including basic info, account status and optional permission sets.


Request

HTTP Request

curl -X GET "https://serpapi.abcproxy.com/search" \
  -d "engine=google_lens" \
  -d "url=https://i.imgur.com/HBrB8p0.png" \
  -d "no_cache=false" \
  -d "api_key=YOUR_API_KEY"

API Parameters

Search Query

Name
Type
Required
Description
Example

url

string

Yes

Parameter defines the URL of an image to perform the Google Lens search.

https://i.imgur.com/HBrB8p0.png

Geographic Location

Name
Type
Required
Description
Example

hl

string

No

Akan-ak

country

string

No

Benin-bj

Serpapi Parameters

Name
Type
Required
Description
Example

engine

string

Yes

Set parameter to google_lens to use the Google Lens API engine.

google_lens

no_cache

boolean

No

Parameter will force SerpApi to fetch the Google Lens results even if a cached version is already present. A cache is served only if the query and all parameters are exactly the same. Cache expires after 1h. Cached searches are free, and are not counted towards your searches per month. It can be set to false (default) to allow results from the cache, or true to disallow results from the cache. no_cache and async parameters should not be used together.

trueorfalse

api_key

string

Yes

Parameter defines the SerpApi private key to use.

YOUR_API_KEY


Response

Success 200

Response Body

{
  "code": 200,
  "search_metadata":
    {				 
        "raw_html_file":"https://webserp.abcproxy.com/files/670bafd55f489382/66a89f7f-1e72-4524-92a4-12f18e277db0.html",
        "xray_html_file":"https://webserp.abcproxy.com/files/670bafd55f489382/66a89f7f-1e72-4524-92a4-12f18e277db0.xray",
        "total_time_taken":"8.6289",
        "id":"66a89f7f-1e72-4524-92a4-12f18e277db0",
        "json_endpoint":"https://webserp.abcproxy.com/files/670bafd55f489382/66a89f7f-1e72-4524-92a4-12f18e277db0.json",
        "created_at":"2025-04-03 11:51:03",
        "google_lens_url":"https://lens.google.com/uploadbyurl?url=https%3A%2F%2Fi.imgur.com%2FHBrB8p0.png",
    },
  "search_parameters":
    {
        "engine":"google_lens",
        "api_key":"YOUR_API_KEY",
        "url":"https://i.imgur.com/HBrB8p0.png",
        "reviews":true,
		"no_cache":true,
    },
    "visual_matches":
    [
        {
        "link":"/search?sca_esv=e93cf3ca433b1dba&lns_surface=26&udm=48&si=APYL9buGmpQYpE633.....0nX2w5/VcNChQI//9k=",
        "image_width":"206",
        "image_height":"245",
        "position":1,
        "title":"Danny DeVito - Wikipedia",
        },
        .....
    ],
}

Response Fields

Name
Type
Remark

search_metadata

object

Contains timing and status information

search_parameters

object

Contains query parameters and search context

visual_matches

object []

visual matching

exact_matches

object []

exact match

Error Responses

Common Errors

HTTP Status
Error Code
Description

200

400

API Key can not be empty

200

401

Param error

200

402

API Key error

200

403

Insufficient Balance

200

404

Deduction failed

200

405

Failed to record usage count

200

406

Unsupported engine

200

407

Network error

200

408

File not found

200

409

Limit param error

200

410

Build url error

200

411

Failed to QueryRecentRecord

200

412

Failed to find json

200

413

Get html error

200

414

HTML is empty

200

429

Too many request

Error Example

{
  "code": 400,
  "message": "API Key can not be empty"
}

Last updated