# Google Lens Api (`devcake/google-lens-scraper`) Actor

Search images with Google Lens to find similar pictures, products, exact matches, original sources, text, translations, and image answers in batches.

- **URL**: https://apify.com/devcake/google-lens-scraper.md
- **Developed by:** [devcake](https://apify.com/devcake) (community)
- **Categories:** AI, SEO tools, E-commerce
- **Stats:** 2 total users, 1 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$5.00 / 1,000 image processeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Reverse image search and visual product discovery

### Reverse image search with Google Lens

Reverse image search helps you discover what appears in a picture, where the
picture is used online, and which products look like it. Add one or more image
links or upload a file, choose what you want to find, and start the run. The
results are organized into clear tables that you can review or download.

Use this Actor when you want to:

- find pages that use the same or a similar image;
- identify products from a photo;
- compare sellers, prices, ratings, and availability;
- find the original source of an image;
- extract or translate text from a picture;
- ask questions about an image;
- get help with a photographed homework problem.

### How to use the Google Lens search

1. Open the **Input** tab.
2. Paste one or more public image links into **Image URLs**, or open
   **Upload** and choose a file from your device.
3. Keep the default **Visual matches** and **OCR**, or choose only the result
   types you need. Select **All modes** only for broad experimental coverage.
4. Select the language and country that best match the results you want.
5. Click **Start**.

When the run finishes, open the **Dataset** tab. Separate views help you move
between visual matches, products, exact matches, text, answers, and related
search ideas.

### Choose what you want to find

| Search mode | What it gives you |
| --- | --- |
| All modes | Runs every available type of image analysis |
| Visual matches | Finds native Google Lens visual cards and the pages where they appear |
| Products | Finds matching products, sellers, prices, ratings, and availability |
| Exact matches | Finds pages using the same image and can look for the original file |
| OCR | Extracts text from an image |
| Translate OCR | Extracts the text and translates it into your chosen language |
| AI Mode | Answers questions about what is shown in the image |
| Homework | Reads a photographed problem and returns an answer with steps when available |

### What data can you get?

Every image receives an overall status and its own group of results.

| Result | Included information |
| --- | --- |
| Native visual matches | Page title, website, page link, preview image when Google supplies one, and short description |
| Related web results | Clearly labeled semantic fallback links returned when native visual cards are unavailable |
| Product matches | Product name, seller, price, currency, availability, rating, reviews, and image |
| Exact matches | Matching page, publisher, publication date, preview, and original image link when found |
| Related results | Suggested searches, related pages, and other useful image search directions |
| Image text | Full text plus words, lines, and paragraphs |
| Translated text | Extracted text in the selected target language |
| AI answers | Your question, the answer, and supporting links when available |
| Homework | The recognized problem, answer, and solution steps when available |

Download the Dataset as Excel, CSV, or JSON, or schedule runs in Apify.

### Popular use cases

#### Find similar images online

Upload a photo to find visually similar images, their source websites, preview
pictures, and related searches. This is useful for creative research, content
discovery, catalog work, and checking where an image appears online.

#### Find a product by image

Use a product photo, screenshot, or catalog image to find possible matches.
Product results can include seller links, prices, currencies, availability,
ratings, review counts, and product pictures. Choose the country that matches
the market you want to search.

#### Find the original image source

Select **Exact matches** and turn on **Resolve original image URLs**. The
results can include the matching page, publisher, publication date, original
image link, and a confidence value. This makes it easier to trace an image back
to an earlier or higher-quality source.

#### Extract text from an image

Select **OCR** to turn text in photos, screenshots, labels, documents, and
product packaging into text you can copy or download. Choose full details,
paragraphs, lines, words, or text only. Select **Translate OCR** when you also
want the text translated.

### Input options

| Option | What to enter |
| --- | --- |
| Image URLs | One or more public links to JPG, PNG, WebP, GIF, BMP, or TIFF images |
| Upload an image | One image file from your device |
| Search modes | One or more result types, or All modes |
| Results per search mode | Target/cap for saved matches; Google still controls availability |
| Visual search depth | Standard follows native continuation pages and the Visual Matches tab; Extended also searches salient image regions |
| Maximum native visual queries | Full-image plus crop upload limit for Extended mode |

Native Visual Matches use last-known-good session semantics. A challenged or
failed request cannot update stored cookies, and the scraper can retry once on
a new anonymous sticky residential identity. Separately, a scheduled headed
CloakBrowser maintenance Actor validates Chrome DevTools-staged cookies and
promotes them only after `main=200` and native `folsrch=200`; see
[Automated session refresh](docs/SESSION_REFRESHER.md).
| OCR detail | Full details, paragraphs, lines, words, or text only |
| Translate OCR to | The language for translated image text |
| AI Mode questions | Up to 10 questions about each image |
| Result language | The language used for recognition and search results |
| Country | The market used for localized product and search results |
| Resolve original image URLs | Whether to look for the original file on matching pages |

### Example

Imagine you have a photo of a red running shoe and want to identify it.

1. Add the image link or upload the photo.
2. Select **Products**, **Visual matches**, and **Exact matches**.
3. Choose your country and start the run.

The Dataset may contain similar shoes, possible product names, merchant pages,
prices, ratings, and pages that use the same photo. Switch between the
**Products**, **Visual matches**, and **Exact matches** views to review them.

### Visual match counts and pricing

`maxResults` is a target and output cap, not a promise. In current first-page
native Lens responses, Visual Matches commonly contains about **3–6 cards per
image**. Standard mode follows fresh native `folsrch` continuation links when
Google supplies them, then checks the native `udm=44` Visual Matches tab
without another upload. Extended mode then searches up to five additional
salient regions, deduplicates canonical source URLs, and stops at the target
or after two crop queries add no unique results.

Every native result identifies whether it came from the full image or a crop,
the crop coordinates, query number, native page, native rank, and every query
that found the same URL. Continuation URLs are short-lived and are never
included in output.

The current price is shown in Apify before a run starts. The Actor records
which successfully delivered features are billing-eligible. A native visual
event is counted for each full-image or crop query that adds at least one
unique result. Continuation pages do not add another native-query event.
Semantic fallback links are never labeled or billed as native visual matches.
Failed images do not produce success events.

For the exact pipeline, field definitions, stopping rules, operating metrics,
and rollout procedure, see
[Extended Visual Search](docs/EXTENDED_VISUAL_SEARCH.md).

### Frequently asked questions

#### How can I reverse Google search an image?

Add a public image link or upload a file, then select **Visual matches** and
**Exact matches**. Start the run and open the Dataset to review similar
pictures, matching pages, source websites, and original image links when they
can be found.

#### How do I find an image that is similar to a picture?

Choose **Visual matches** for the image you want to check. Standard mode uses
the full image, native continuation pages, and the dedicated Visual Matches
tab. Choose **Extended** to search additional image regions when a larger
result set is worth the extra requests. The Actor cannot guarantee the
requested count.

#### Can I find a product from a picture?

Yes. Select **Products** and choose the country where you want to shop. The
Actor can return possible product names, seller pages, prices, currencies,
availability, ratings, review counts, and product images.

#### How can I extract text from an image?

Select **OCR**, add the image, and start the run. The Dataset can contain the
full text as well as separate words, lines, and paragraphs. Choose
**Translate OCR** if you also want the extracted text translated.

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

No. This is an independent, unofficial scraper and is not affiliated with,
endorsed by, or operated by Google. Google can change the underlying response
formats and result availability. Use it in accordance with the terms and laws
that apply to your use case.

#### Can I use it through an API?

Yes. The same Actor can be run from Apify or through the Apify API. Review the
current price displayed by Apify before starting a large batch.

# Actor input Schema

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

Public HTTP(S) JPG, PNG, WebP, GIF, BMP, or TIFF URLs up to 20 MB and 40 megapixels. Duplicate URLs are processed once.

## `imageFile` (type: `string`):

Upload one image from your device. You can use it together with image URLs.

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

Google Lens modes to run for every image. Visual matches and OCR are selected by default; choose All modes only when you need every experimental mode.

## `maxResults` (type: `integer`):

Maximum matches kept for each mode. Google still controls availability. Extended Visual Search can run additional bounded region queries but does not guarantee this number.

## `visualSearchDepth` (type: `string`):

Standard follows native continuation pages and checks the Visual Matches tab for the full image. Extended does that first, then searches salient image regions until the result target or query limit is reached.

## `maxVisualQueries` (type: `integer`):

Maximum full-image plus crop uploads in Extended mode. Continuation pages and the Visual Matches tab do not count as additional uploads.

## `fallbackText` (type: `string`):

Optional words that describe the image. Used only when the visual search needs help.

## `ocrOutputDetail` (type: `string`):

Choose whether OCR returns all structures, paragraphs, lines, words, or text only.

## `translateTo` (type: `string`):

Target language used by Translate OCR, for example en, es, de, or ja.

## `aiModeQuestions` (type: `array`):

Questions asked when AI Mode is selected. If empty, the Actor asks what is shown in the image.

## `resolveOriginalImages` (type: `boolean`):

Visit exact-match source pages and identify the best original image candidate. This is slower and uses additional requests.

## `exactMatchScope` (type: `string`):

Full image searches the complete frame; Auto crop lets Google focus on a detected region.

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

Language for search results and OCR recognition.

## `countryCode` (type: `string`):

Country used for Google result localization.

## Actor input object example

```json
{
  "imageUrls": [
    "https://images.unsplash.com/photo-1526336024174-e58f5cdd8e13?w=640"
  ],
  "searchTypes": [
    "visual-match",
    "ocr"
  ],
  "maxResults": 20,
  "visualSearchDepth": "standard",
  "maxVisualQueries": 4,
  "ocrOutputDetail": "full",
  "translateTo": "en",
  "resolveOriginalImages": false,
  "exactMatchScope": "full_image",
  "language": "en",
  "countryCode": "US"
}
```

# Actor output Schema

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

One structured Dataset item per input image.

## `overview` (type: `string`):

No description

## `visualMatches` (type: `string`):

No description

## `relatedWebResults` (type: `string`):

No description

## `products` (type: `string`):

No description

## `exactMatches` (type: `string`):

No description

## `relatedLinks` (type: `string`):

No description

## `searchSuggestions` (type: `string`):

No description

## `searchChips` (type: `string`):

No description

## `availableTabs` (type: `string`):

No description

## `ocrWords` (type: `string`):

No description

## `ocrLines` (type: `string`):

No description

## `ocrParagraphs` (type: `string`):

No description

## `aiAnswers` (type: `string`):

No description

## `homework` (type: `string`):

No description

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("devcake/google-lens-scraper").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 = {}

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

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

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

```

## CLI example

```bash
echo '{}' |
apify call devcake/google-lens-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=devcake/google-lens-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/acts/gzFkKsqGLtWSaSqJp/builds/6uOGDA07jk91xguvx/openapi.json
