Endpoints · 09/13
Lens
Visual matches for an image URL — Google Lens, as JSON.
Endpoint
POSThttps://serp-api.ozymoz.com/lensCredits per call3
Parameters
| Name | Description | Default |
|---|---|---|
urlrequired | Image URL (lens) or page URL (webpage). | — |
gl | Country to search from, as a two-letter code (us, tr, de…).Default: us | us |
hl | Interface language, as a language code (en, tr, de…).Default: en | en |
Example request
curl -X POST 'https://serp-api.ozymoz.com/lens' \
-H 'X-API-KEY: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"url": "https://example.com/photo.jpg",
"gl": "us",
"hl": "en"
}'Example response
Illustrative values in the real shape. Top-level keys: organic.
response.json
{
"searchParameters": {
"type": "lens",
"engine": "google",
"url": "https://example.com/photo.jpg",
"gl": "us",
"hl": "en"
},
"organic": [
{
"title": "Photo of the same scene — Example Photos",
"link": "https://www.example-photos.com/scene/123",
"source": "Example Photos",
"thumbnailUrl": "https://encrypted-tbn0.gstatic.com/images?q=tbn:…",
"position": 1
}
],
"credits": 3
}Good to know
Google has to be able to fetch the image; some hosts (e.g. certain Wikimedia URLs) refuse it and return no matches.