Google Lens OCR API: Image to Text with Word Boxes and Standby avatar

Google Lens OCR API: Image to Text with Word Boxes and Standby

Pricing

from $2.99 / 1,000 listing scrapeds

Go to Apify Store
Google Lens OCR API: Image to Text with Word Boxes and Standby

Google Lens OCR API: Image to Text with Word Boxes and Standby

Google Lens OCR API for image URLs, Base64, and Apify storage records, with a Standby REST endpoint for single-image calls. Get extracted text, real word and line geometry, writing direction, detected regions, translation, and explicit per-image errors for agents and automation pipelines.

Pricing

from $2.99 / 1,000 listing scrapeds

Rating

0.0

(0)

Developer

GetAScraper

GetAScraper

Maintained by Community

Actor stats

0

Bookmarked

137

Total users

30

Monthly active users

4 hours ago

Last modified

Share

🔎 Google Lens OCR API: Image to Text with Word Boxes and Standby

Part of the Google Lens Image-Intelligence Pair. Two focused Actors built on the same engine: pull text out of an image, or find where it appears online.
GOOGLE LENS IMAGE-INTELLIGENCE PAIR   •  OCR and reverse image search, built on the same engine
 Google Lens OCR
➤ You are here
 Google Lens Visual Search
Reverse image search, web matches, and OCR
Turn any image into searchable text in about a second.
Call a live Standby endpoint for one image, or submit a batch of URLs, Base64 payloads, or Apify key-value store records in a single run.
⚡ No cold start
The Standby endpoint answers a single image in about a second.
📦 Four input modes
One image URL, bulk URLs, Base64 data, or key-value store records.
🔠 Real geometry
Word, line, and paragraph boxes come straight from Google, never estimated.
🌐 Optional translation
Request a target language while keeping the original OCR text.

Extract text from a single image, or a whole batch, using the same engine behind Google Lens. Call it as a live REST endpoint for one image at a time (no cold start), or submit a batch of image URLs, Base64 payloads, or Apify key-value store records in one run. Every submitted image returns one correlated result with its status, detected language, dimensions, word count, timing, and any real error.

Use the output for document indexing, searchable archives, translation workflows, content moderation, accessibility pipelines, RAG preparation, and AI agent tool calls.

🧾 Sample result

Input: one public photo of a restaurant receipt, outputDetail left at its default.

{
"imageUrl": "https://commons.wikimedia.org/wiki/Special:FilePath/ReceiptSwiss.jpg?width=1000"
}

Result row (the per-line lines array with boxes is omitted here for length):

{
"inputId": "single-1",
"sourceType": "URL",
"status": "SUCCEEDED",
"language": "en",
"fullText": "Berghotel\nGrosse Scheidegg\n3818 Grindelwald\nFamilie R. Müller\nRech. Nr. 4572\n30.07.2007/13:29:17\nBar\nTisch 7/01\n2xLatte Macchiato à\n4.50\nCHF\n9.00\n1xGloki\nà\n5.00\nCHF\n5.00\n1xSchweinschnitzel\nà\n22.00\nCHF\n22.00\n1xChässpätzli\nà\n18.50\nCHF\n18.50\nTotal:\nCHF\n54.50\nIncl. 7.6% MwSt\n54.50\n...",
"wordCount": 70,
"imageWidth": 1280,
"imageHeight": 1707,
"lineGeometryAvailable": true,
"wordGeometryAvailable": false,
"geometryLevel": "LINE"
}

Copy to your AI assistant

getascraper/google-lens-ocr on Apify. Two ways to call it:
1) Standby REST API (no cold start, one image per call): find this Actor's Standby hostname on its
Standby tab in Apify Console, then GET https://<standby-hostname>/ocr?imageUrl=...&outputDetail=full&token=TOKEN
2) Batch run via the Apify client: ApifyClient("TOKEN").actor("getascraper/google-lens-ocr").call(run_input={"imageUrl": "..."}), then client.dataset(run["defaultDatasetId"]).list_items().items for results.
Key inputs: imageUrl: string (a single image), outputDetail: string (text_only|lines|full|paragraphs|words), translateTo: string (optional language code). Batch inputs (imageUrls, imagesBase64, imageKvsRecords) also available for many images in one run.
Full actor spec (input schema, output dataset fields, README): GET https://api.apify.com/v2/acts/getascraper~google-lens-ocr/builds/default (Bearer TOKEN) → inputSchema, actorDefinition.storages.dataset, readme.
Get a token: https://console.apify.com/account/integrations

