# 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
- **Stats:** 42 total users, 10 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event + usage

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/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

## 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)

# 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("💾 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 '{
  "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": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=prodiger/google-lens-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/acts/3HY74kasIfZGSAh03/builds/aGohfYuLdThygufXh/openapi.json
