Google Lens OCR: Image and PDF to Text with Word Boxes
Devansh Tiwari ยท @devanshtiwari365
Image and PDF to text with word boxes and translation
About
Google Lens OCR: Image and PDF to Text with Word Boxes
Turn screenshots, scans, receipts and PDF pages into searchable text. Every image gets one result row with the full text, the detected language, and the position of each line on the image. Add a target language and the row also carries a translation.
Start a 7-day free trial, paste an image link and read the text back in seconds. No card is needed for the trial.
๐ What you get
- Full text per image. Lines come back joined in reading order, with the detected language and a word count.
- Real positions. Line boxes come with every row. Switch the detail level to words and each word gets its own box and rotation. Boxes are read from the OCR response, never estimated.
- Paragraphs and regions. The paragraph level adds paragraph grouping and writing direction, and lists the regions and objects the engine found in the image.
- Optional translation. Add a language code such as
es,deorpt-BRand the original text stays in the row next to the translation. - PDFs, page by page. Give a PDF link and every page becomes its own row with its page number and the document's page count.
- Batches with honest rows. Each submitted image returns a row. A link that cannot be loaded returns a
FAILEDrow with a reason, so nothing disappears quietly. - Your format. Download JSON, CSV or Excel, or pull the rows into your own tools through the API.
๐ฅ Who it is for
- AI and RAG teams: "I need the text from thousands of screenshots and scanned pages before I index them."
- Automation teams: "I process receipts, labels and menus every week and want one row per image I can reconcile."
- Localization teams: "I want the original text and a translated copy in the same row."
- Developers: "I need word and line boxes to highlight text or rebuild a page layout."
๐ How it works
- Add your images. Paste one image link, a list of links, Base64 image data, or a PDF link.
- Pick the detail. Choose text only, lines, full, paragraphs or words, plus an optional translation language.
- Run it and read the rows. Open the results table, one row per image, or per PDF page.
๐ฅ Input
| Field | What it does |
|---|---|
| Image URL | One public image link. This is all most runs need. |
| Image URLs | A list of public image links for a batch. Each item can carry your own ID. |
| Base64 images | Image data you already hold, as raw Base64 or an image data URI. |
| PDF URL, PDF URLs | One or many public PDF links. Every page is read into its own row. |
| Max PDF pages | The most pages read per PDF, from 1 to 100. Defaults to 20. |
| Output detail | text_only, lines, full (default), paragraphs or words. |
| Translate to | Target language code, such as es, de or pt-BR. |
| Max concurrency | How many images are read at once in a batch, from 1 to 10. |
Provide at least one image or PDF source. Images can be up to 25 MB each.
๐ค Output
Each row is one image, or one PDF page. Fields the image does not have are left out, never filled.
| Field | What it holds |
|---|---|
inputId, sourceType, sourceReference | Your ID for the image, where it came from and its link |
status | SUCCEEDED, PARTIAL (text read, translation failed) or FAILED |
language | Language detected for the image |
fullText, wordCount | The extracted text and its word count |
translatedText, translationTarget | The translation, when you asked for one |
imageWidth, imageHeight | Source image size in pixels |
lines | Each line with its box in normalized and pixel coordinates |
paragraphs, regions | Paragraph grouping, writing direction, detected regions (paragraphs and words levels) |
geometryLevel | WORD or LINE, the finest boxes present in the row |
page, pageCount, sourcePdfUrl | PDF rows: page number, total pages and the document link |
errorCode, errorMessage | The reason, on rows that failed |
An image with no text returns a SUCCEEDED row with an empty text and a word count of 0.
๐ฐ Pricing
$19 a month after a 7-day free trial. Compute is billed from your prepaid credits during the trial and after it. In our test, a batch of 5 images ran in 8 seconds and used about 0.02 cents of compute.
๐ก Good to know
- Only public image and PDF links are read. Process only images you are allowed to use.
- Reading time and availability depend on an outside OCR service, so speed can vary.
- Translation is optional. If it fails after the text was read, the row is marked
PARTIALand keeps the original text. - The Actor is independent and not affiliated with Google.
FAQ
- Which inputs does it accept?
- Public image links (one or a list), Base64 image data, and public PDF links. A PDF is read page by page and each page becomes its own row with its page number and the document's page count. Images can be up to 25 MB each.
- Do I get the position of each word?
- Yes. Every row carries line boxes. Set Output detail to words and each word also gets its own box and rotation. The boxes come straight from the OCR response and are never estimated. A row's geometryLevel tells you whether it holds WORD or LINE boxes.
- Can it translate the text?
- Yes. Enter a target language code such as es, de or pt-BR and the row returns the translated text next to the original. If the translation fails after the text was read, the row is marked PARTIAL and keeps the original text.
- Does it read languages other than English?
- Yes. The language is detected for each image and returned in the row. In our test a Chinese poem image came back as zh-Hans with all five lines read correctly.
- What happens when an image has no text or the link is broken?
- An image with no text returns a SUCCEEDED row with empty text and a word count of 0. A link that cannot be loaded returns a FAILED row with an error code and message, so every image you submit stays visible in the results.
Input
Preview of the input form. Rent the Actor to fill it in and start runs from the console.
One image in, one result row out.
imageUrlPublic HTTP or HTTPS URL of the image to run OCR on. This is all most runs need. Use imageUrlInputId to attach your own correlation ID.
imageUrlInputIdOptional correlation ID for imageUrl. If omitted, the Actor assigns the deterministic ID single-1.
For runs that submit many images at once, from a URL list, raw Base64 data, or an Apify key-value store. Optional: skip this section for a single image.
imageUrlsPublic image URLs. API callers can include userData.inputId on each URL object for correlation. Leave empty if you only need the single Image URL above.
imagesBase64JSON array of objects with data and an optional inputId. data can be raw Base64 or an image data URI.
imageKvsRecordsJSON array of Apify key-value store records. Omit storeId to read from the run's default store. Records can contain binary image data, a Base64 string, or an object with a Base64 data field.
Optional. Give a PDF URL to OCR a multi-page document. Each page becomes its own result row (page, pageCount, sourcePdfUrl). Leave empty for image inputs.
pdfUrlPublic HTTP or HTTPS URL of a PDF. Every page is rasterized and run through OCR, producing one result row per page with its page number. Use maxPdfPages to cap how many pages are processed.
pdfUrlInputIdOptional correlation ID for pdfUrl. If omitted, the Actor assigns the deterministic ID pdf-single-1. Each page row appends -pN (for example pdf-single-1-p1).
pdfUrlsPublic PDF URLs. API callers can include userData.inputId on each URL object for correlation. Leave empty if you only need the single PDF URL above.
maxPdfPagesMost pages to process per PDF. Pages beyond this are skipped; each row still reports the PDF's true total page count. Keeps runs bounded in time and cost, since each page is one OCR call.
Choose the result detail, optional translation target, and safe batch concurrency.
outputDetailFull (default) returns joined text and line boxes. Paragraphs also groups lines and reports writing direction (left-to-right, right-to-left, or top-to-bottom). Words adds every word's own real bounding box and rotation angle, roughly 9x more geometry data. Text only omits all geometry. Every box comes directly from Google; the Actor never estimates or interpolates one.
translateToOptional language code such as es, de, ja, or pt-BR. Translation failures keep the OCR data and mark the row PARTIAL.
maxConcurrencyNumber of images processed at once. Lower this for very large images or constrained memory.
API
Bytewells speaks the Apify API. Existing integrations keep working: point apify-client at https://bytewells.com/api and use your Bytewells API token (Console โ Settings โ API access). The Actor ID is devanshtiwari365/google-lens-ocr (or devanshtiwari365~google-lens-ocr in URLs).
JavaScript ยท apify-client
import { ApifyClient } from 'apify-client';
const client = new ApifyClient({
token: process.env.BYTEWELLS_TOKEN,
baseUrl: 'https://bytewells.com/api',
});
const input = {
"imageUrl": "https://tesseract.projectnaptha.com/img/eng_bw.png",
"imageUrls": [],
"imagesBase64": [],
"imageKvsRecords": [],
"pdfUrls": [],
"maxPdfPages": 20,
"outputDetail": "full",
"maxConcurrency": 3
};
const run = await client.actor('devanshtiwari365/google-lens-ocr').call(input);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);Python ยท apify-client
import os
from apify_client import ApifyClient
client = ApifyClient(os.environ["BYTEWELLS_TOKEN"], api_url="https://bytewells.com/api")
run_input = {
"imageUrl": "https://tesseract.projectnaptha.com/img/eng_bw.png",
"imageUrls": [],
"imagesBase64": [],
"imageKvsRecords": [],
"pdfUrls": [],
"maxPdfPages": 20,
"outputDetail": "full",
"maxConcurrency": 3
}
run = client.actor("devanshtiwari365/google-lens-ocr").call(run_input=run_input)
items = client.dataset(run["defaultDatasetId"]).list_items().items
print(items)HTTP ยท curl
curl -X POST "https://bytewells.com/api/v2/acts/devanshtiwari365~google-lens-ocr/runs" \
-H "Authorization: Bearer $BYTEWELLS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"imageUrl":"https://tesseract.projectnaptha.com/img/eng_bw.png","imageUrls":[],"imagesBase64":[],"imageKvsRecords":[],"pdfUrls":[],"maxPdfPages":20,"outputDetail":"full","maxConcurrency":3}'Runs are billed as compute from your credit balance. Paid Actors need an active rental or trial; otherwise the API answers 402 rental-required.
Related
More Actors from the same publisher.

