Online OCR API
New
Read any document image or PDF and get its text back, as one block and page by page, when you need the words rather than a fixed set of fields.
Overview
Online OCR reads a document of any kind and returns the text it contains. It is the general reader in the catalog, for documents that have no dedicated API. The response carries the full text of the document and the text of each page, numbered, so a long file can be searched, indexed or passed to your own extraction rules page by page. When the document is one the catalog reads into fields, such as an invoice, a PAN card or a bank statement, use that API instead: it returns labelled values rather than text you have to parse.
- Category
- Document OCR APIs
- Coverage
- Printed documents as images or PDFs, in the languages and scripts the reader supports
- Input
- A document image or PDF uploaded by your application
- Output
- The document's full text and the text of each numbered page
- Typical users
- Document management, compliance, back office and product teams
- Coverage note
- Returns text, not fields; dedicated readers return labelled values
The overview and the sections after the reference are the FinSour API catalog’s own record for this service, rendered unaltered.
Endpoint URL and method
Supplied by FinSour platform API contract (finsour development at 80e8b83bf) on . OpenAPI document at commit 436311c32, API version 2026-11-01. The beta is served from the staging gateway.
Authentication
Send your API key in this header on every call, from your own server: a key sent from a browser is refused. A key starting fs_test_ calls the sandbox and one starting fs_live_ calls production, at the same address. Create keys in the FinSour console.
Supplied by FinSour platform API contract (finsour development at 80e8b83bf) on . OpenAPI document at commit 436311c32, API version 2026-11-01. The beta is served from the staging gateway.
Request parameters
Headers
| Name | Type | Required | Description | Constraints |
|---|---|---|---|---|
Idempotency-Key | string | Required | A key you generate for each attempt. Sending the same key again returns the first answer instead of running the check twice; the same key with a different body is refused. | 8 to 255 characters. Matches ^[A-Za-z0-9._:-]+$ |
FinSour-Version | string | Required | Send 2026-11-01 on this call and on every poll to get the receipt and the result described on this page. A call without it is served under 2026-09-01, whose job has a different shape. | — |
Body
| Name | Type | Required | Description | Constraints |
|---|---|---|---|---|
file | file | Required | The document to read. | — |
payload | string (JSON) | Optional | A JSON string carrying the call's options. | — |
payload. | object | Optional | Settings for this call. | — |
payload. | string | Optional | Your own reference for this call. It comes back unchanged as meta.reference. | 1 to 128 characters |
payload. | object | Optional | The person's consent to this check. | — |
payload. | boolean | Required | Send true once the person has agreed to the check. | Always true |
payload. | string (date-time) | Required | When the person gave consent. | — |
payload. | string | Required | What the check is for, for example kyc. | 1 to 64 characters |
Request samples
cURL
curl -X POST https://gateway.staging.finsour.io/v1/documents/text \
-H "X-Api-Key: $FINSOUR_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "FinSour-Version: 2026-11-01" \
-F "file=@<path-to-document>"Node.js
import { openAsBlob } from "node:fs";
const form = new FormData();
form.append("file", await openAsBlob("<path-to-document>"));
const response = await fetch("https://gateway.staging.finsour.io/v1/documents/text", {
method: "POST",
headers: {
"X-Api-Key": process.env.FINSOUR_API_KEY,
"Idempotency-Key": crypto.randomUUID(),
"FinSour-Version": "2026-11-01",
},
body: form,
});
console.log(response.status, await response.json());Python
import os
import uuid
import requests
response = requests.post(
"https://gateway.staging.finsour.io/v1/documents/text",
headers={
"X-Api-Key": os.environ["FINSOUR_API_KEY"],
"Idempotency-Key": str(uuid.uuid4()),
"FinSour-Version": "2026-11-01",
},
files={"file": open("<path-to-document>", "rb")},
timeout=30,
)
print(response.status_code, response.json())Generated from the fields above. Replace each value in angle brackets with your own; the key is read from FINSOUR_API_KEY.
Supplied by FinSour platform API contract (finsour development at 80e8b83bf) on . OpenAPI document at commit 436311c32, API version 2026-11-01. The beta is served from the staging gateway.
Response schema
| Name | Type | Present | Description | Constraints |
|---|---|---|---|---|
data | object | Always | The job that will read the document. | — |
data. | string | Always | The job's id. Poll GET /v1/jobs/{jobId} with it. | Matches ^[0-9A-HJKMNP-TV-Z]{26}$ |
data. | string | Always | Always queued: the job is accepted and has not started. | Always "queued" |
The result
Poll GET /v1/jobs/{jobId}. Once the job has finished, data holds these fields:
| Name | Type | Present | Description | Constraints |
|---|---|---|---|---|
jobId | string | Always | — | — |
status | string | Always | — | One of queued, processing, completed, needs_review, unreadable, failed, expired, cancelled |
documentType | string or null | Always | The kind of document found, once it has been read; null before that. | — |
confidence | number or null | Always | The document's confidence, 0 to 1, to two places; null until it has been read. | Minimum 0. Maximum 1 |
fields | object | Always | What was read. Every key is always present: null means the document does not carry it, or it could not be read with enough confidence. | — |
fields. | string or null | Always | — | — |
fields. | array of objects | Always | — | — |
fields. | integer or null | Always | — | — |
fields. | string or null | Always | — | — |
fieldsToReview | array of strings | Always | When status is needs_review, the fields a person should confirm; empty otherwise. | — |
failureReason | string | Sometimes | Present only when status is unreadable or failed. | One of UNREADABLE_IMAGE, LOW_CONFIDENCE, DOCUMENT_TYPE_MISMATCH, UNSUPPORTED_MEDIA_TYPE, FILE_TOO_LARGE, INPUT_CORRUPT, PAGE_LIMIT_EXCEEDED, TIMEOUT, PROCESSING_ERROR |
Supplied by FinSour platform API contract (finsour development at 80e8b83bf) on . OpenAPI document at commit 436311c32, API version 2026-11-01. The beta is served from the staging gateway.
Error codes
| Code | Status | Meaning | Retrying |
|---|---|---|---|
API_VERSION_UNSUPPORTED | 400 | That API version is no longer supported. | Do not retry automatically |
IDEMPOTENCY_KEY_INVALID | 400 | That Idempotency-Key does not meet the required format. | Do not retry automatically |
IDEMPOTENCY_KEY_REQUIRED | 400 | An Idempotency-Key header is required for this request. | Do not retry automatically |
REQUEST_MALFORMED | 400 | The request could not be parsed. | Do not retry automatically |
AUTH_KEY_EXPIRED | 401 | The API key is not valid. | Do not retry automatically |
AUTH_KEY_INVALID | 401 | The API key is not valid. | Do not retry automatically |
AUTH_KEY_MISSING | 401 | No API key was presented. | Do not retry automatically |
AUTH_KEY_REVOKED | 401 | The API key is not valid. | Do not retry automatically |
INSUFFICIENT_BALANCE | 402 | The available balance is not enough for this request. | Do not retry automatically |
AUTH_IP_NOT_ALLOWED | 403 | This API key may not be used from this address. | Do not retry automatically |
ENTITLEMENT_MISSING | 403 | This organization is not entitled to that product in this environment. | Do not retry automatically |
ORGANIZATION_SUSPENDED | 403 | This organization is not active. | Do not retry automatically |
PRODUCT_NOT_AVAILABLE | 403 | That product is not available. | Do not retry automatically |
PRODUCT_RETIRED | 403 | That product has been withdrawn. | Do not retry automatically |
SCOPE_INSUFFICIENT | 403 | This API key does not carry the scope this product requires. | Do not retry automatically |
PRODUCT_NOT_FOUND | 404 | No such product. | Do not retry automatically |
IDEMPOTENCY_KEY_REUSED | 409 | That idempotency key was already used for a different request. | Do not retry automatically |
PRICE_UNAVAILABLE | 409 | No active price covers this product right now. | Safe to retry |
REQUEST_IN_PROGRESS | 409 | An earlier attempt with this key is still running. | Safe to retry |
SETTLEMENT_PENDING | 409 | This request is awaiting reconciliation by an operator. | Do not retry automatically |
API_VERSION_SUNSET | 410 | That API version passed its announced sunset date. | Do not retry automatically |
REQUEST_TOO_LARGE | 413 | The request body is too large. | Do not retry automatically |
OCR_UNSUPPORTED_MEDIA_TYPE | 415 | That document format is not accepted. | Do not retry automatically |
UNSUPPORTED_MEDIA_TYPE | 415 | That content type is not accepted on this route. | Do not retry automatically |
SANDBOX_FIXTURE_MISSING | 422 | No sandbox fixture exists for this input. Use a different test value. | Do not retry automatically |
UPSTREAM_REJECTED | 422 | The upstream source rejected the input. | Do not retry automatically |
VALIDATION_FAILED | 422 | The request payload is invalid. | Do not retry automatically |
CONCURRENCY_LIMIT | 429 | Too many simultaneous requests. | Safe to retry |
OCR_QUEUE_SATURATED | 429 | The document queue is full. Retry shortly. | Safe to retry |
QUOTA_EXCEEDED | 429 | The allowance for this window is spent. | Do not retry automatically |
RATE_LIMITED | 429 | Too many requests. | Safe to retry |
INTERNAL_ERROR | 500 | An unexpected error occurred. | Safe to retry |
OUTCOME_UNCERTAIN | 502 | The outcome of this request is not yet known. Retry with the same Idempotency-Key. | Do not retry automatically |
UPSTREAM_UNAVAILABLE | 502 | The upstream source is unavailable. Retry shortly. | Safe to retry |
MAINTENANCE_MODE | 503 | The service is in a maintenance window. | Safe to retry |
NO_PROVIDER_AVAILABLE | 503 | No provider can serve this product right now. | Safe to retry |
OCR_UNAVAILABLE | 503 | Document reading is unavailable right now. Retry later. | Safe to retry |
SERVICE_OVERLOADED | 503 | The service is shedding load. Retry shortly. | Safe to retry |
UPSTREAM_TIMEOUT | 504 | The upstream source did not respond in time. | Safe to retry |
Supplied by FinSour platform API contract (finsour development at 80e8b83bf) on . OpenAPI document at commit 436311c32, API version 2026-11-01. The beta is served from the staging gateway.
Rate limits
| Scope | Limit | Window | At the limit |
|---|---|---|---|
| Your API key, within your organisation's limit | The figure in X-RateLimit-Limit | Per minute | 429 RATE_LIMITED, with Retry-After in seconds. Every answer past authentication carries X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset. |
Supplied by FinSour platform API contract (finsour development at 80e8b83bf) on . OpenAPI document at commit 436311c32, API version 2026-11-01. The beta is served from the staging gateway.
Use cases
- Archiving: making scanned files searchable
- Compliance: searching notices, letters and contracts by their text
- Back office: digitising scanned forms before extraction
- Product teams: building custom extraction on page text
- Routing: sending a file to the right team by what it contains
What this service does
Text, page by page
The whole document's text and each page's text, numbered, so long files can be handled one page at a time.
For documents without a dedicated reader
Use it for anything the catalog does not read into fields: letters, notices, forms and contracts.
A base for your own rules
Your extraction rules run over plain text, rather than over an image.
The right tool for fields
For labelled values from a known document, such as an invoice or a PAN card, use that document's own OCR API.
How a check runs
Arrange access
Tell us where Online OCR fits in your process. We arrange access for your organization under the applicable service contract, which also sets the file formats and sizes you can send.
Upload the document
Your application uploads the image or PDF and sends a request that names it.
Let the reading run
The request is accepted with a job reference and read in the background.
Collect the text
Collect the full text and the text of each page by the job reference.
Search, extract or archive
Index the text, run your own extraction over it, or store it beside the original file.
Questions
- What is an Online OCR API?
- An interface that reads a document image or PDF and returns the text it contains, as one block and page by page.
- Does Online OCR return fields such as names or amounts?
- No. It returns text. To get labelled fields from a known document, use that document's own OCR API, such as Invoice OCR or PAN Card OCR.
- Can it read multi-page PDFs?
- Yes. The text of each page is returned with its page number. Page limits are set in the service contract.
- Does it keep the layout of the page?
- It returns the text in reading order. For tables, use PDF to Excel OCR, which returns each table as rows and columns.
- Do I need consent to read a document?
- That depends on what the document contains. If it holds personal data, take consent for a stated purpose before reading it.
- What happens when a page cannot be read?
- Text that could not be read with enough confidence is left out rather than guessed, and the confidence for the document is returned with the result.
Catalog entry last updated .