Feature

OCR Extraction

Turn a photo, scan or PDF of any document into clean text and structured JSON through one API call.

What is OCR Extraction in Mahad OCR?

Available now. Mahad OCR routes every upload through an engine chain: a free deterministic reader for machine-readable documents, then an AI reader for everything else. Input: PNG, JPG or PDF up to 10 MB. PDFs are parsed up to 5 pages per upload. Limitation: Handwriting and low-quality phone photos reduce accuracy.

Available now

What it does

Mahad OCR routes every upload through an engine chain: a free deterministic reader for machine-readable documents, then an AI reader for everything else. You always get the same response shape, whichever engine handled the page.

How it works

  1. 1POST the file to /v1/documents/upload with your API key
  2. 2The document is queued and processed by a background worker
  3. 3Poll GET /v1/documents/{id} until status leaves "processing"
  4. 4Read values, field_evidence and the decision from the result

Sample result

Illustrative response shape using synthetic data.

{
  "status": "verified",
  "result": {
    "decision": "verified",
    "document_type": "passport",
    "values": { "surname": "ERIKSSON", "given_names": "ANNA MARIA", "document_number": "L898902C3", "date_of_birth": "1974-08-12", "expiry_date": "2027-04-15" },
    "field_evidence": { "surname": "corroborated", "document_number": "deterministic", "date_of_birth": "deterministic" },
    "review_reasons": []
  }
}

Supported inputs

PNG, JPG or PDF up to 10 MB. PDFs are parsed up to 5 pages per upload.

Fields returned

  • document_type — detected automatically
  • fields[] — every label/value pair the engine read
  • values{} — normalized keys (name, document_number, date_of_birth, expiry_date…)
  • field_review — each field marked ✓ confirmed or ⚠ check it, with the evidence and reason
  • engine_path — which engine produced the result

API

POST /v1/documents/upload · GET /v1/documents/{id}

Security & privacy

Documents belong to your tenant only. Every upload is written to a hash-chained audit log and can never be read by another tenant.

Current limitations

Handwriting and low-quality phone photos reduce accuracy. PDFs beyond 5 pages are truncated. Accuracy varies by document and capture quality — we publish no single universal accuracy number.

Try it on your own document

Run the live demo, or create an account and get an API key.