# 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:** 0 total users, 0 monthly users, 100.0% runs succeeded, NaN 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 a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Google Lens Scraper",
        "description": "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.",
        "version": "0.1",
        "x-build-id": "aGohfYuLdThygufXh"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/prodiger~google-lens-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-prodiger-google-lens-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/prodiger~google-lens-scraper/runs": {
            "post": {
                "operationId": "runs-sync-prodiger-google-lens-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/prodiger~google-lens-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-prodiger-google-lens-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "imageUrls",
                    "searchTypes"
                ],
                "properties": {
                    "searchTypes": {
                        "title": "Search types",
                        "uniqueItems": true,
                        "type": "array",
                        "description": "Which Google Lens search modes to run for each image. Charges per (image × mode) — see Pricing tab.",
                        "items": {
                            "type": "string",
                            "enum": [
                                "all",
                                "ai-mode",
                                "ocr",
                                "translate-ocr",
                                "exact-match",
                                "visual-match",
                                "products",
                                "homework"
                            ],
                            "enumTitles": [
                                "All — General search results",
                                "AI Mode — AI-powered Q&A about the image",
                                "OCR — Text extraction with bounding boxes",
                                "Translate OCR — Extract and translate text",
                                "Exact Match — Find exact image matches",
                                "Visual Match — Find visually similar images",
                                "Products — Find products in the image",
                                "Homework — Educational help"
                            ]
                        },
                        "default": [
                            "all"
                        ]
                    },
                    "imageUrls": {
                        "title": "Image URLs",
                        "type": "array",
                        "description": "Public image URLs to analyze. HTTPS or HTTP only. Each URL is processed once for every selected search type.",
                        "items": {
                            "type": "object",
                            "required": [
                                "url"
                            ],
                            "properties": {
                                "url": {
                                    "type": "string",
                                    "title": "URL of a web page",
                                    "format": "uri"
                                }
                            }
                        }
                    },
                    "aiModeQuestions": {
                        "title": "AI Mode questions",
                        "type": "array",
                        "description": "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.",
                        "default": [],
                        "items": {
                            "type": "string"
                        }
                    },
                    "translateLanguage": {
                        "title": "Translation target language",
                        "type": "string",
                        "description": "Target language code for 'translate-ocr' results (e.g. 'en', 'es', 'fr', 'de', 'ja'). BCP-47 / ISO 639-1.",
                        "default": "en"
                    },
                    "language": {
                        "title": "Search-result language",
                        "type": "string",
                        "description": "Language code for search-result text (e.g. 'en', 'es', 'fr'). Affects 'all', 'products', 'homework', and other modes that return localized results.",
                        "default": "en"
                    },
                    "proxyConfiguration": {
                        "title": "Proxy configuration",
                        "type": "object",
                        "description": "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.",
                        "default": {
                            "useApifyProxy": true,
                            "apifyProxyGroups": [
                                "RESIDENTIAL"
                            ]
                        }
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
