Base URL
API
URL | Request Methods | Content Type | Output Format | Character Set |
---|---|---|---|---|
api-base-url?partner_code=xxx&partner_key=xxx | POST | application/json | JSON | UTF-8 |
Authentication
Parameter | Type | Description | Required/Optional | Notes |
---|---|---|---|---|
partner_code | String | Partner Code | Required | Assigned by TD |
partner_key | String | Partner Key | Required | Assigned by TD |
Request
Parameter | Type | Description | Required/Optional | Notes |
---|---|---|---|---|
image | String | ID card image | Required | Base64 encoded image character stream of JPG, JPEG, PNG, the image cannot exceed 2M |
country | String | Country | Required | Country, required. Two-digit country code (uppercase). Compliant with ISO 3166 standard, such as Mexico: MX |
scenario | String | Scene | Required | Enumeration value:Ocr |
options | String | Additional feature output | Optional | Enumeration value: 1. images: to output document image, portraits, signature etc. 2. image_quality: to output image quality related parameters 3. document_forgery: Returns forgery detection parameters Support multiple selections, separated by commas, for example: images, image_quality, document_forgery |
OCR Image Specifications and Requirements
Requirement Category | Specific Guidelines and Requirements |
---|---|
Document Placement | - Ensure the document is centered in the image, with all four edges clearly visible and not obscured or cropped. - Maintain the original aspect ratio of the document to avoid distortion. - Avoid using non-authentic online samples (such as images found on the internet), blurry photographs, incomplete document edges, or severely distorted images. |
Image Quality | - Capture the image in an environment with adequate and even lighting, avoiding direct strong light or shadows. - Use a single, preferably light-colored background without complex patterns or textures. - Ensure the test image is clear, without blurriness or overexposure issues. |
Image Specifications | - The file size of the image should ideally be between 100KB and 500KB to ensure fast upload speeds and efficient processing, while avoiding excessive compression that could degrade recognition quality. |
Examples of Acceptable Pictures:
Examples of Non-acceptable Pictures:
Response
Parameter | Type | Description | Notes |
---|---|---|---|
code | Integer | API status code | |
message | String | Status information | When the API is in an abnormal state, the specific abnormal reasons are returned |
sequence_id | String | Unique response code | To track the unique identification of each request |
result | String | Verification result | Enumeration value: 1. success: if document type can be recognized, document is not expired, MRZ (if applicable) is valid and the format of text fields is valid, it will return success 2. error: if any one of the above document type, expiry, MRZ and text fields check fails, it will return error. In this case, it only represents verification failure, not an OCR parsing failure. OCR parsing information may still be returned in the card_info field. 3. not performed: checks are not performed |
status_info | Object | Verification details | Details of above result including verification details of document type, expiry, MRZ and text fields. Please refer to the data object of StatusInfo |
document_type_info | Object | Document type information | Default parameter. Please refer to the data object of DocumentTypeInfo |
card_info | Object | ID card information | OCR results for the identification document are returned in this section; the presence of data indicates a successful OCR outcome. Despite a 'result' field returning 'error', the OCR interpretation information may still be present in this field. Please refer to the data object of Cardinfo |
image_info | Object | Image information | Will be returned when related input parameter is selected. Even if the return value of the result field is 'error', this field may still return OCR parsing information. Please refer to the data object of ImageInfo |
image_quality_info | Object | Image quality information | Will be returned when related input parameter is selected. Please refer to the data object of ImageQualityInfo |
document_forgery_info | Object | Document forgery detection | Will be returned when related input parameter is selected. Please refer to the data object of DocumentForgeryInfo |
Data Objects
-
StatusInfo
Parameter Type Description Notes doc_type Integer Check whether the document type can be correctly identified Please refer to the CheckResult data dictionary expiry Integer Check whether the document has expired Please refer to the CheckResult data dictionary mrz Integer Check whether the MRZ (Machine Readable Zone) is correctly recognized Please refer to the CheckResult data dictionary text Integer Check whether the text format of the fields on the document meets the requirements Please refer to the CheckResult data dictionary { "doc_type":1, "expiry":0, "mrz":1, "text":1 }
-
DocumentTypeInfo
Parameter Type Description Notes document_name String Detailed document name document_description String Document type Identity Card, Passport, Driving License etc { "document_name":"Philippines - ePassport (2016)", "document_description":"Passport" }
-
CardInfo
Parameter Type Description Notes field_list Array
/ObjectList of text field name field_list.field_name String Text field name fieldList.lcid Integer Type LCID Please refer to LCID data dictionary field_list.validity_status Integer Effective state of text fields Check if the format of the text fields are valid.
Please refer to CheckResult data dictionaryfield_list.value_list Array Text field value list field_list.value_list.original_value String Text field original value The original value appeared on the document field_list.value_list.value String Test field value The parsed value based on original value field. Eg. for date type information, the format will be YYYY-MM-DD { "field_list":[ { "field_name":"Date of Expiry", "lcid":0, "validity_status": 1, "value_list":[ { "original_value":"23/08/2024", "value":"2024-08-23" } ] }, { "field_name":"Date of Birth", "lcid":0, "validity_status": 1, "value_list":[ { "original_value":"01/01/1979", "value":"1979-01-01" } ] } ] }
-
ImageInfo
Parameter Type Description Notes field_list Object List of graphics field name field_list.field_name String Graphic field name field_list.value_list Object List of graphics field values field_list.value_list.value String Graphical field value Image, base64 format. { "field_list":[ { "field_name":"Portrait", "value_list":[ { "value":"/4AAQSkZJRgABAQEBHwEfAADxxxxxx" } ] }, { "field_name":"Signature", "value_list":[ { "value":"/9j/4AAQSkZJRgABAQE***” " } ] } ] }
-
ImageQualityInfo
Parameter Type Description Notes result Integer Overall result list Object List of inspection results list.result Integer Single inspection results Please refer to the CheckResult data dictionary list.feature_type Integer Inspection area Reserved parameter, default to be 0 list.type Integer Single inspection type The type of test results.
Please refer to ImagequalityCheckType data dictionary -
{ "list": [ { "feature_type":0, "result": 1, "type": 1 }, { "feature_type":0, "result": 1, "type": 0 }, { "feature_type":0, "result": 1, "type": 7 }, { "feature_type":0, "result": 1, "type": 5 }, { "feature_type":0, "result": 1, "type": 4 }, { "feature_type":0, "result": 1, "type": 2 } ], "result": 1 }
DocumentForgeryInfoParameter Type Description Notes result String Overall result of forgery detection Enumeration:
1. pass: Passed, document is not forged
2. fail: Failed, document is forgeddetail Object List of forgery detection details If the result is "pass", this field is not returned; if the result is "fail", this field will list specific reasons, such as "black_white_print" (black and white print) and "screen_capture" (screen capture) -
{ "result":"fail", "detail":[ "black_white_print" ] }
Data Dictionary
-
CheckResult
Code Message Description 0 ERROR Check was performed and result is NEGATIVE 1 OK Check was performed and result is POSITIVE 2 WAS_NOT_DONE Check was NOT PERFORMED -
ImageQualityCheckType
Code Message Description 0 ImageGlares Signals glare presence on the image 1 ImageFocus Signals whether image is in focus 2 ImageResolution Signals if image resolution is below threshold 3 ImageColorness Signals if image is colorless 4 Perspective Signals if document in the image has prespective distortion above threshold 5 Bounds Signals if document is not fully present in the image 6 ScreenCapture Signals if an image is captured from screen 7 Portrait Signals if the portrait is present clearly -
LCID
Code Message Description 0 LATIN
Latin 1078 AFRIKAANS
Afrikaans 1052 ALBANIAN
Albanian 5121 ARABIC_ALGERIA
Arabic (Algeria) 15361 ARABIC_BAHRAIN
Arabic (Bahrain) 3073 ARABIC_EGYPT
Arabic (Egypt) 2049 ARABIC_IRAQ
Arabic (Iraq) 11265 ARABIC_JORDAN
Arabic (Jordan) 13313 ARABIC_KUWAIT
Arabic (Kuwait) 12289 ARABIC_LEBANON
Arabic (Lebanon) 4097 ARABIC_LIBYA
Arabic (Libya) 6145 ARABIC_MOROCCO
Arabic (Morocco) 8193 ARABIC_OMAN
Arabic (Oman) 16385 ARABIC_QATAR
Arabic (Qatar) 1025 ARABIC_SAUDI_ARABIA
Arabic (Saudi Arabia) 10241 ARABIC_SYRIA
Arabic (Syria) 7169 ARABIC_TUNISIA
Arabic (Tunisia) 14337 ARABIC_UAE
Arabic (U.A.E.) 9217 ARABIC_YEMEN
Arabic (Yemen) 1067 ARABIC_ARMENIAN
Armenian 2092 AZERI_CYRILIC
Azeri (Cyrillic) 1068 AZERI_LATIN
Azeri (Latin) 1069 BASQUE
Basque 1059 BELARUSIAN
Belarusian 1026 BULGARIAN
Bulgarian 1027 CATALAN
Catalan 3076 CHINESE_HONGKONG_SAR
Chinese (HongKong S.A.R.) 5124 CHINESE_MACAO_SAR
Chinese (Macao S.A.R.) 2052 CHINESE
Chinese 4100 CHINESE_SINGAPORE
Chinese (Singapore) 1028 CHINESE_TAIWAN
Chinese (Taiwan) 1050 CROATIAN
Croatian 1029 CZECH
Czech 1030 DANISH
Danish 1125 DIVEHI
Divehi 2067 DUTCH_BELGIUM
Dutch (Belgium) 1043 DUTCH_NETHERLANDS
Dutch (Netherlands) 3081 ENGLISH_AUSTRALIA
English (Australia) 10249 ENGLISH_BELIZE
English (Belize) 4105 ENGLISH_CANADA
English (Canada) 9225 ENGLISH_CARRIBEAN
English (Caribbean) 6153 ENGLISH_IRELAND
English (Ireland) 8201 ENGLISH_JAMAICA
English (Jamaica) 5129 ENGLISH_NEW_ZEALAND
English (New Zealand) 13321 ENGLISH_PHILIPPINES
English (Philippines) 7177 ENGLISH_SOUTH_AFRICA
English (South Africa) 11273 ENGLISH_TRINIDAD
English (Trinidad) 2057 ENGLISH_UK
English (United Kingdom) 1033 ENGLISH_US
English (United States) 12297 ENGLISH_ZIMBABWE
English (Zimbabwe) 1061 ESTONIAN
Estonian 1080 FAEROESE
Faeroese 1065 FARSI
Farsi 1035 FINNISH
Finnish 2060 FRENCH_BELGIUM
French (Belgium) 3084 FRENCH_CANADA
French (Canada) 1036 FRENCH_FRANCE
French (France) 5132 FRENCH_LUXEMBOURG
French (Luxembourg) 6156 FRENCH_MONACO
French (Monaco) 4108 FRENCH_SWITZERLAND
French (Switzerland) 1071 FYRO_MACEDONIAN
FYRO Macedonian 1110 GALICIAN
Galician 1079 GEORGIAN
Georgian 3079 GERMAN_AUSTRIA
German (Austria) 1031 GERMAN_GERMANY
German (Germany) 5127 GERMAN_LIECHTENSTEIN
German (Liechtenstein) 4103 GERMAN_LUXEMBOURG
German (Luxembourg) 2055 GERMAN_SWITZERLAND
German (Switzerland) 1032 GREEK
Greek 1095 GUJARATI
Gujarati 1037 HEBREW
Hebrew 1081 HINDI_INDIA
Hindi (India) 1038 HUNGARIAN
Hungarian 1039 ICELANDIC
Icelandic 1057 INDONESIAN
Indonesian 1040 ITALIAN_ITALY
Italian (Italy) 2064 ITALIAN_SWITZERLAND
Italian (Switzerland) 1041 JAPANESE
Japanese 1099 KANNADA
Kannada 1087 KAZAKH
Kazakh 1111 KONKANI
Konkani 1042 KOREAN
Korean 1088 KYRGYZ_CYRILICK
Kyrgyz (Cyrillic) 1062 LATVIAN
Latvian 1063 LITHUANIAN
Lithuanian 1086 MALAY_MALAYSIA
Malay (Malaysia) 2110 MALAY_BRUNEI_DARUSSALAM
Malay (Brunei Darussalam) 1102 MARATHI
Marathi 1104 MONGOLIAN_CYRILIC
Mongolian (Cyrillic) 1044 NORWEGIAN_BOKMAL
Norwegian (Bokmal) 2068 NORWEGIAN_NYORSK
Norwegian (Nynorsk) 1045 POLISH
Polish 1046 PORTUGUESE_BRAZIL
Portuguese (Brazil) 2070 PORTUGUESE_PORTUGAL
Portuguese (Portugal) 1094 PUNJABI
Punjabi 1047 RHAETO_ROMANIC
Rhaeto-Romanic 1048 ROMANIAN
Romanian 1049 RUSSIAN
Russian 1103 SANSKRIT
Sanskrit 3098 SERBIAN_CYRILIC
Serbian (Cyrillic) 2074 SERBIAN_LATIN
Serbian (Latin) 1051 SLOVAK
Slovak 1060 SLOVENIAN
Slovenian 11274 SPANISH_ARGENTINA
Spanish (Argentina) 16394 SPANISH_BOLIVIA
Spanish (Bolivia) 13322 SPANISH_CHILE
Spanish (Chile) 9226 SPANICH_COLOMBIA
Spanish (Colombia) 5130 SPANISH_COSTA_RICA
Spanish (Costa Rica) 7178 SPANISH_DOMINICAN_REPUBLIC
Spanish (Dominican Republic) 12298 SPANISH_ECUADOR
Spanish (Ecuador) 17418 SPANISH_EL_SALVADOR
Spanish (El Salvador) 4106 SPANISH_GUATEMALA
Spanish (Guatemala) 18442 SPANISH_HONDURAS
Spanish (Honduras) 2058 SPANISH_MEXICO
Spanish (Mexico) 19466 SPANISH_NICARAGUA
Spanish (Nicaragua) 6154 SPANISH_PANAMA
Spanish (Panama) 15370 SPANISH_PARAGUAY
Spanish (Paraguay) 10250 SPANISH_PERU
Spanish (Peru) 20490 SPANISH_PUERTO_RICO
Spanish (Puerto Rico) 1034 SPANISH_TRADITIONAL_SORT
Spanish (Traditional Sort) 3082 SPANISH_INTERNATIONAL_SORT
Spanish (International Sort) 14346 SPANISH_URUGUAY
Spanish (Uruguay) 8202 SPANISH_VENEZUELA
Spanish (Venezuela) 1089 SWAHILI
Swahili 1053 SWEDISH
Swedish 2077 SWEDISH_FINLAND
Swedish (Finland) 1114 SYRIAC
Syriac 1097 TAMIL
Tamil 1092 TATAR
Tatar 1098 TELUGU
Telugu 1054 THAI_THAILAND
Thai (Thailand) 1055 TURKISH
Turkish 1064 TAJIK_CYRILLIC
Tajik (Cyrillic) 1090 TURKMEN
Turkmen 1058 UKRAINIAN
Ukrainian 1056 URDU
Urdu 2115 UZBEK_CYRILIC
Uzbek (Cyrillic) 1091 UZBEK_LATIN
Uzbek (Latin) 1066 VIETNAMESE
Vietnamese 50001 CTC_SIMPLIFIED
CTC Simplified 50002 CTC_TRADITIONAL
CTC Traditional
Status Code
Code | Message | Description |
---|---|---|
200 | Success | Call Successfully |
301 | Service not purchased | No purchase of the servive |
302 | Traffic blocked | Traffic blocked |
303 | Traffic insufficient | Traffic insufficient |
304 | Service expired | Service expired |
305 | Daily maximum volume reached | Daily maximum volume reached |
11350 | Internal error | Internal error |
11301 | {parameter} empty | {parameter} empty |
11304 | The country partner located is not open | The country partner located is not open |
11340 | {parameter} error | {parameter} error |
Parameter Examples:
-
Input parameter
{ "image": "/9j/4AAQSkZJRgABAQAAeAB4AAD/********XLiqqauzsw1J3sf/2Q==", "country": "GB", "scenario": "Ocr", "options": "images,image_quality,document_forgery" }
-
Success
{
"result":"success",
"code":200,
"sequence_id":"2a7515e2bc094********20cf1ca0f72",
"message":"success",
"status_info":{
"doc_type":1,
"expiry":1,
"mrz":1,
"text":1
},
"document_type_info":{
"document_name":"Philippines - ePassport (2016)",
"document_description":"Passport"
},
"card_info":{
"field_list":[
{
"field_name":"Date of Expiry",
"validity_status":1,
"value_list":[
{
"original_value":"23/08/2024",
"value":"2024-08-23"
}
]
},
{
"field_name":"Date of Birth",
"validity_status":1,
"value_list":[
{
"original_value":"01/01/1979",
"value":"1979-01-01"
}
]
}
]
},
"image_info":{
"field_list":[
{
"field_name":"Portrait",
"value_list":[
{
"value":"/4AAQSkZJRgABAQEBHwEfAADxxxxxx"
}
]
},
{
"field_name":"Signature",
"value_list":[
{
"value":"/9j/4AAQSkZJRgABAQE***” "
}
]
}
]
},
"image_quality_info":{
"list":[
{
"feature_type":0,
"result":1,
"type":1
},
{
"feature_type":2,
"result":1,
"type":0
},
{
"feature_type":3,
"result":1,
"type":7
},
{
"feature_type":4,
"result":1,
"type":5
},
{
"feature_type":5,
"result":1,
"type":4
},
{
"feature_type":6,
"result":1,
"type":2
}
],
"result":1
},
"document_forgery_info":{
"result":"fail",
"detail":[
"black_white_print"
]
}
}
- Failed
{
"code": 302,
"sequence_id": "69b57131b6fb********61ccba118b60",
"message": "Traffic blocked"
}