/ocr/idcard

1.API Specification
2.Request Params
3.Response Params
4.Error Codes
5.Sample

1.API Specification

This API is used to recognize ID card of Philippine, and extract the key information.

Image spec

1. Format: JPG(JPEG), PNG
2. Between 128*128 and 6000*6000 (pixels), Recommended resolution: 1280*1280
3. File size: no larger than 5 MB

Request Method

POST

Request URL

https://cloudapi.philippine.accuauth.com/ocr/idcard

Debugging Tool

Debugging Tool

2.Request Params

2.1 Request Header

Parameter Type Required Description
X-DF-API-ID string Yes For API credentials,Please visit API Request
X-DF-API-SECRET string Yes For API credentials,Please visit API Request

2.2 Request Body

Fields Type Description
optional file file Binary data of the image
optional image_base64 string Base64 encoded data of image

Either parameter file or image_base64 must be provided as a request parameter.

You MUST add image stream to multipart/form-data section of POST message when using file parameter.

3.Response Params

Fields Type Description
request_id string Unique id of each request
status string Response status, OK if request success, other if failed; See Error Codes for details
results array The array of card ocr results,See results belowed for details
Elements in results:
Fields Type Description
card_side string The side of ID card: front
card_type string The type of ID card, currently supported types are the following: 1.ID(The Philippine National ID), 2.UMID(Unified Multi-Purpose ID), 3.PASSPORT, 4.DL(Driving License), 5.SSS(Social Security System), 6.TI(Tax ID Card), 7.VOTER(Voter ID Card), 8.HC(Health Card), 9. HCO(Old Health Card)
card_info object The key infomation of card
Elements in the card_info
  • Front side of ID card info:
Fields Type Description
id_number string ID Number of National ID Card
give_name string Given name
middle_name string Middle name
last_name string Last name
birthday string Date of birth
birthday_s string Fomatted date of birth, format: dd-mm-yyyy
address string Address
  • Front side of UMID card info:
Fields Type Description
id_number string ID card number
surname string Surname
give_name string Given Name
middle_name string Middle name
address string Address detail
birthday string Date of birth
birthday_s string Formatted date of birth, format: dd-mm-yyyy
gender string Gender
gender_s string Formatted gender, M = MALE or F = FEMALE
  • Front side of PASSPORT card info:
Fields Type Description
passport_number string Passport number
passport_type string Passport type: P
surname string Surname
give_name string Given Name
middle_name string Middle name
gender string Gender
gender_s string Formatted gender, M = MALE or F = FEMALE
birthday string Date of birth
birthday_s string Formatted date of birth, format: dd-mm-yyyy
birth_place string Place of birth
country_code string Country code
expiry_date string Expiry date of the passport
expiry_date_s string Formatted expiry date of the passport, format: dd-mm-yyyy
issue_authority string Issue authority
issue_date string Issue date of the passport
issue_date_s string Formatted issue date of the passport
line_one string Line 1 detail information
line_two string Line 2 detail information
nationality string Nationality of the person
  • Front side of DL card info:
Fields Type Description
dl_license_number string Number of driving license
dl_code string Dl codes or restrictions
name string Name
address string Address
agency_code string Agency code
birthday string Date of birth
birthday_s string Fomatted date of birth, format: dd-mm-yyyy
blood_type string Blood type
gender string Gender
gender_s string Formatted gender, M = MALE or F = FEMALE
eyes_color string Color of eyes
weight string Weight of the person
height string Height of the person
conditions string Conditions
expiry_date string Expiry date of the card
expiry_date_s string Formatted expiry date of the card
nationality string Nationality of the person
  • Front side of SSS card info:
Fields Type Description
sss_id_number string ID Number of SSS card
name string Name
birthday string Date of birth
birthday_s string Fomatted date of birth, format: dd-mm-yyyy
  • Front side of TI card info:
