API Documentation (Version 1.1)
API Documentation
Perform OCR and extract MRZ data from a scanned profile page
GET
https://api.iapp.co.th/passport-ocr/ocr
Input: A scanned profile page's image of a passport
Output: A JSON formatted result of the MRZ data extracted from on a profile page of the input image.
If you input file is multiple page PDF, it will return a JSON array contain each page results. Please see example below.
Request Body
Name | Type | Description |
---|---|---|
file* | File | Image/PDF file upload (PNG, JPEG, JPG, PDF) |
apikey* | String | iApp's API Key issued from https://ai.iapp.co.th |
Output JSON Response
Field name | Description | Example Value |
---|---|---|
check_composite | Overall check digit for upper and middle machine readable lines | 4 |
check_date_of_birth | Check digit on the date of birth. | 4 |
check_expiration_date | Check digit on the expiration date | 4 |
check_number | Check digit on the document number | 6 |
check_personal_number | Check digit on National ID Card number (personal number) | 3 |
country | Issuance of this document in 3 Letters Country Code | THA |
date_of_birth | Holder's date of birth in YYMMDD format. | 930710 |
expiration_date | Date of Document Expiration in YYMMDD format. | 250324 |
face | Photo of holder in base64 format | /9j/4AAQSkZJRgABAQAAAQABAAD/.... |
method | Reading method: always "direct" | direct |
mrz_type | Type of MRZ can be either: "TD1", "TD2", "TD3", "MRVA", "MRVB" | TD3 |
names | Holder's first name | MATHANIDA |
nationality | Holder's nationality in 3 Letters Country Code | THA |
number | Document number (Passport number) | AC1062346 |
personal_number | National ID Card number (personal number) | 0012345678913< |
raw_text | Raw MRZ text | P<THAPOSHNASWADIWONG<<MATHANIDA<<<<<<<<<<<<<\nAC10623466THA9307104F25030440012345678913<34 |
sex | Gender of holder. can be either "M" or "F". | F |
surname | Holder's sur name | POSHNASWADIWONG
|
type | MRZ document type field | P< |
valid_composite | Overall check digit validity | TRUE |
valid_date_of_birth | Date of birth check digit validity | TRUE |
valid_expiration_date | Expiration date check digit validity | TRUE |
valid_number | Number check digit validity | TRUE |
valid_personal_number | Personal number check digit validity | TRUE |
valid_score | Total validity score (0-100) | 100 |
Examples
Last updated