Bulk Image Downloader: Crawl Sites, Dedupe Photos, Export ZIP
Devansh Tiwari ยท @devanshtiwari365
Download every image from a public page or a list of image links: bounded crawl, SHA-256 dedupe, EXIF strip, format conversion and a status row per image.
Developer toolsAutomation$19/mo7-day free trial
Exhibitor List Scraper: Trade Show & Messe Aussteller Leads
Devansh Tiwari ยท @devanshtiwari365
Scrape trade show and Messe exhibitor lists: company, website, email, phone, booth and contacts. 148 shows, 30 platforms, one format. Excel, CSV, JSON.
Lead generationMarketingAutomation$19/mo7-day free trial
Amazon KDP Book Niche Analyzer: Self Publishing Niche Research
Devansh Tiwari ยท @devanshtiwari365
Amazon KDP niche research: real Best Sellers Rank, prices, ratings and competition for each Kindle book per keyword, plus an evidence-based opportunity score.
E-commerceMarketingSEO tools$19/mo7-day free trial
Mercari US Scraper: Active & Sold Listings, Price & Seller Data
Devansh Tiwari ยท @devanshtiwari365
Scrape Mercari US active and sold listings by keyword or link: USD price, condition, brand, category, likes and seller sales, plus a sold-price summary.
E-commerceMarketingLead generation$19/mo7-day free trial
StreetEasy Scraper: NYC Rentals, Sales and Price Drop Monitor
Devansh Tiwari ยท @devanshtiwari365
StreetEasy NYC rentals and sales as clean rows with gross and net rent, fees and price history, or a monitor that returns only new listings and price drops.
E-commerceReal estate$19/mo7-day free trial