Extract text from images (OCR)
extract_text_from_imageExtract readable text from images, screenshots, photos, and scanned PDFs via OCR. Returns reading-order text with confidence and optional bounding boxes for receipts, invoices, and forms.
Instructions
OCR: extract the text from images, screenshots, photos and scanned PDFs reachable by URL (PNG, JPG, WEBP, TIFF, BMP, GIF, HEIC, PDF). Returns reading-order text per image or PDF page with an average confidence, and optionally every line with its pixel bounding box. Reads English and other Latin-script languages, Chinese and Japanese; PDFs that already contain a text layer are read exactly without OCR. Use it for receipts, invoices, forms, scanned documents, screenshots and product photos when you need the words in the image, not a description of it. For digital (non-scanned) PDFs and Office files prefer convert_document_to_markdown. Cost: $0.003 per image or PDF page read ($0.008 with quality "accurate"), billed to your Apify account; failed downloads and pages with no text are free. Runs the Apify actor kantolabs/image-to-text-ocr with your APIFY_TOKEN; maxTotalChargeUsd caps the spend per call.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pdfDpi | No | Render resolution for scanned PDF pages. Default 200; use 300 for small print. | |
| pdfMode | No | "auto" (default) uses a PDF page's own text layer when present and OCRs only scanned pages; "ocr" always runs OCR. | |
| quality | No | "fast" (default, $0.003/page) is right for screenshots, documents and Latin-script text. "accurate" ($0.008/page, about 4x slower) is better for Japanese, dense Chinese, stylized fonts and poor photos. | |
| sources | Yes | Direct links to images or PDF files, e.g. ["https://example.com/receipt.jpg", "https://example.com/scan.pdf"]. Each image and each PDF page is one charged result. | |
| maxPdfPages | No | Read only the first N pages of each PDF (each page is charged). Default 50. | |
| timeoutSecs | No | Give up after this many seconds (max 300, Apify's limit for synchronous runs). Default 280. For big batches, split the input into several calls. | |
| includeLines | No | Also return every text line with its confidence and pixel box [x0, y0, x1, y1] (much larger output; useful for tables or finding a value next to a label). Default false. | |
| minConfidence | No | Drop text lines recognized below this confidence. Default "0.5"; use "0.3" for very poor scans. | |
| maxTotalChargeUsd | No | Hard spending cap for this call in USD, enforced by Apify: the run stops once it has charged this much. Default 1 (server setting KANTO_MAX_CHARGE_USD). |