✨ What this Actor gives you

  • A live Standby endpoint: Call GET /ocr?imageUrl=... for a single image with no container cold start, alongside normal batch runs.
  • Four input modes: One image URL for the common case, plus bulk URLs, Base64 image data, and Apify key-value store records for batches.
  • Stable correlation: Supply your own inputId, or use deterministic IDs assigned in input order.
  • Honest batch rows: Successful, partial, and failed inputs all remain visible.
  • Source dimensions: Get the original image width and height when the image can be decoded.
  • Detected language and writing direction: Know whether text reads left-to-right, right-to-left, or top-to-bottom.
  • Real word, line, and paragraph geometry: Every box comes directly from Google's own response. Nothing is estimated or interpolated.
  • Detected regions: Salient regions and objects Google's own response identifies in the image, at no extra cost.
  • Optional translation: Request a target language while retaining the original OCR text.
  • Bounded concurrency: Process batches without launching every image request at once.
  • Run summary: Review submitted, successful, partial, and failed counts in RUN_SUMMARY.

🎯 Common workflows

  • AI agents and MCP tools: Call the Standby endpoint as a fast, stateless OCR tool with no run-management overhead.
  • AI and RAG teams: Turn screenshots and scanned pages into searchable text with source correlation.
  • Automation teams: Process receipt, label, menu, poster, and document image batches.
  • Localization teams: Extract original text and request a translated version in the same row.
  • Data operations teams: Reconcile every input against a clear success, partial, or failure status.
  • Developers: Use real word-level boxes and writing direction for layout reconstruction and highlighting.

⚡ Call it live, or run it as a batch

For a single image, call the Standby endpoint directly instead of starting a run. Find this Actor's Standby hostname on its Standby tab in Apify Console, then:

GET https://<standby-hostname>/ocr?imageUrl=https://example.com/photo.jpg&outputDetail=full&token=YOUR_TOKEN

It answers in about a second, since there is no container start-up wait once the Actor is warm.

For many images, run the Actor normally:

STEP 1
Add your images
Paste one image URL, or open Batch and advanced sources for a URL list, Base64 data, or key-value store records.
STEP 2
Pick the detail
Choose output detail, an optional translation language, and concurrency.
STEP 3
Start and read results
Open the dataset for one correlated row per image, or RUN_SUMMARY for run totals.

📥 Input

