Skip to content

Indoniesia KTP OCR

KTP + name recognition

Code example:

curl --location --request POST 'https://api.ekycpro.com/v1/id_ocr/general' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'X-API-Key: AbcdEfgh' \
--data-urlencode 'img=BASE64_ENCODE_VALUE'

Response for recognition success

{
"status": "OK",
"message": {
"name": "HELLO NAME",
"id": "3171024302821001",
"pob": "GARESSI SUPPA",
"dob": "01-01-1961",
"gender": "LAKI-LAKI",
"address": "BTN UNHALU BLOK C NO. 28",
"rt": "006",
"rw": "003",
"village": "KAMBU",
"district": "KAMBU",
"religion": "ISLAM",
"marital_status": "KAWIN",
"work": "PEGAWAI NEGERI SIPIL (PNS)",
"nationnality": "WNI",
"city": "KOTA KENDARI",
"province": "SULAWESI TENGGARA"
}
}

Response for recognition fail

{
"status": "FAIL",
"message": "check input image and retry"
}

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": "Service is not available right now, please try again later"
}

HTTP request

POST https://api.ekycpro.com/v1/id_ocr/general

Request parameters

parameterdescription
imgstring, 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

fieldsdescription
statusstatus code
messageid: ID card number, NIK
name: name
pob: place of birth, maybe empty
dob: date of birth, maybe empty
gender: gender, maybe empty
address: address, maybe empty
province: province, maybe empty
city: city, maybe empty
district: district, maybe empty
village: village, maybe empty
rt: RT, maybe empty
rw: RW, maybe empty
religion: religion, maybe empty
marital_status: marital status, maybe empty
work: work, maybe empty
nationnality: nationnality, maybe empty

Status code

statusdescription
OKcharge, success
FAILcharge, image recognition error, please check input image
INVALID_REQUESTfree, invalid request parameters
IMAGE_INVALID_FORMATfree, invalid image format, image format should be one of jpeg/jpg/png/bmp
IMAGE_INVALID_SIZEfree, invalid image size, should be less than 2M
INNER_ERRORfree, server error