# 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
- **Features:** Limited permissions
- **Stats:** 11 total users, 6 monthly users, 97.8% runs succeeded, 1 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/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

## Reverse image search with Google Cloud Vision

Find visually similar images, matching source pages, and exact copies with
Google Cloud Vision Web Detection. Add one image or process a batch, then
download one clean Dataset containing all results.

Use this Actor to:

- find websites where an image appears;
- discover visually similar images;
- locate exact copies and direct full-image URLs;
- identify likely subjects through best-guess labels and web entities.

### How to use it

1. Keep the sample image for a quick test, replace it with public image links,
   or upload an image.
2. Keep **Similar images and sources**, **Exact copies**, or both selected.
3. Choose Standard or Extended visual search coverage.
4. Click **Start**, then open **Results** when the run finishes.

Empty scheduled runs automatically use the sample image, so a recurring Apify
schedule always performs a real Web Detection smoke test. An explicitly empty
`imageUrls` array is still rejected to catch accidental API input mistakes.

### Result types

| Result type | What you get |
| --- | --- |
| Similar images and sources | Matching pages, visually similar image URLs, page titles, websites, thumbnails, match types, labels, and web entities |
| Exact copies | Pages with full-image matches and direct original image URLs when Google provides them |

Both result types use the same Cloud Vision Web Detection response. Selecting
them together does not duplicate the upstream request.

### Useful options

| Option | What it controls |
| --- | --- |
| Maximum results | The maximum number saved for each selected result type |
| Visual search coverage | Standard uses the full image once; Extended adds bounded crop searches for broader coverage |

**Maximum results** is a cap, not a guaranteed count. The actual number depends
on the image and how many useful matches Google Cloud Vision returns.

Use **Standard** for the fastest and lowest-cost search. Choose **Extended**
when broader coverage is worth additional time and Vision units. Extended
stops at the result cap or after consecutive unproductive crop searches.

### Dataset output

The Actor saves one Dataset item for each input image. The single **Results**
view includes status, provider, best-guess labels, similar matches, exact
copies, and errors. The complete JSON item also includes full, partial, and
visually similar image URL arrays.

Results are available as JSON, CSV, Excel, XML, RSS, or JSONL through the
Apify Console and API.

### API example

```json
{
  "imageUrls": [
    "https://upload.wikimedia.org/wikipedia/commons/3/3a/Cat03.jpg"
  ],
  "searchTypes": ["visual-match", "exact-match"],
  "maxResults": 20,
  "visualSearchDepth": "standard"
}
```

### Runtime configuration

Self-hosted builds require `GOOGLE_CLOUD_VISION_API_KEY`. Restrict the key to
the Cloud Vision API and store it as an Apify secret/environment variable.
Web Detection uses the global Vision endpoint because that feature is not
available on regional Vision endpoints.

Visual and Exact runs do not start a browser, upload to Google Lens, or
allocate Apify proxy sessions.

### Frequently asked questions

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

Yes. Run the Actor from Apify Console or the Apify API, and use Apify schedules
for recurring searches or daily smoke tests.

#### Is this an official Google product?

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

# Actor input Schema

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

Paste up to 100 public image links. Most common image formats up to 20 MB are supported.

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

Upload one image from your device. Remove the sample image link when using an upload.

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

Similar images and exact copies are selected by default.

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

Set the maximum results saved for each selected type. The actual number depends on the image.

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

Standard sends one Cloud Vision request. Extended adds bounded crop requests, which may find more matches but takes longer and consumes more Vision units.

## Actor input object example

```json
{
  "imageUrls": [
    "https://upload.wikimedia.org/wikipedia/commons/3/3a/Cat03.jpg"
  ],
  "searchTypes": [
    "visual-match",
    "exact-match"
  ],
  "maxResults": 20,
  "visualSearchDepth": "standard"
}
```

# Actor output Schema

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

Google Cloud Vision Web Detection results for every input image.

# 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": [
        "https://upload.wikimedia.org/wikipedia/commons/3/3a/Cat03.jpg"
    ]
};

// 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 = { "imageUrls": ["https://upload.wikimedia.org/wikipedia/commons/3/3a/Cat03.jpg"] }

# 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(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": [
    "https://upload.wikimedia.org/wikipedia/commons/3/3a/Cat03.jpg"
  ]
}' |
apify call devcake/google-lens-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,devcake/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/gzFkKsqGLtWSaSqJp/builds/tyBsSvH5rLaA1NasF/openapi.json
