Skip to main content

General Thai Document OCR

The General Thai Document OCR API converts printed Thai and English documents into machine-readable text. It accepts images (PNG, JPEG), PDF files, and Microsoft Office documents, and returns plain text, layout-structured JSON, or generated Microsoft Word, PowerPoint, Excel, or searchable PDF files. The production service processes a page of plain text in 0.53 seconds (median) and sustains 4.28 pages per second — more than 15,000 pages per hour. Measured character accuracy is 94.8 percent on an independent public benchmark of scanned Thai government documents; see Accuracy.

Live Demo

Upload a document, or select one of the examples below.

Try Our AI Demo

Login or create a free account to use this AI service demo and explore our powerful APIs.

Get 100 Free Credits (IC) when you sign up!

Offer ends December 31, 2025

Example Images (Click to try)

Example 1
Try Demo
Example 2
Try Demo
Example 3
Try Demo
Example 4
Try Demo
Example 5
Try Demo
Example 6
Try Demo
Example 7
Try Demo
Example 8
Try Demo
Example 9
Try Demo
Example 10
Try Demo
Example 11
Try Demo
Example 12
Try Demo

Quick Start

You need an API key from the iApp AI Portal. Send the document as multipart/form-data:

curl -X POST https://api.iapp.co.th/v3/store/ocr/document/ocr \
-H "apikey: YOUR_API_KEY" \
-F "file=@document.pdf"
{
"text": ["ด่วนที่สุด\nที่ มท ๐๔๐๒.๖ ..."],
"time": 0.53,
"iapp": { "page": 1, "char": 1376 }
}

Code examples for Python, JavaScript, PHP, Swift, Kotlin, Java, and Dart are in the Technical Reference.

Endpoints and Pricing

All endpoints accept the same input and charge 1 IC per input page. Choose the endpoint by the output you need.

EndpointOutputPrice
POST /v3/store/ocr/document/ocrPlain text1 IC per page
POST /v3/store/ocr/document/layoutJSON with text, bounding boxes, and component types1 IC per page
POST /v3/store/ocr/document/docxDownload link to a generated Microsoft Word (.docx) file1 IC per page
POST /v3/store/ocr/document/pptxDownload link to a generated Microsoft PowerPoint (.pptx) file1 IC per page
POST /v3/store/ocr/document/xlsxDownload link to a generated Microsoft Excel (.xlsx) file1 IC per page
POST /v3/store/ocr/document/searchablePDFDownload link to a searchable PDF — the original pages with a selectable text layer1 IC per page

Every endpoint is also available under the legacy /document-ocr prefix, for example /document-ocr/pptx. For on-premise deployment, see Data Security.

Performance

Measured on the production service, August 2026.

MetricValue
Median processing time (plain text)0.53 s per page
Sustained throughput4.28 pages per second (15,400 pages per hour)
Maximum file size30 MB
Supported input formatsPNG, JPEG, PDF, DOC, DOCX, XLS, XLSX, PPT, PPTX

Accuracy

Accuracy is measured on an independent, publicly available benchmark: 242 scanned pages from 20 Thai Administrative Court judgments, scored against their original source documents.

MetricResult
Character error rate (CER)5.2% (94.8% character accuracy)
Word error rate (WER)7.0% (93.0% word accuracy)
Document layout analysis96.97% AP

The benchmark counts every difference between the OCR output and the source document as an error, including headers and typesetting differences, so the figures above are conservative. Clean, well-scanned prints score higher. The full methodology, per-document results, and comparison against a leading global cloud OCR service are published in the benchmark whitepaper:

Download the benchmark whitepaper (PDF)

Data Security and Compliance

  • The service is GDPR and PDPA compliant.
  • Uploaded documents are used only to produce the requested output.
  • Generated download links expire after 10 minutes, and generated files are deleted from the server within one hour.
  • A fully self-contained on-premise deployment is available, in which no document data leaves your infrastructure. Contact us for details.

Technical Reference

Request

All endpoints accept multipart/form-data with the apikey header.

FieldRequiredDescription
fileYes, unless base64 is usedThe document: image, PDF, or Microsoft Office file
base64NoA single image as a Base64 string, as an alternative to file
emailNoIf set, the result is emailed to this address instead of returned in the response

Every response carries the header iapp-input-pages with the number of input pages, which equals the number of IC charged.

Responses

/ocr returns one text string per page:

{
"text": ["ด่วนที่สุด\nที่ มท ๐๔๐๒.๖ มั่นคงและชุมชนพึ่งตนเองได้\nภายในปี ๒๕๖๕ ..."],
"time": 0.53,
"iapp": { "page": 1, "char": 1376 }
}

/layout returns, for every page, the detected components with their text, bounding box (in page coordinates), and component type:

{
"pages": [
{
"page": 1,
"components": [
{
"text": "หนังสือรับรองผลงาน",
"bb_left": 282.3, "bb_top": 165.2, "bb_right": 374.6, "bb_bottom": 184.7,
"type": "CenTitle"
},
{
"text": "หนังสือรับรองฉบับนี้ออกให้เพื่อรับรองว่า ...",
"bb_left": 120.1, "bb_top": 194.7, "bb_right": 560.1, "bb_bottom": 271.1,
"type": "Para1"
}
]
}
],
"time": 1.84,
"iapp": { "page": 1, "char": 1673 }
}

/docx, /pptx, /xlsx, and /searchablePDF return a signed download link. The link is valid for 10 minutes:

{
"path": "https://api.iapp.co.th/document-ocr/files/pZWNyZXQtZXhhbXBsZS10b2tlbg...",
"time": 1.72,
"iapp": { "pages": 1, "char": 1229 }
}

Layout Component Types

The type field of each component in the /layout response is one of the following.

GroupTypes
Titles and body textCenTitle, Para1Para5, BodyText3, Text, TextBox
ListsList, ListNum1ListNum4, ListCon1ListCon4
Indented blocksIndent1Indent5
TablesTable, TableLike
Page furnitureHeader, Footer, Date, NextPage, UpperLeft, UpperRight, TopRight, BottomLeft, BottomRight
GraphicsFigure, Logo, LeftLogo
SignaturesSignature

Code Examples

curl -X POST https://api.iapp.co.th/v3/store/ocr/document/ocr \
-H "apikey: YOUR_API_KEY" \
-F "file=@document.pdf"

Limitations

  • Printed text only; handwriting is not supported.
  • Scans at 200 dpi or higher give the best results.
  • Files larger than 30 MB are rejected.

Changelog

VersionDateChanges
v2.1.13-2026082222 Aug 2026Upgraded recognition engine: 15% relative reduction in character error rate on the public benchmark; median per-page processing time reduced from 3.33 s to 0.53 s. Generated files are now served directly by the API with signed, expiring links. Fully self-contained on-premise deployment available. PowerPoint (.pptx), Excel (.xlsx), and searchable-PDF outputs are now generally available.
v2.1.12-2025111616 Nov 2025Added the iapp-input-pages response header.
v2.0Aug 2022Document layout analysis and Microsoft Word output.