# Google Lens API: Reverse Image Search & OCR (`mu0i/google-lens-api`) Actor

Google Lens API for reverse image search. Send image URLs, uploads or base64 and get one row per image: similar images with their pages and prices, exact matches, web results, and OCR text with word boxes and translation. Pay per search type you pick; images that fail are free.

- **URL**: https://apify.com/mu0i/google-lens-api.md
- **Developed by:** [Mu0i](https://apify.com/mu0i) (community)
- **Categories:** E-commerce, AI, Developer tools
- **Features:** Limited permissions
- **Stats:** 5 total users, 3 monthly users, 92.4% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.20 / 1,000 visual matches

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

This **Google Lens API** runs a **reverse image search** on any image and returns what Google Lens
shows as data: **visually similar images with the pages they are on, exact matches, web results,
product prices, and the text in the image (OCR)** with a box for every word. You get one row per
image and **pay only for the search types you pick, from $1.20 per 1,000 images**. Images that fail
are free.

The easiest way to try it: click **Start** with the prefilled input to search one sample photo.

### What can this Google Lens API do?

- **Reverse image search in bulk.** Send hundreds of images in one run and get the similar images
  Google Lens finds, each with its page, source site, image URL and size.
- **Find where an image is used.** Brand, copyright and marketplace teams check which pages carry a
  photo or a near-copy of it.
- **Match products and compare sellers.** Send product photos and get the shops showing the same
  item, with the price on each match where Google shows one.
- **Read text from images (OCR).** Signs, labels, screenshots and scans become text with word
  positions, optionally translated.
- **Take images any way you have them.** Public links, files uploaded to Apify, or base64 straight
  from your code. No public URL is needed.
- **Give an AI agent eyes on the web.** One call turns an image into structured matches.
- **No browser, so no minutes-long waits.** Each image is a few network requests, not a rendered
  page, so it comes back in seconds rather than the minutes a browser-based scraper can take.

### What data does Google Lens return?

Choose any of these under **What to return**:

| Search type | Output field | What is in it |
|---|---|---|
| `visual-match` | `visualMatches` | Similar images: `title`, `link` (the page), `source`, `imageUrl` (the image as hosted there), `width`, `height`, `price` and `currency` where the match shows one, and `linkIsRedirect` |
| `exact-match` | `exactMatches` | Pages from Google's exact-matches tab: `title`, `link`, `source`, `linkIsRedirect` |
| `all` | `webResults` | Pages about what is in the image |
| `products` | `products` | Only the matches that show a price: `title`, `price`, `currency`, `link`, `vendor`, `imageUrl`, `linkIsRedirect` |
| `ocr` | `text`, `words` | The text, and each word with `top`, `left`, `width`, `height` (0–1 of the image) and `rotation` |
| `translate-ocr` | `translation` | That text translated: `sourceLanguage`, `targetLanguage`, `text` |

On any reverse-image run the row also carries `regions`: what Google Lens detected in your image,
each with a `label`, a Knowledge Graph `entityId` when Lens tied it to one, a `box` (`cx`, `cy`,
`width`, `height`, `rotation`, all 0–1, centre-based), and `wholeImage`. Lens answers both with
located objects and with "the subject is the whole picture" — `wholeImage` is `true` for the latter,
so filter on `!wholeImage` when you want only the located ones. `regions` is `null` if the image
never got far enough to report any. Regions come free with the search — no extra charge.

Every row also has `status` (`ok`, `partial`, `failed`, or `skipped` for an image the run never
searched, e.g. when your maximum charge was reached first, with `error` saying why), `error`, `notAnswered`, `matchCount`,
`topMatchTitle`, `topMatchLink`, `charged`, and `index`, the image's place in your input. Rows are
stored as images finish, so sort by `index` to get your input order back. Each match's `link` is the
destination's own address: we read it out of Google's redirect wrapper, so you don't get a
`google.com/url?…` link to unwrap. `linkIsRedirect` flags the rare link that is still a Google hop
(note a page that merely lives on a Google property, like Books or Arts & Culture, is a real
destination and is not flagged).

### How to use the Google Lens API

1. Open the actor and add your images: paste links, upload files, or point to a key-value store.
2. Under **What to return**, tick the search types you want. Each is priced on its own.
3. Optionally set the result language, the country, and a language to translate text into.
4. Click **Start**. Each image becomes one row as soon as it is answered.
5. Download the results as JSON, CSV or Excel, or read them through the API.

| Input | Use it when |
|---|---|
| **Image URLs** (`imageUrls`) | The image is online. The actor downloads it itself, so the link only has to open without a login. |
| **Base64** (`imagesBase64`) | The file is on your machine and you call the API. Raw base64 or a `data:` URI. Apify caps a run's input at about 9 MB, so this suits a handful of images; for more, use a key-value store. |
| **Your key-value stores** (`imageKvsStores`) | The files are on Apify. Choose the stores: every image in them is searched. |
| **Key-value store records** (`imageKvsRecords`) | Only some records of a store, by key. The store must also be chosen in `imageKvsStores`, because Apify lets the actor read only the stores you choose there. |

JPEG, PNG, WebP, GIF, AVIF, TIFF and SVG are read, up to 20 MB each. Images are turned upright and
sized the way the Google app sends them, so you don't have to prepare anything.

### How much does the Google Lens API cost?

You pay per search type, per image, and **only when that search type returned something**: at
least one match, some text, a translation. Pick one and you pay for one. Prices per 1,000 images:

| Search type | Free | Starter | Scale | Business and up |
|---|---|---|---|---|
| **Visual matches** (`visual-match`) | $1.50 | $1.50 | $1.35 | **$1.20** |
| **Exact matches** (`exact-match`) | $1.50 | $1.50 | $1.35 | **$1.20** |
| **Products** (`products`) | $1.50 | $1.50 | $1.35 | **$1.20** |
| **Web results** (`all`) | $1.00 | $1.00 | $0.90 | **$0.80** |
| **Text / OCR** (`ocr`) | $2.50 | $2.50 | $2.25 | **$2.00** |
| **Text with translation** (`translate-ocr`) | $3.50 | $3.50 | $3.15 | **$2.80** |
| A search type that failed or found nothing, or an image that couldn't be read | free | free | free | free |

Plus Apify's actor-start fee of $0.00005 per run. There is no charge per match, however many
come back.

- **1,000 images, visual matches only**: Starter **$1.50**, Business **$1.20**.

- **1,000 product photos, visual matches + products**: Starter **$1.50**, Business **$1.20**. Products are included with visual matches.

- **1,000 photos, exact matches, of which 400 have none**: you pay for 600, Starter **$0.90**.

- **5,000 screenshots, OCR only**: Starter **$12.50**, Business **$10.00**.

- **100 links of which 12 are dead, visual matches**: you pay for 88 images, **$0.13**.

- **Nothing found, nothing charged.** An image with no exact matches, no text or no prices costs
  nothing for that search type. `charged` in each row lists what was charged.

- **Products are included with visual matches.** The prices are already on the visual matches, so
  `products` is charged only on images where visual matches were not.

- `translate-ocr` returns the text as well as its translation, so you don't need `ocr` beside it.

Set a *maximum charge* for the run and the actor stops before the image that would pass it.

**Free Apify plan:** a run searches at most 10 images (it ends normally and says so). Ten images
with visual matches cost $0.015, so the monthly free credit covers many trial runs.

### Google Lens API input and output example

Input:

```json
{
  "imageUrls": [{ "url": "https://example.com/tower.jpg" }],
  "searchTypes": ["visual-match"],
  "language": "en"
}
```

Output, one row per image (one of 59 matches shown):

```json
{
  "image": "https://example.com/tower.jpg",
  "status": "ok",
  "visualMatches": [
    {
      "position": 1,
      "title": "Tour Eiffel Wikimedia Commons.jpg",
      "link": "https://vi.wikipedia.org/wiki/Tập_tin:Tour_Eiffel_Wikimedia_Commons.jpg",
      "source": "vi.wikipedia.org",
      "imageUrl": "https://thumb.wikimedia.org/wikipedia/commons/thumb/a/a8/Tour_Eiffel_Wikimedia_Commons.jpg/960px-Tour_Eiffel_Wikimedia_Commons.jpg",
      "width": 960,
      "height": 1777,
      "linkIsRedirect": false
    }
  ],
  "regions": [
    { "label": "SalientRegion-Top", "entityId": "/m/02j81", "wholeImage": false, "box": { "cx": 0.5, "cy": 0.45, "width": 0.62, "height": 0.76, "rotation": 0 } }
  ],
  "matchCount": 59,
  "topMatchTitle": "Tour Eiffel Wikimedia Commons.jpg",
  "topMatchLink": "https://vi.wikipedia.org/wiki/Tập_tin:Tour_Eiffel_Wikimedia_Commons.jpg",
  "charged": ["visual-match"]
}
```

### Use the Google Lens API from code

```bash
curl -X POST "https://api.apify.com/v2/acts/mu0i~google-lens-api/run-sync-get-dataset-items?token=$APIFY_TOKEN" \
  -H "content-type: application/json" \
  -d '{ "imageUrls": [{ "url": "https://example.com/photo.jpg" }], "searchTypes": ["visual-match", "ocr"] }'
```

```python
import base64
from apify_client import ApifyClient

client = ApifyClient("<APIFY_TOKEN>")
image = base64.b64encode(open("photo.jpg", "rb").read()).decode()
run = client.actor("mu0i/google-lens-api").call(run_input={
    "imagesBase64": [image],
    "searchTypes": ["visual-match", "exact-match"],
})
for row in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(row["image"], row["matchCount"], row["topMatchLink"])
```

It also works through Apify's integrations with Make, n8n, Zapier and Google Sheets, and as a tool
for AI agents through Apify's MCP server.

### Switch from another Google Lens scraper

The input names match `borderline/google-lens` (`imageUrls`, `imagesBase64`, `imageKvsRecords`,
`searchTypes`, `translateLanguage`, `language`), so an existing input runs unchanged. Three differences:

- `ai-mode` and `homework` are not available. They are skipped with a note and never charged.
- A store on your account named in `imageKvsRecords` must also be chosen in `imageKvsStores`, so
  that Apify lets the actor read it.
- The output is one flat row per image with the fields above, not one object per search type.

### Reverse image search limits

- **Exact matches are broad, and often empty.** Google's exact-matches tab mixes pages that carry
  the image with pages about it, and those entries have no titles. Treat it as leads to check, not
  as proof. Many images have none at all; those cost nothing.
- **Products are the matches with a price.** Google Lens no longer has a separate product list; a
  price now appears on some of the matches. In our test from a US address, 15 of 60 matches had
  one for a photo of earbuds, and 3 of 60 for a shoe and for a stand mixer. Images of things that
  aren't for sale return none. Prices appear as Google shows them, with their currency sign and
  no conversion, and depend on the country the search runs from: set *Result country*.
- **Visual matches already include those prices** in `price`. Add `products` when you want only
  the priced ones as their own list; it costs nothing extra beside visual matches.
- **Results change between runs.** Two searches of the same image a day apart share most links, not all.
- **No AI answers.** Lens's AI mode is not part of this actor.
- **Don't use it to identify people** from photos of them.

### More actors by this developer

| Actor | Use it with Google Lens to |
|---|---|
| [Google Maps Scraper](https://apify.com/mu0i/google-maps-scraper) | get the business behind a shopfront or product you matched |
| [Email Verifier](https://apify.com/mu0i/email-verifier) | check the contact addresses of the sites that use your images |
| [TikTok Shop Scraper](https://apify.com/mu0i/tiktok-shop-scraper) | collect product photos to match against other shops |

### FAQ

#### Is it legal to use Google Lens for reverse image search?

Searching with an image and reading the publicly shown results is generally lawful in many
countries. What you do with the results is your responsibility: images you find remain their
owners' copyright, and photos of people are personal data, which needs a lawful basis to process
(for example under the GDPR). Do not use this actor to identify people. This is not legal advice.

#### Is this an official Google Lens API?

No. Google offers no public Lens API. This actor reads the results Google Lens shows and is not
affiliated with or endorsed by Google.

#### How fast is the Google Lens API?

The actor starts no browser — that is what makes browser-based scrapers slow, and minutes-long runs
and timeouts are the most common complaint about them. Each image is a few network requests rather
than a full page render, so it answers in seconds, not minutes. Extra search types that each need
their own results page, and larger batches (which are paced to stay reliable), take proportionally
longer. A run that reaches its timeout can be resurrected to continue where it stopped.

#### Do I need a proxy or any other paid service?

No. The actor needs no proxy, no browser and no API key of yours, and it uses no Apify proxy
credit. The prices above are the whole cost.

#### How do I see which images found something?

Each row has `status`, `matchCount`, `topMatchLink` and `charged`, and the default table shows
them. A link that is dead or is not an image gets a `failed` row with the reason in `error`, not
a silent empty result. If no image at all could be answered, the run ends as failed and says why.

#### What happens if Google blocks the search?

The image is retried. If it still gets no answer its row says so and it is free. If Google Lens
stops answering altogether, the run ends early and tells you, without working through the rest
of your list; resurrect it later and it continues where it stopped.

#### Can I upload an image instead of giving a URL?

Yes. Upload files to an Apify key-value store and choose it under **Your key-value stores**
(`imageKvsStores`), or send base64 from your code. Through the API, pass the store's id:
`"imageKvsStores": ["<store id>"]`.

#### Am I charged for an image that fails?

No. Its row says what went wrong and it costs nothing. The same goes for one search type that
fails or finds nothing while the others come back. The run itself fails only when no image at all
could be answered.

#### What does `partial` mean?

Some of what you asked for came back and some didn't; `notAnswered` lists the rest. The actor has
already retried it. You are charged only for the search types that returned something; `charged`
lists them.

#### How many results do I get per image?

As many as Google Lens shows: the landmark photo in the example returned 59 visual matches, and
an obscure subject returns fewer. *Results per list* caps each list if you want less.

#### Can I continue a run that stopped?

Yes. Resurrect it and it goes on with the images that were not stored yet, without charging any
image twice.

#### Something is wrong or missing. Where do I report it?

Open an issue on the actor's **Issues** tab with the run ID. Issues are answered within a day.

# Actor input Schema

## `imageUrls` (type: `array`):

Links to the images: JPEG, PNG, WebP, GIF, AVIF, TIFF or SVG, up to 20 MB each. The actor downloads each image itself, so a link only has to open without a login. Duplicate links are searched once.

## `imagesBase64` (type: `array`):

For API callers with local files: each entry is one image, raw base64 or a data URI (data:image/png;base64,…). No public link needed.

## `imageKvsStores` (type: `array`):

Stores on your Apify account with your images. Every image record in a chosen store is searched (found by file extension: .jpg, .png, .webp…), unless "Key-value store records" below names keys in it; then only those. Choose a store here before naming it below: Apify lets this actor read only the stores you choose here.

## `imageKvsRecords` (type: `array`):

Single records to read. Each item is an object: { "key": "photo.jpg", "storeId": "<store id or name>" }; { "storeId": "…" } with no key reads every image record in that store. A store on your account must also be chosen in "Your key-value stores" above, or Apify won't let the actor read it. Leave storeId out to use this run's default store.

## `searchTypes` (type: `array`):

Each image is charged once, whatever you select. Visual matches, exact matches and web results are separate Google result tabs, so each one you add makes a run slower.

## `maxResultsPerImage` (type: `integer`):

Keep at most this many entries in each list, best first. Lens returns about 60 visual matches. Empty or 0 = all. It doesn't change the price.

## `translateLanguage` (type: `string`):

Language code the text is translated into when "translated" is selected, e.g. en, de, pt-BR.

## `language` (type: `string`):

Language code for Google's results, e.g. en, de, pt-BR. Leave empty for English.

## `country` (type: `string`):

Two-letter country code that results are localized for, e.g. US, GB, DE.

## Actor input object example

```json
{
  "imageUrls": [
    {
      "url": "https://upload.wikimedia.org/wikipedia/commons/thumb/a/a8/Tour_Eiffel_Wikimedia_Commons.jpg/960px-Tour_Eiffel_Wikimedia_Commons.jpg"
    }
  ],
  "imageKvsRecords": [],
  "searchTypes": [
    "visual-match",
    "exact-match"
  ],
  "translateLanguage": "en"
}
```

# Actor output Schema

## `results` (type: `string`):

One row per image.

## `summary` (type: `string`):

Images answered, failed and charged, and what (if anything) stopped the run early.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "imageUrls": [
        {
            "url": "https://upload.wikimedia.org/wikipedia/commons/thumb/a/a8/Tour_Eiffel_Wikimedia_Commons.jpg/960px-Tour_Eiffel_Wikimedia_Commons.jpg"
        }
    ],
    "imageKvsRecords": [],
    "searchTypes": [
        "visual-match",
        "exact-match"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("mu0i/google-lens-api").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "imageUrls": [{ "url": "https://upload.wikimedia.org/wikipedia/commons/thumb/a/a8/Tour_Eiffel_Wikimedia_Commons.jpg/960px-Tour_Eiffel_Wikimedia_Commons.jpg" }],
    "imageKvsRecords": [],
    "searchTypes": [
        "visual-match",
        "exact-match",
    ],
}

# Run the Actor and wait for it to finish
run = client.actor("mu0i/google-lens-api").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "imageUrls": [
    {
      "url": "https://upload.wikimedia.org/wikipedia/commons/thumb/a/a8/Tour_Eiffel_Wikimedia_Commons.jpg/960px-Tour_Eiffel_Wikimedia_Commons.jpg"
    }
  ],
  "imageKvsRecords": [],
  "searchTypes": [
    "visual-match",
    "exact-match"
  ]
}' |
apify call mu0i/google-lens-api --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,mu0i/google-lens-api"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/g9ZbYlUhYGyCWRiFz/builds/Hycz7uS4jnXdsxXr8/openapi.json