FieldTypeRequiredDescription
imageUrlstringConditionalOne public HTTP or HTTPS image URL. This is all most runs need.
imageUrlInputIdstringNoCorrelation ID for imageUrl. Defaults to single-1.
imageUrlsarrayConditionalBulk URL objects, for batches. Each item can include url and userData.inputId.
imagesBase64arrayConditionalObjects containing data and an optional inputId. Raw Base64 and image data URIs are accepted.
imageKvsRecordsarrayConditionalObjects containing key, optional storeId, and optional inputId.
outputDetailstringNotext_only, lines, full (default), paragraphs (adds grouping and writing direction), or words (adds every word's own box and rotation).
translateTostringNoTarget language code such as es, de, or pt-BR.
maxConcurrencyintegerNoImages processed at once in a batch run, from 1 to 10.

At least one of imageUrl, imageUrls, imagesBase64, or imageKvsRecords must be provided.

URL batch example

{
"imageUrls": [
{
"url": "https://tesseract.projectnaptha.com/img/eng_bw.png",
"userData": { "inputId": "poem-page-1" }
},
{
"url": "https://example.com/document-page-2.png",
"userData": { "inputId": "document-page-2" }
}
],
"outputDetail": "full",
"translateTo": "es",
"maxConcurrency": 3
}

Apify storage example

{
"imageKvsRecords": [
{
"storeId": "my-image-store",
"key": "receipts/july-001.png",
"inputId": "receipt-july-001"
}
],
"outputDetail": "lines"
}

The default key-value store is used when storeId is omitted. A storage record can contain binary image data, a Base64 string, or a JSON object with a Base64 data field.

Recurring document OCR workflow

Use the same imageUrls input from an Apify schedule. Keep inputId stable so downstream systems can reconcile each image across runs.

{
"imageUrls": [
{
"url": "https://example.com/invoices/2026-08-01.png",
"userData": { "inputId": "invoice-2026-08-01" }
}
],
"outputDetail": "full"
}

📤 Output

The Actor writes one row for each submitted image. This abbreviated example comes from the public Tesseract sample image:

{
"inputId": "sample-1",
"sourceType": "URL",
"sourceReference": "https://tesseract.projectnaptha.com/img/eng_bw.png",
"imageUrl": "https://tesseract.projectnaptha.com/img/eng_bw.png",
"status": "SUCCEEDED",
"language": "en",
"fullText": "Mild Splendour of the various-vested Night!\nMother of wildly-working visions! hail!\nI watch thy gliding, while with watery light\nThy weak eye glimmers through a fleecy veil;\nAnd when thou lovest thy pale orb to shroud\nBehind the gather'd blackness lost on high;\nAnd when thou dartest from the wind-rent cloud\nThy placid lightning o'er the awaken'd sky.",
"translationTarget": "es",
"wordCount": 58,
"imageWidth": 1486,
"imageHeight": 668,
"lineGeometryAvailable": true,
"wordGeometryAvailable": false,
"geometryLevel": "LINE",
"durationMs": 3154,
"processedAt": "2026-08-01T16:51:13.248Z"
}

Result status

StatusMeaning
SUCCEEDEDOCR completed. Requested translation also completed when text was available.
PARTIALOCR completed, but an optional translation request failed. OCR text remains in the row.
FAILEDThe image could not be loaded, decoded, or processed. The row contains errorCode and errorMessage.

Field reference

FieldDescription
inputIdUser-provided or deterministic correlation ID.
sourceTypeURL, BASE64, or KEY_VALUE_STORE.
sourceReferenceURL or storage record reference. Base64 content is never copied into this field.
statusPer-input processing outcome.
languageLanguage reported by Google, for the whole image.
fullTextExtracted lines joined with newline characters.
translatedTextReal translated text when requested and completed.
wordCountWhitespace-delimited word count calculated from fullText.
imageWidth, imageHeightSource image dimensions in pixels.
lineGeometryAvailableWhether at least one genuine line box is present.
wordGeometryAvailableWhether at least one genuine word box is present. Only ever true when Output detail is words.
geometryLevelWORD or LINE, whichever is the finest real geometry present in this row. Omitted for text-only rows.
linesExtracted lines with normalized and pixel geometry when available.
paragraphsPresent when Output detail is paragraphs or words: each paragraph's writing direction, joined text, and (at words) every word's own box and rotation.
regionsPresent at the same tiers: salient regions and objects Google's own response identifies, each with a real box when available.
durationMsTotal processing time for that input.
errorCode, errorMessageReal failure details for partial or failed rows.

One real element from the sample row's lines array:

{
"text": "Mild Splendour of the various-vested Night!",
"boundingBox": {
"normalized": {
"centerX": 0.44486331939697266,
"centerY": 0.1067144051194191,
"width": 0.8516666889190674,
"height": 0.11873840540647507
},
"pixel": {
"x": 28,
"y": 32,
"width": 1266,
"height": 79
}
}
}

With outputDetail: "words" on the same image, the first paragraph's first word looks like this (also real, not estimated):

{
"writingDirection": "LTR",
"text": "Mild Splendour of the various-vested Night! Mother of wildly-working visions! hail!",
"words": [
{
"text": "Mild",
"boundingBox": {
"normalized": { "centerX": 0.067, "centerY": 0.1035, "width": 0.0958, "height": 0.1169 },
"pixel": { "x": 28, "y": 30, "width": 142, "height": 78 },
"rotation": 0.0049304598942399025
}
}
]
}

🛡️ Data integrity and limits

  • The Actor does not fill missing values with invented labels, zero coordinates, or placeholder text.
  • Word, line, paragraph, and region boxes are never estimated or interpolated. Every box, including rotation, comes directly from Google's own response.
  • Input images are limited to 25 MB each.
  • Translation is optional. If it fails after OCR succeeds, the row is marked PARTIAL and keeps the original text.
  • OCR and translation depend on external services, so response time and availability can vary.
  • Only process images that you are authorized to use.

💳 Pricing

This Actor uses pay-per-event pricing, so you pay for the images it processes rather than for compute time. The exact per-image price, including volume discounts for higher Apify plans, is shown on the Pricing tab of this Actor's page. Each image that cannot be loaded or decoded still gets its own FAILED row with a clear error code, so nothing is silently dropped. Set a maximum cost per run in the run options if you want a hard spending cap on a large batch.

⭐ Enjoying Google Lens OCR?

⭐ ⭐ ⭐ ⭐ ⭐
If this Actor made your image batch easier to audit, leave a rating.
A 5-star rating takes 10 seconds and helps other automation and AI teams find it. Your feedback also tells us which workflows to improve next.
★  Rate this Actor on Apify

❓ FAQ

Does the Actor keep batch order?

Yes. Rows are pushed in the same order as the normalized input list, even when images finish at different times.

Can I match results to my own database records?

Yes. Add a unique inputId to each item. The same value appears in its dataset row.

Does it return word bounding boxes?

Yes, when Output detail is set to words. Every word gets its own real box (from Google's own response, never estimated), with rotation. full and paragraphs stay at line-level geometry to keep the default payload small.

What happens when one image fails?

The rest of the batch continues. The failed image receives its own FAILED row with an error code and message.

What happens when translation fails?

Valid OCR data is retained, and the row is marked PARTIAL.

Does it run as a Standby web server?

Yes. Find this Actor's Standby hostname on its Standby tab in Apify Console, then call GET /ocr?imageUrl=... for single-image requests with no cold start. Batch runs (imageUrls, imagesBase64, imageKvsRecords) are only available through a normal run, not through Standby.

🔗 Other actors