# Google Lens Scraper (`prodiger/google-lens-scraper`) Actor

Analyze images via Google Lens — OCR, translate-OCR, AI Mode, exact match, visual match, product search, homework help, and general search. No API key required.

- **URL**: https://apify.com/prodiger/google-lens-scraper.md
- **Developed by:** [Arnas](https://apify.com/prodiger) (community)
- **Categories:** Other, AI, Agents
- **Features:** Limited permissions, Single-tenant, Server interface
- **Stats:** 94 total users, 8 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $6.50 / 1,000 🤖 ai analyses

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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 Actor

> **Status: in active development.** Scaffold + input layer + pricing wrapper + Apify schemas are in place. Per-mode Lens clients (Flow A protobuf, Flow B HTML scraping, AI Mode) ship after the reverse-engineering spike (`scripts/google-lens-baseline-spike.ts`) confirms endpoint reality.

A Google Lens scraper covering all 8 search modes — OCR, translate-OCR, AI Mode, exact match, visual match, product search, homework help, and general search — calling Google Lens's internal HTTP endpoints directly. No third-party API. No API key required.

### What does Google Lens Actor do?

(Final copy lands in U13 once per-mode outputs are validated. Mirrors the `borderline/google-lens` listing.)

This actor analyzes images via [Google Lens](https://lens.google.com) and returns structured data:

- **Text Extraction (OCR)** — extract text segments with bounding-box coordinates
- **Translate & Extract Text** — translate extracted text into any supported language with positioned word objects
- **AI Analysis** — ask questions about an image and get AI-powered answers
- **Exact Match** — find exact image matches across the web
- **Visual Match** — find visually similar images
- **Product Search** — identify and find products in an image
- **Homework Help** — get educational assistance for homework images
- **General Search** — get all search results in one call

### Why use Google Lens Actor?

(U13)

### How to use Google Lens Actor

(U13 — numbered tutorial)

### Input

Input fields (full schema in the Input tab):

- `searchTypes` — array of one or more of: `all`, `ai-mode`, `ocr`, `translate-ocr`, `exact-match`, `visual-match`, `products`, `homework`. Required.
- `imageUrls` — array of image URLs. Required.
- `aiModeQuestions` — questions to ask in AI Mode (required when `ai-mode` is selected).
- `translateLanguage` — target language for translate-OCR (default `"en"`).
- `language` — search-result language (default `"en"`).
- `proxyConfiguration` — Apify proxy. Default RESIDENTIAL.

### Output

(U13 — JSON examples per mode)

You can download the dataset in various formats such as JSON, HTML, CSV, or Excel.

### Pricing / Cost estimation

Pay-per-event, flat across all subscription tiers:

| Event (display title) | Event key | Price | Fires once per … |
|---|---|---|---|
| 🤖 AI Analysis | `ai-mode` | $6.50 / 1,000 events | image × `ai-mode` |
| 🌐 Translate & Extract Text | `translate-ocr` | $3.50 / 1,000 events | image × `translate-ocr` |
| 📝 Text Extraction | `ocr` | $2.50 / 1,000 events | image × `ocr` |
| 🎯 Exact Match | `exact-match` | $1.50 / 1,000 events | image × `exact-match` |
| 👁️ Visual Match | `visual-match` | $1.50 / 1,000 events | image × `visual-match` |
| 🛍️ Product Search | `products` | $1.50 / 1,000 events | image × `products` |
| 📚 Homework Help | `homework` | $1.50 / 1,000 events | image × `homework` |
| 🔍 General Search | `all` | $1.00 / 1,000 events | image × `all` |
| Actor Start | `apify-actor-start` | $0.01 | run start (Apify synthetic) |

Charges fire only after the corresponding dataset item is successfully written. Skipped or failed modes do not charge.

### Tips or Advanced options

(U13)

### FAQ, disclaimers, and support

(U13 — legality disclaimer + AI Mode availability + link to Issues)

# Changelog

This Actor's version history is a separate document: https://apify.com/prodiger/google-lens-scraper/changelog.md

# Actor input Schema

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

Which Google Lens search modes to run for each image. Charges per (image × mode) — see Pricing tab.

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

Public image URLs to analyze. HTTPS or HTTP only. Each URL is processed once for every selected search type.

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

Questions to ask about the image when 'ai-mode' is selected. Each question fires one ai-analysis charge per image. Required when 'ai-mode' is in searchTypes; ignored otherwise.

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

Target language code for 'translate-ocr' results (e.g. 'en', 'es', 'fr', 'de', 'ja'). BCP-47 / ISO 639-1.

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

Language code for search-result text (e.g. 'en', 'es', 'fr'). Affects 'all', 'products', 'homework', and other modes that return localized results.

## `proxyConfiguration` (type: `object`):

Apify proxy. RESIDENTIAL is the default — Google's anti-bot measures around Lens are well-documented; DATACENTER is unreliable at scale and will likely fail on sustained runs.

## Actor input object example

```json
{
  "searchTypes": [
    "all"
  ],
  "imageUrls": [
    {
      "url": "https://upload.wikimedia.org/wikipedia/commons/thumb/8/87/Google_Lens_logo.svg/240px-Google_Lens_logo.svg.png"
    }
  ],
  "aiModeQuestions": [],
  "translateLanguage": "en",
  "language": "en",
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

## `dataset` (type: `string`):

Per-(image × mode) results from Google Lens. Use the dataset views (all, ai-mode, ocr, translate-ocr, exact-match, visual-match, products, homework, globalErrors) to filter by search type.

# 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/8/87/Google_Lens_logo.svg/240px-Google_Lens_logo.svg.png"
        }
    ],
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("prodiger/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": [{ "url": "https://upload.wikimedia.org/wikipedia/commons/thumb/8/87/Google_Lens_logo.svg/240px-Google_Lens_logo.svg.png" }],
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("prodiger/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": [
    {
      "url": "https://upload.wikimedia.org/wikipedia/commons/thumb/8/87/Google_Lens_logo.svg/240px-Google_Lens_logo.svg.png"
    }
  ],
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call prodiger/google-lens-scraper --silent --output-dataset

```

## MCP server setup

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