canonical: https://jentic.com/apis/ocr-space/ocr-space

# OCR.space API

Jentic publishes the only available OpenAPI specification for OCR.space API, keeping it validated and agent-ready. OCR.space converts images and PDFs into machine-readable text using optical character recognition. The API supports more than thirty languages, multiple OCR engines tuned for different document styles, and word-level coordinate output for downstream layout work. Input can be supplied as a multipart file upload, a URL, or a base64-encoded image, making it easy to drop into pipelines that already handle one of those input shapes.

## For AI agents

Convert images and PDFs to machine-readable text with multilingual OCR and optional word-level coordinates.

## Scope

Does not handle structured field extraction, document classification, or signature detection - use for OCR.space image and PDF text extraction only.

## Capabilities

- Extract text from a multipart-uploaded image or PDF via `/parse/image`
- Extract text from a publicly hosted image URL via `/parse/imageurl`
- Return word-level bounding box coordinates for layout-aware downstream parsing
- Switch OCR engines to favour Latin scripts, multi-script content, or noisy scans
- Process documents in 30+ languages including non-Latin scripts
- Convert receipts, ID scans, and form scans into searchable text fields

## Use cases

### Receipt Digitisation Pipeline

Digitise expense receipts at scale by submitting each scanned image to `/parse/image` and storing the returned text alongside the original. Word-level coordinates make it possible to reconstruct line items and totals in downstream parsers. Suitable for finance operations teams running spend automation or for travel platforms that need to attach searchable text to attached receipts.

Example prompt: Upload a receipt image to `/parse/image` with engine 2 and return the extracted text plus the bounding boxes for each line.

### Form and ID Document OCR

Pull structured fields out of scanned forms and ID documents by sending them to `/parse/image` and applying field-specific regexes to the returned text. The multilingual support handles non-Latin scripts on government forms, while word coordinates help align extracted text to known field positions. Pair with a downstream validator for high-confidence pipelines.

Example prompt: Upload a passport scan to `/parse/image` and return the MRZ region text plus its bounding box.

### URL-Based Image Text Extraction

Extract text from publicly hosted images without uploading them by passing the URL to `/parse/imageurl.` Useful for moderation pipelines that already track image links, for SEO tools mining text from public images, or for pulling captions from screenshots already stored on a CDN. The endpoint accepts the same engine and language parameters as the upload variant.

Example prompt: Call `/parse/imageurl` with a public image URL and language 'eng' and return the extracted text.

### AI Agent Document Reader

An AI agent ingesting an attached image or PDF can call OCR.space through Jentic to convert the binary into text before reasoning about the content. The agent discovers the parse operation by intent, picks the correct endpoint depending on whether the source is local or a URL, and submits the request without dealing with multipart encoding or auth headers itself.

Example prompt: Use Jentic to call `/parse/imageurl` on a screenshot URL and return the extracted text as plain prose.

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| POST | `/parse/image` | OCR a multipart-uploaded image or PDF |
| GET | `/parse/imageurl` | OCR a publicly hosted image by URL |

## Key resources

- **Parse** — Run OCR on uploaded files or remote image URLs, with options for language, engine, and coordinate output.

## AI readiness

This API is usable in Jentic One now. Its AI-readiness score against Jentic's framework shows where it stands today and where improvements would make it even easier for agents to use.

- **Score:** 65 / 100
- **Maturity:** AI-Aware
- **Dimensions:**
  - Foundational Compliance: 100 / 100
  - Developer Experience & Jentic Compatibility: 63 / 100
  - AI-Readiness & Agent Experience: 54 / 100
  - Agent Usability: 94 / 100
  - Security: 50 / 100
  - AI Discoverability: 50 / 100
- **View full report:** https://jentic.com/apis/ocr-space/ocr-space/scorecard
- **How the score is calculated:** https://docs.jentic.com/reference/api-readiness-framework/overview/
- **More about the dimensions:** https://docs.jentic.com/reference/api-readiness-framework/specification/#dimensional-model-overview

### Score it yourself

Every API in the directory is allowlisted, so you can re-score it with no key required.

- **Score your own API:** https://jentic.com/scorecard.md
- **Scoring CLI agent skill:** https://github.com/jentic/jentic-api-scorecard/blob/main/skills/jentic-api-scorecard/SKILL.md

```sh
npx @jentic/api-scorecard-cli score <openapi-url>
```

## Why Jentic

- **Setup:** Wiring OCR.space by hand means setting up its apikey header, deciding whether to send an image upload to `/parse/image` or a URL to `/parse/imageurl`, and handling parse-result polling yourself. Through Jentic you install once, import OCR.space from the API Directory, store the API key once, and your agent calls it.
- **Permission scoping:** OCR.space carries no resource id in the URL path, so scoping is by operation: you limit the agent to the operations it needs, such as parsing an uploaded image or parsing an image URL, and it can call nothing else. You choose which of those two operations are in the allowed set.
- **Credential handling:** Your OCR.space API key is stored once, encrypted, by your own Jentic One instance and injected into the apikey header at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'extract text from an image' or 'read text from an image URL', and Jentic returns the matching OCR.space operation with its input schema so the agent calls `/parse/image` or `/parse/imageurl` without browsing the reference docs.

## Related APIs

- **Mindee API** — Document AI for receipts, invoices, and IDs with structured field output
- **Veryfi API** — Receipt and invoice OCR with parsed line items and totals
- **Rossum API** — AI-driven invoice and document data capture
- **Cloudmersive OCR API** — OCR for images and PDFs across multiple operations

## FAQ

### Why is there no official OpenAPI spec for OCR.space API?

OCR.space does not publish an OpenAPI specification. Jentic generates and maintains this spec so that AI agents and developers can call OCR.space API via structured tooling. It is validated against the live API and kept up to date. Get started with Jentic One, the self-hosted execution layer.

### What authentication does the OCR.space API use?

An API key supplied via the apikey header on each request. Jentic stores the key encrypted in its vault and injects it at execution time so the raw secret never enters the agent's prompt or model context.

### Can I OCR a PDF with this API?

Yes. `/parse/image` accepts PDF uploads in addition to images, and OCR.space processes each page through the chosen OCR engine. The response includes parsed text per page along with optional word coordinates.

### What are the rate limits for the OCR.space API?

OCR.space's free tier is throttled by request rate and file size; paid tiers raise both. The spec does not encode the limit numerically - confirm your tier in the OCR.space dashboard and handle 429 responses with exponential backoff.

### How do I OCR an image URL through Jentic?

Search Jentic for 'OCR an image from a URL', load the schema for `/parse/imageurl`, and execute with the URL. With pip install jentic the call is await client.search(...), await client.load(...), await client.execute(...) inside an asyncio.run wrapper.

### Which OCR engine should I pick?

OCR.space exposes multiple engines via a request parameter - engine 2 generally handles complex scans and non-Latin scripts better, while engine 1 is faster for clean Latin-script documents. Test both on a representative sample before settling.

### Does the API return word coordinates?

Yes - set the appropriate request flag and the response includes per-word bounding boxes alongside the text. This is useful for layout-aware parsers that need to align text back to the source image.

### Can I limit what my agent is allowed to do with the OCR.space API?

Yes. Because the OCR.space API carries no resource id in its URL path, Jentic One, which you host yourself, scopes access by operation: your own rules decide whether the agent may parse an uploaded image via `/parse/image`, parse a hosted image URL via `/parse/imageurl`, both, or neither. Any operation you leave out of the allowed set cannot be called, and your API key is injected only when a permitted operation runs. This lets you grant, for example, URL-based OCR while blocking file uploads.
