OCR Books API

Turn scanned books into verifiable searchable text.

Preserve the chain from edition to scan to page to text span, with reversible preprocessing, layout, reading order, confidence, review, exports, and processing versions.

Core resources

Use separate resources for scans, pages, regions, text layers, processing jobs, exports, and corrections. A scan belongs to an edition but has its own identity, rights profile, source institution, capture details, checksums, page manifest, and completeness notes.

Processing stages

1. Validate + manifest
2. Normalize images
3. Detect layout
4. Recognize + order text
5. Review + publish exports

Page identity is non-negotiable

Every text span should retain scan ID, page ID, region coordinates, printed page label when known, reading order, engine version, and quality state. That mapping supports search highlighting, citations, correction, and later reprocessing.

Two text layers

A page-faithful layer preserves regions and coordinates. A normalized reading layer joins line-break hyphenation, reconstructs paragraphs, and removes repeated headers for search or AI. Do not silently replace the source-faithful layer with model-rewritten prose.

Asynchronous API shape

POST /v1/ocr-jobsREFERENCE JOB
{
  "scan_id": "scan_01",
  "languages": ["eng"],
  "profile": "BOOK_STANDARD",
  "outputs": ["PAGE_JSON", "SEARCH_TEXT", "SEARCHABLE_PDF"]
}

Return stage progress and per-page errors. Allow retries for failed stages, cancellation, and versioned reruns. Idempotency and input checksums prevent duplicate expensive work while tenant and rights boundaries prevent inappropriate cross-account reuse.

Quality and correction

Confidence values prioritize review; they do not prove accuracy. Measure reviewed samples, suspicious-character patterns, blank-page anomalies, language mismatch, and layout completeness. Correction tools should retain machine output and human changes with history.

Search and AI integration

Index cited text spans with page and coordinate references. AI retrieval should use those spans and exclude or flag low-quality pages. Treat OCR text as untrusted content so instructions printed inside a book cannot override system policy.