ProductsOCR API
OCR API
Extract printed and handwritten text from images, photos, scans and PDF documents.
1,000 images free every month for each OCR feature
Features
Turn images and documents into text
The OCR API detects and extracts text from images (text detection) and from dense documents such as scans, PDF and TIFF files (document text detection), returning the text together with its layout and bounding boxes. It is compatible with the Google Cloud Vision images:annotate and files:annotate REST interfaces.
Text detection
Read sparse text in photos, screenshots, signs and product labels with TEXT_DETECTION.
Document text detection
Read dense text in scans, receipts, invoices, forms and contracts with DOCUMENT_TEXT_DETECTION.
Printed and handwritten text
Recognize printed and handwritten text, such as notes, filled-in forms and annotations.
PDF, TIFF and GIF files
Send multi-page files directly and get text for up to 5 pages per synchronous request.
Bounding boxes and layout
Get word-level bounding boxes, plus the full text with its page structure, to rebuild the layout.
Dozens of languages
Read text in dozens of languages, including Chinese, Japanese and Korean. Add languageHints when you know the language.
Use cases
Where teams use the OCR API
Receipts and invoices
Capture merchants, dates and line items for expense and accounting workflows.
Forms and contracts
Digitize applications, agreements and other paperwork for review and search.
Photos and screenshots
Read signs, labels and on-screen text captured by your users' cameras.
Searchable archives
Turn scanned documents and PDF archives into text you can index and search.
Quickstart
Read your first image
Create an API key in the Vionex Console, then send an image or a document.
https://api.vionexlimited.com
X-Api-Key header, Authorization: Bearer or ?key=
-
Detect text in an image
Send the image as base64 in
image.contentand chooseTEXT_DETECTIONorDOCUMENT_TEXT_DETECTION. The full text is infullTextAnnotation.text, andtextAnnotationslists each word with its bounding box.- Up to 16 images per request
- Base64
image.contentup to 10 MB, or a publichttps://URL inimage.source.imageUri - Optional
imageContext.languageHints, such as["en", "zh"]
# On macOS, replace base64 -w0 FILE with base64 -i FILE curl -X POST "https://api.vionexlimited.com/v1/images:annotate" \ -H "X-Api-Key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "requests": [{ "image": {"content": "'"$(base64 -w0 receipt.jpg)"'"}, "features": [{"type": "DOCUMENT_TEXT_DETECTION"}], "imageContext": {"languageHints": ["en", "zh"]} }] }'import base64 import requests with open("receipt.jpg", "rb") as f: content = base64.b64encode(f.read()).decode() resp = requests.post( "https://api.vionexlimited.com/v1/images:annotate", headers={"X-Api-Key": "YOUR_API_KEY"}, json={ "requests": [{ "image": {"content": content}, "features": [{"type": "DOCUMENT_TEXT_DETECTION"}], "imageContext": {"languageHints": ["en", "zh"]}, }] }, timeout=60, ) resp.raise_for_status() print(resp.json()["responses"][0]["fullTextAnnotation"]["text"])import { readFile } from "node:fs/promises"; const content = (await readFile("receipt.jpg")).toString("base64"); const resp = await fetch("https://api.vionexlimited.com/v1/images:annotate", { method: "POST", headers: { "X-Api-Key": "YOUR_API_KEY", "Content-Type": "application/json", }, body: JSON.stringify({ requests: [{ image: { content }, features: [{ type: "DOCUMENT_TEXT_DETECTION" }], imageContext: { languageHints: ["en", "zh"] }, }], }), }); const { responses } = await resp.json(); console.log(responses[0].fullTextAnnotation.text);{ "responses": [ { "textAnnotations": [ { "locale": "en", "description": "MEETING NOTES\nRoom 4A · 10:00\n", "boundingPoly": { "vertices": [ {"x": 32, "y": 24}, {"x": 418, "y": 24}, {"x": 418, "y": 118}, {"x": 32, "y": 118} ] } }, { "description": "MEETING", "boundingPoly": { "vertices": [ {"x": 32, "y": 24}, {"x": 196, "y": 24}, {"x": 196, "y": 62}, {"x": 32, "y": 62} ] } } ], "fullTextAnnotation": { "text": "MEETING NOTES\nRoom 4A · 10:00\n" } } ] } -
Read PDF, TIFF and GIF files
Call
files:annotatewith the file ininputConfig.contentand itsmimeType. Each page comes back as its own response.- Up to 5 pages per file, chosen with
pages(default: the first 5) totalPagesreports the length of the whole file
# On macOS, replace base64 -w0 FILE with base64 -i FILE curl -X POST "https://api.vionexlimited.com/v1/files:annotate" \ -H "X-Api-Key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "requests": [{ "inputConfig": { "content": "'"$(base64 -w0 contract.pdf)"'", "mimeType": "application/pdf" }, "features": [{"type": "DOCUMENT_TEXT_DETECTION"}], "pages": [1, 2, 3] }] }'import base64 import requests with open("contract.pdf", "rb") as f: content = base64.b64encode(f.read()).decode() resp = requests.post( "https://api.vionexlimited.com/v1/files:annotate", headers={"X-Api-Key": "YOUR_API_KEY"}, json={ "requests": [{ "inputConfig": {"content": content, "mimeType": "application/pdf"}, "features": [{"type": "DOCUMENT_TEXT_DETECTION"}], "pages": [1, 2, 3], }] }, timeout=120, ) resp.raise_for_status() result = resp.json()["responses"][0] for page in result["responses"]: print(page["fullTextAnnotation"]["text"]) print("Total pages:", result["totalPages"])import { readFile } from "node:fs/promises"; const content = (await readFile("contract.pdf")).toString("base64"); const resp = await fetch("https://api.vionexlimited.com/v1/files:annotate", { method: "POST", headers: { "X-Api-Key": "YOUR_API_KEY", "Content-Type": "application/json", }, body: JSON.stringify({ requests: [{ inputConfig: { content, mimeType: "application/pdf" }, features: [{ type: "DOCUMENT_TEXT_DETECTION" }], pages: [1, 2, 3], }], }), }); const [file] = (await resp.json()).responses; for (const page of file.responses) { console.log(page.fullTextAnnotation.text); } console.log("Total pages:", file.totalPages); - Up to 5 pages per file, chosen with
API endpoints
| Method | Endpoint | Description |
|---|---|---|
| POST | /v1/images:annotate | Detect text in up to 16 images (Cloud Vision compatible) |
| POST | /v1/files:annotate | Detect text in PDF, TIFF and GIF files, up to 5 pages each |
Pricing
Pay per image
Graduated monthly pricing in US dollars, billed separately for each OCR feature.
| Monthly usage | Price (USD) |
|---|---|
| OCR text detection (per image or page)First 1,000 units per month are free | |
| 0 – 1,000 images / month | Free |
| 1,000 – 5,000,000 images / month | $1.50 per 1,000 images |
| Over 5,000,000 images / month | $0.60 per 1,000 images |
| OCR document text detection (per image or page)First 1,000 units per month are free | |
| 0 – 1,000 images / month | Free |
| 1,000 – 5,000,000 images / month | $1.50 per 1,000 images |
| Over 5,000,000 images / month | $0.60 per 1,000 images |
- Each OCR feature applied to an image is one unit: running text detection and document text detection on the same image counts as two.
- Each page of a PDF, TIFF or GIF file counts as one image.
- Prices are quoted per 1,000 images, and the last block is prorated, so you pay for exactly the units you use.
- Only images that are processed successfully are billed.
Example: 5,300 images with text detection in one month cost $6.45 (1,000 images free · 4,300 images × $1.50 per 1,000 images).
Start building with Vionex
Create an account in minutes and pay only for what you use.