# Google Lens Visual Match and Reverse Image Search (`xyrelith-data/google-lens-scraper`) Actor

Search Google Lens with image URLs or key-value store images and get visual matches, exact matches, product offers, detected entities, related searches and OCR text with page links, thumbnails, dimensions and prices.

- **URL**: https://apify.com/xyrelith-data/google-lens-scraper.md
- **Developed by:** [Xyrelith Data](https://apify.com/xyrelith-data) (community)
- **Categories:** E-commerce, Automation, SEO tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.49 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
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

## Google Lens Visual Match & Reverse Image Search

Search any picture with Google Lens and get the web pages, images and product offers behind it. Send public image URLs or images from the run's key-value store, pick the result set you need, and receive flat rows with page links, thumbnails, full-size image URLs, dimensions, prices, ratings and stock labels.

### What you get

For every image the actor saves:

- **Visual matches** — visually similar pages and images, in Google's order, with position, title, source site, domain, page URL, thumbnail, full-size image URL and pixel dimensions.
- **Product offers** — price as shown plus parsed amount and currency, merchant, rating, review count and stock label for matches that are shoppable listings.
- **Exact matches** — the pages carrying the same image, with title, source, publication date where Google shows one, the source image's pixel dimensions, a thumbnail and the resolved destination URL.
- **Google's AI description** — the text Google's Lens result page writes about the image.
- **Detected entity** — the subject name parsed from Google's own description, with the full description beside it.
- **Related searches** — the follow-up questions Google suggests for the image, when the result page shows them.
- **Detected objects** — the regions Lens found in the picture (whole image, main subject, objects, text blocks) with normalized boxes.
- **OCR text** (optional) — the text read from the image, its language, and paragraphs with normalized boxes.
- **Image summary** — one row per image with counts, status, warnings and the original image's dimensions.

### Input

| Field | Type | Description | Default |
|---|---|---|---|
| `mode` | select | `all`, `visualMatches`, `exactMatches`, `products` or `ocr`. | `all` |
| `imageUrls` | array | Public direct image URLs. One or many. | |
| `imageKeys` | array | Optional. Keys in this run's key-value store that hold image files. | |
| `country` | select | Google market used for results and prices. | `US` |
| `language` | select | Result language. | `en` |
| `maxItems` | integer | Maximum match rows per image (1–1000). | `100` |
| `includeOcr` | boolean | Add OCR text to the image summary for any mode. | `false` |
| `rehostImages` | boolean | Copy full-size match images whose host blocks hotlinking into this run's key-value store and return a public URL, keeping the source URL in `imageUrlOriginal`. | `true` |

Example:

```json
{
  "mode": "all",
  "imageUrls": [
    "https://images.unsplash.com/photo-1502602898657-3e91760cbb34?w=640"
  ],
  "country": "US",
  "language": "en",
  "maxItems": 50,
  "includeOcr": false
}
```

### Output

Each dataset row is a match or an image summary.

```json
{
  "recordType": "match",
  "matchType": "visual",
  "position": 1,
  "inputImageUrl": "https://example.com/photo.jpg",
  "title": "A guide to flying to France | Documents, Distance, Airports",
  "source": "Sherburn Aero Club",
  "domain": "sherburnaeroclub.com",
  "pageUrl": "https://sherburnaeroclub.com/blog/a-guide-to-flying-to-france",
  "thumbnailUrl": "https://encrypted-tbn0.gstatic.com/images?q=tbn:...",
  "imageUrl": "https://sherburnaeroclub.com/storage/medialibrary/flying-to-france.jpg",
  "imageWidth": 3530,
  "imageHeight": 5309,
  "searchCountry": "US",
  "searchLanguage": "en",
  "scrapedAt": "2026-11-15T00:00:00+00:00"
}
```

Product matches add `price`, `currency`, `currencyCode`, `priceText`, `merchant`, `rating`, `reviewCount` and `inStock`. Exact matches add `date`, `googleRedirectUrl` and the source image dimensions. When a full-size match image had to be copied into storage, `imageUrlOriginal` keeps the source URL. The image summary row adds `aiOverview`, `knowledgeEntity`, `relatedSearches`, `detectedObjects`, `ocr`, `counts` and `status`.

### Modes

| Mode | What it returns |
|---|---|
| `all` | Visual matches, product offers, AI description, entity, related searches and detected objects. |
| `visualMatches` | Visual matches and product offers only. Faster than `all`. |
| `exactMatches` | Pages carrying the same image, up to Google's 400-row source ceiling. |
| `products` | Only visual matches that carry a price. |
| `ocr` | Only OCR text, language and paragraph boxes. No browser session needed. |

Add `includeOcr: true` to any non-OCR mode to attach OCR to the image summary.

### Use cases

- Find where a photo appears on the web and who published it.
- Check whether your product photography is being reused by other sellers.
- Turn a product photo into a list of similar listings with prices and stock.
- Read text from screenshots, signs, labels and documents without a separate OCR tool.
- Enrich a catalogue with visually similar pages and the entity Google recognizes.
- Feed an AI agent structured visual-search results instead of raw HTML.

### How it works

The actor prepares each image the same way Google's own upload widget does, sends it to Google Lens, and reads the result page's embedded match map plus its visible cards. Exact-match destination links are resolved from Google's redirect wrapper without visiting the merchant site. OCR uses Google's Chromium Lens endpoint. No Google account, cookie or API key is required.

### Limitations

- **Visual matches are capped by Google.** One lookup returns about 60 visual matches. A larger `maxItems` does not create more source results.
- **Exact matches are capped at 400 and can be empty.** Google returns an exact set for some images and nothing for others; the same image can change between lookups.
- **The separate Products tab was retired by Google in October 2026.** Product offers now arrive inside visual matches, so `products` filters price-bearing visual matches instead of opening a Products tab.
- **Product fields are shown only when the retailer publishes them.** Price, rating, review count and stock are omitted when Google does not display them.
- **A separate Knowledge Graph entity card is no longer shown.** The actor returns Google's AI description and derives the subject name from that description; when no name can be parsed, only the description is returned.
- **Related searches appear as AI follow-up questions when Google shows them.** The current Lens page does not always include them.
- **Image URLs must be public and direct.** Login-protected links, private hosts and web pages that merely contain an image are rejected.
- **Full-size match images belong to their source sites.** Thumbnails are Google-hosted and always public. With `rehostImages` on (the default), images whose host blocks hotlinking are copied into the run's key-value store and returned as public URLs; `imageUrlOriginal` keeps the source link. An image that cannot be fetched at all is omitted rather than replaced by a broken link.
- **Google sometimes asks for a captcha.** The actor retries with new sessions and connections; if Google refuses every attempt, the image summary says so and no match rows are saved for that image.
- **OCR is a best-effort read.** Stylized text, very small type and low-contrast images may produce little or no text.

### FAQ

**Do I need a Google account or API key?** No.

**Can I search an image stored on my computer?** Yes. Put the file in the run's key-value store and pass its key in `imageKeys`.

**Why did an exact-match lookup return nothing?** Google does not have an exact set for every image, and the set changes over time. Try the same image later or use `visualMatches`.

**Why are some product fields missing?** Google only shows a price, rating, review count or stock label when the listing publishes it.

**Can I get more than 60 visual matches?** No. That is Google's source ceiling, not an actor setting.

**What does `status` mean on the image summary?** `ok` means the result set was collected. `partial` means a secondary part (for example the AI description or exact tab) was unavailable. `blocked` means Google refused the Lens page for every connection. `error` means the image itself could not be loaded.

**Are thumbnails and full-size image URLs usable outside Apify?** Thumbnails are public Google-hosted images. Full-size URLs point at the source site and may be protected by that site.

### Data source

Results come from public Google Lens pages. This actor is independent and is not affiliated with, endorsed by, or sponsored by Google LLC. Google Lens is a trademark of Google LLC.

# Actor input Schema

## `mode` (type: `string`):

All returns visual matches with product offers, Google's AI description and follow-up searches. Visual matches returns similar pages and images. Exact matches returns pages carrying the same image. Products returns only matches with a price. OCR only reads text from the image.

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

Public direct image URLs (JPEG, PNG, WebP, GIF, AVIF). A web page URL is not an image URL. Add one or more images in the order you want them searched.

## `imageKeys` (type: `array`):

Optional. Keys in this run's key-value store that hold image files. Use this instead of image URLs when the pictures are already in Apify storage.

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

Country whose Google market is used for results, prices and the shopping offers.

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

Interface and result language. Match coverage can differ between languages; English returns the widest coverage.

## `maxItems` (type: `integer`):

Maximum match rows saved for each image. One Lens lookup returns up to about 60 visual matches and up to 400 exact matches, so larger values do not create more source results.

## `includeOcr` (type: `boolean`):

Also read text from each image with Google Lens OCR. The text, language and paragraph boxes are added to the image summary. Adds about one second per image.

## `rehostImages` (type: `boolean`):

Check each full-size match image and copy images whose host blocks hotlinking into this run's key-value store, returning a public URL and keeping the source URL in imageUrlOriginal. Thumbnails and exact-match previews are already public or rehosted. Turn this off to save storage when you only need the source URLs.

## Actor input object example

```json
{
  "mode": "all",
  "imageUrls": [
    "https://images.unsplash.com/photo-1502602898657-3e91760cbb34?w=640"
  ],
  "country": "US",
  "language": "en",
  "maxItems": 3,
  "includeOcr": false,
  "rehostImages": true
}
```

# Actor output Schema

## `matches` (type: `string`):

Rows with recordType=match carry position, title, source, domain, page URL, thumbnail, full image, dimensions, price, currency, rating, review count, stock and date. Rows with recordType=imageSummary carry the per-image AI description, entity, related searches, detected objects, OCR and counts.

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

Per-run tallies of images searched, matches saved, OCR images and warnings.

# 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 = {
    "mode": "all",
    "imageUrls": [
        "https://images.unsplash.com/photo-1502602898657-3e91760cbb34?w=640"
    ],
    "country": "US",
    "language": "en",
    "maxItems": 3,
    "includeOcr": false,
    "rehostImages": true
};

// Run the Actor and wait for it to finish
const run = await client.actor("xyrelith-data/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 = {
    "mode": "all",
    "imageUrls": ["https://images.unsplash.com/photo-1502602898657-3e91760cbb34?w=640"],
    "country": "US",
    "language": "en",
    "maxItems": 3,
    "includeOcr": False,
    "rehostImages": True,
}

# Run the Actor and wait for it to finish
run = client.actor("xyrelith-data/google-lens-scraper").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 '{
  "mode": "all",
  "imageUrls": [
    "https://images.unsplash.com/photo-1502602898657-3e91760cbb34?w=640"
  ],
  "country": "US",
  "language": "en",
  "maxItems": 3,
  "includeOcr": false,
  "rehostImages": true
}' |
apify call xyrelith-data/google-lens-scraper --silent --output-dataset

```

## MCP server setup

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

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/I4Ag5MADZDiXkhJn9/builds/Ww3tOPFAfnPOyS3SW/openapi.json
