Malaysia ID Card OCR
Recognizing the front of a Malaysia ID card
Code example:
curl --location --request POST 'https://api.ekycpro.com/v1/my_ocr/general?token=TOKEN' \--header 'Content-Type: application/x-www-form-urlencoded' \--header 'X-API-Key: AbcdEfgh' \--data-urlencode 'img=BASE64_ENCODE_VALUE'
Response for ID front card recognition success
{ "status": "OK", "message": { "CardNumber": "460619-12-5087", "DateOfBirth": "19460619", "Gender": "LELAKI", "Name": "ABD RAUF BIN HAMSAH", "Address": "KAMPUNG MASJID PO BOX 42 89007 KENINGAU SABAH" }}
Response for recognition fail
{ "status": "FAIL", "message": "check input image and retry"}
Response for not recognized card type
{ "status": "FAIL", "message": "not identity card"}
Response for invalid request parameters
{ "status": "INVALID_REQUEST", "message": "check request params"}
Response for invalid image format
{ "status": "IMAGE_INVALID_FORMAT", "message": "image format not support"}
Response for image size larger than 2M
{ "status": "IMAGE_INVALID_SIZE", "message": "image larger than 2M"}
Response for server error
{ "status": "INNER_ERROR", "message": "Inner error, please retry later"}
HTTP request
POST https://api.ekycpro.com/v1/my_ocr/general
Request parameters
parameter | description |
---|---|
img | string , base64 encoded image. It is recommended that the image be less than 200KB, so it will be returned within 2 seconds, otherwise the return time will be longer. |
Response format for ID card
fields | description |
---|---|
status | status code |
message | CardNumber : card number Name : name Gender : gender DateOfBirth : date of birth Address : address |
Status code
status | description |
---|---|
OK | charge , success |
FAIL | charge , image recognition error, please check input image |
INVALID_REQUEST | free , invalid request parameters |
IMAGE_INVALID_FORMAT | free , invalid image format, image format should be one of jpeg/jpg/png/bmp |
IMAGE_INVALID_SIZE | free , invalid image size, should be less than 2M |
INNER_ERROR | free , server error |