---
title: "Google Lens API: JSON data, 2 endpoints, 1 credit per call"
description: "Google Lens API at 1 credit per image: visual matches, exact matches and products for an image URL as JSON. Failed calls cost nothing."
url: https://perceptlayer.com/apis/google-lens
---

[APIs](https://perceptlayer.com/apis) / [Search engines](https://perceptlayer.com/verticals/search) / Google Lens

1 credit per call 2 endpoints 4 datapoints 

# Google Lens API

Google Lens API at 1 credit per image: visual matches, exact matches and products for an image URL as JSON. Failed calls cost nothing.

[Get a free API key](https://perceptlayer.com/signup) Run it below

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 OK JSON X-Credits-Used: 1

Recorded from our API and shortened.

Sample data

## What one call returns

A recorded run of `lens`: the fields and shapes you will get, shortened to 3 items.

| # | source string | title string | link url | position integer |
| --- | --- | --- | --- | --- |
| 1 | google.com | Coffee - Wikipedia | https://www.google.com/goto?url=CAESYAHrOzAVjqyZsRw2qYBWnGTQxvo0jp82FNgkFtdeekgdFsMzllECFQuW0N\_YE0jQU21l8peWTBGW9imMZMQnJR97PbsxrAVhJlwl7Y3TiYThovCMSqoX1PYgBXCFNpdxoA | 1 |
| 2 | google.com | Un espresso con carácter: tueste oscuro, aroma a chocolate y ... | https://www.google.com/goto?url=CAESYwHrOzAVNdoGpK3FtZxCqcuZTEUq7d9luEWqqwu14ENvcGHD8sy55sN4m7HGYYUpQ0EeamvXBbXOfY-pkMl80yJ8WBgs9vWiCC9-HhswGQ8J1dWANIdzkP-CGSaRHhITUR8JuA | 2 |
| 3 | google.com | Francisco de la Torre 🥑 على X: "El kopi luwak es un café ... | https://www.google.com/goto?url=CAEScwHrOzAVObEIxcvkJ2s6\_wpYlHV501SbYNAkL8tWkvcU35OuZQKQIzv38dIK9tcN0ZgzbEJoj9j8rkWQqMDHLPRkMELJk3Nytab8SsD0Y4\_qbvsb5IKFoXbVSokCXzprx8ppw1iNE7JIWogUstyAQU8Depo | 3 |

Recorded from our API · 3 items shown · 4 datapoints per item 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

4 datapoints

### Identity

-   title string

### Contact

-   link url

### Other

-   source string
-   position integer

Playground

## Run this API

cURL shell 

```
curl "https://api.perceptlayer.com/v1/google-lens/lens?url=https%3A%2F%2Fupload.wikimedia.org%2Fwikipedia%2Fcommons%2F4%2F45%2FA_small_cup_of_coffee.JPG&type=visual_matches" \
  -H "X-API-Key: $API_KEY"
```

Google Lens · 2 endpoints

## Endpoints

Every endpoint takes the same key. Open one for its parameters, the fields it returns and an example request.

| Endpoint | Required parameters | Returns | Cost |
| --- | --- | --- | --- |
| [GET `/v1/google-lens/lens`](https://perceptlayer.com/apis/google-lens/lens) | `url` +2 optional | `source` `title` `link` `position` | 1 credit |
| [POST `/v1/google-lens/upload`](https://perceptlayer.com/apis/google-lens/upload) | none +4 optional | `source` `title` `link` `position` | 1 credit |

Overview

## About the Google Lens API

## What you can get

The Google Lens API returns Google Lens results for an image as JSON through one endpoint, `lens`. It takes the image `url`, with an optional `q` and `type` (all, products, exact\_matches or visual\_matches).

The recorded call for a photo of a cup of coffee, with `type` visual\_matches, returns `visual_matches`, each with `position`, `title`, `source` and `link`.

## How a call works

Pass a public image URL: `GET /v1/google-lens/lens?url=https://...&type=visual_matches` with your key in the `X-API-Key` header. Every successful call costs 1 credit; failed calls cost nothing.

Search engines JSON REST MCP

### More search engines APIs

[Apple Maps](https://perceptlayer.com/apis/apple-maps) [Baidu](https://perceptlayer.com/apis/baidu) [Bing](https://perceptlayer.com/apis/bing) [Brave Search](https://perceptlayer.com/apis/brave) [DuckDuckGo](https://perceptlayer.com/apis/duckduckgo) [Google Events](https://perceptlayer.com/apis/google-events) [Google Finance](https://perceptlayer.com/apis/google-finance) [Google Forums](https://perceptlayer.com/apis/google-forums) [Google Images](https://perceptlayer.com/apis/google-images) [Google Local](https://perceptlayer.com/apis/google-local) [Google Local Services](https://perceptlayer.com/apis/google-local-services) [Google Maps](https://perceptlayer.com/apis/google-maps)

Use cases

### Find where an image appears on the web

`Use the Google Lens API to find where an image appears on the web` 

### Identify products from a photo

`Use the Google Lens API to identify products from a photo` 

### Check product images for copies on other sites

`Use the Google Lens API to check product images for copies on other sites` 

### Give an agent a way to look up what's in an image

`Use the Google Lens API to give an agent a way to look up what's in an image` 

FAQ

## Questions

**Can I upload an image file?**

The endpoint takes an image \`url\`; it has no upload parameter.

**What does a Google Lens API call cost?**

1 credit per successful call, whichever \`type\` you ask for (all, products, exact\_matches or visual\_matches). Failed calls cost nothing. New accounts get free credits to start, and credit packs bring the price down as you scale.

**What format are responses in?**

Every endpoint returns JSON, with no HTML parsing on your side.

**Is this the official Google Lens API?**

No. Perceptlayer is an independent service and is not affiliated with Google Lens. It returns Google Lens data as JSON with a Perceptlayer key, so there is no Google Lens developer account, app review or partner approval to get first. It only reads data: if Google Lens has an official API and you need to act on your own Google Lens account, such as posting, managing orders or reading private data, use that one.

**Should I build a Google Lens scraper instead?**

You can, but a Google Lens scraper is code you maintain: page changes break it, requests get blocked, and Google Lens's terms govern how you collect data. The Google Lens API gives you 2 endpoints of named JSON fields for 1 credit per successful call, and failed calls cost nothing. A scraper makes sense only for data these endpoints don't return, so check the response in the playground on this page first.

## Try the Google Lens API with 100 free credits

No credit card. Failed calls are never billed.

[Get a free API key](https://perceptlayer.com/signup) [Read the docs](https://docs.perceptlayer.com)