Fields Type Description
tax_id_number string ID Number of Tax Card
name string Name
birthday string Date of birth
birthday_s string Fomatted date of birth, format: dd-mm-yyyy
issue_date string Issue date of the card
issue_date_s string Formatted issue date of the card
address string Address
  • Front side of VOTER card info:
Fields Type Description
voter_id_number string ID Number of Voter Card
name string Name
birthday string Date of birth
birthday_s string Fomatted date of birth, format: dd-mm-yyyy
precinct_no string Precinct No
citizenship string Citizenship
civil_status string Civil status
address string Address
  • Front side of HC card info:
Fields Type Description
hc_id_number string ID Number of Health Card
name string Name
birthday string Date of birth
birthday_s string Fomatted date of birth, format: dd-mm-yyyy
gender string Gender
gender_s string Formatted gender, M = MALE or F = FEMALE
address string Address
  • Front side of HCO card info:
Fields Type Description
hc_id_number string ID Number of Health Card
name string Name

Response Syntax
  • Front side of ID card
{
    "request_id": "TID1c6ab309f6404ac2bf5271b9b14498be",
    "results": [
        {
            "card_info": {
                "address": "xxxxx - 2, xxxxx9, CITY OF CABADBARAN, AGUSAN xxxxx",
                "birthday": "May 17 2001",
                "birthday_s": "17-05-2001",
                "give_name": "xxxxx",
                "id_number": "61501675813xxxxx",
                "last_name": "PELARxxx",
                "middle_name": "ANxxx"
            },
            "card_side": "front",
            "card_type": "ID"
        }
    ],
    "status": "OK"
}
  • Front side of UMID card
{
  "request_id": "TID08a176176f0e427d8ee5563625352c1c",
  "results": [
    {
      "card_info": {
        "id_number": "00334773****",
        "address": "UNIT xxx BLDG x URBAN DECA HOMES HAMPTON *****",
        "birthday": "1980-02-26",
        "birthday_s": "26-02-1980",
        "gender": "MALE",
        "gender_s": "M",
        "give_name": "JEFF****",
        "middle_name": "SIST***",
        "surname": "VILLANU***"
      },
      "card_side": "front",
      "card_type": "UMID"
    }
  ],
  "status": "OK"
}
  • Front side of PASSPORT card
{
  "request_id": "TID4f0b399589044abfaa7d1d28f056ddf0",
  "results": [
    {
      "card_info": {
        "passport_number": "P0000*****",
        "passport_type": "P",
        "surname": "DELAC***",
        "give_name": "MARIA",
        "middle_name": "SAN***",
        "gender": "F",
        "gender_s": "F",
        "birthday": "16-MAR-1980",
        "birthday_s": "16-03-1980",
        "birth_place": "MANILA",
        "country_code": "PHL",
        "expiry_date": "26 JUN 2021",
        "expiry_date_s": "26-06-2021",
        "issue_authority": "DFAMANILA",
        "issue_date": "27 JUN 2016",
        "issue_date_s": "27-06-2016",
        "line_one": "P<PHLDELA<CRUZ<<MARIA<<<<<<<<<<<<<<<<<<<<<<<",
        "line_two": "P0000000A0PHL8003166F*******<<<<<<<<<<<<<<02",
        "nationality": "FILIPINO"
      },
      "card_side": "front",
      "card_type": "PASSPORT"
    }
  ],
  "status": "OK"
}
  • Front side of DL card
{
  "request_id": "TIDc00986338c1047cfb32042bf62df973b",
  "results": [
    {
      "card_info": {
        "dl_license_number": "GC1-90-189***",
        "dl_code": "1.2",
        "name": "PAREDES MA AVE ******",
        "address": "****** DE ABRIL ST CEBU CITY CEBU ** **",
        "agency_code": "G01",
        "birthday": "1969-11-03",
        "birthday_s": "03-11-1969",
        "blood_type": "",
        "gender": "F",
        "gender_s": "F",
        "eyes_color": "BLACK",
        "weight": "57",
        "height": "1.60",
        "conditions": "NONE",
        "expiry_date": "2028-11-03",
        "expiry_date_s": "03-11-2028",
        "nationality": "PHL"
      },
      "card_side": "front",
      "card_type": "DL"
    }
  ],
  "status": "OK"
}
  • Front side of SSS card
{
  "request_id": "TID8153ef1ee744478297e32e15cd7c4dfc",
  "results": [
    {
      "card_info": {
        "birthday": "October 24 1973",
        "birthday_s": "24-10-1973",
        "name": "DENNIS *** ****",
        "sss_id_number": "3318230XXX"
      },
      "card_side": "front",
      "card_type": "SSS"
    }
  ],
  "status": "OK"
}
  • Front side of TI card
{
  "request_id": "TID981c5f692d584b59b0ae91dcd4efc330",
  "results": [
    {
      "card_info": {
        "address": "XXX ***** AREA C PAYATAS QUEZON CITY",
        "birthday": "09 05 2000",
        "birthday_s": "05-09-2000",
        "issue_date": "01 07 2021",
        "issue_date_s": "07-01-2021",
        "name": "MARILYN *****",
        "tax_id_number": "38406790XXXX"
      },
      "card_side": "front",
      "card_type": "TI"
    }
  ],
  "status": "OK"
}
  • Front side of VOTER card
{
    "request_id": "TIDbbdaf49b97d04a5eb18ae189776ff16e",
    "results": [
        {
            "card_info": {
                "address": "XXXXX I, SAN ANTONIO ALANGALANG",
                "birthday": "January 10 1994",
                "birthday_s": "10-01-1994",
                "citizenship": "FLLIPINO",
                "civil_status": "SINGLE",
                "name": "XXXXX KIMBERLY XXX XXXX",
                "precinct_no": "0025A",
                "voter_id_number": "64150025AA10XXXXXXXXXX"
            },
            "card_side": "front",
            "card_type": "VOTER"
        }
    ],
    "status": "OK"
}
  • Front side of HC card
{
    "request_id": "TIDafd41178b82449e1ad828951405020c0",
    "results": [
        {
            "card_info": {
                "address": "HILAMONAN KABANKALAN, NEGROS *******",
                "birthday": "April 22 1998",
                "birthday_s": "22-04-1998",
                "gender": "FEMALE",
                "gender_s": "F",
                "hc_id_number": "110256******",
                "name": "CLAUD, KAREN *****"
            },
            "card_side": "front",
            "card_type": "HC"
        }
    ],
    "status": "OK"
}
  • Front side of HCO card
{
    "request_id": "TIDafd41178b82449e1ad828951405020c0",
    "results": [
        {
            "card_info": {
                "hc_id_number": "110256******",
                "name": "CLAUD, KAREN *****"
            },
            "card_side": "front",
            "card_type": "HCO"
        }
    ],
    "status": "OK"
}

4.Error Codes

Common error codes of this API:

Http Status Code Status field Description
400 INVALID_ARGUMENT Request parameter is invalid
400 DETECTION_FAILED Detect image failed
401 UNAUTHORIZED Unauthorized or access is denied
401 KEY_EXPIRED Your API ID has expired
403 NO_PERMISSION You are not authorized to use this API
403 OUT_OF_QUOTA API calls quota exceeded
403 RATE_LIMIT_EXCEEDED API request frequency exceeds the limit
404 NOT_FOUND Requested API cannot be found
500 INTERNAL_ERROR Internal server error

Comment: Please see the reason field for details when the above 40X error occurred

Response Syntax
{
  "status": "INVALID_ARGUMENT",
  "reason": "must specify 'file' or 'image_base64' argument",
  "request_id": "TID8bf47ab6eda64476973cc5f5b6ebf57e"
}

5.Sample

results matching ""

    No results matching ""