Singapore NRIC
Singapore NRIC is the legal identity document for all Singapore permanent residents and citizens.
Singapore NRIC Object
- Name
status
- Type
- string
- Description
Enum code indicating the status of the reading result.
SUCCESS
NO_FILE
FILE_INVALID_FORMAT
FAILED
- Name
reason
- Type
- string
- Description
A human-readable message providing more details about the reading result.
- Name
images
- Type
- object
- Description
Contains the cropped image (in
base64
format) of face in document.- Name
photo
- Type
- string
- Description
Face in
base64
format.
- Name
read
- Type
- object
- Description
Contains the reading for each Singapore NRIC fields. Each fields has
confidence
(in percentage) andvalue
(the reading).- Name
address
- Type
- object
- Description
Address.
- Name
blood_type
- Type
- object
- Description
Blood type.
- Name
card_number
- Type
- object
- Description
Card number.
- Name
country_of_birth
- Type
- object
- Description
Country of birth.
- Name
date_of_birth
- Type
- object
- Description
Date of birth.
- Name
issue_date
- Type
- object
- Description
Document issue date.
- Name
name
- Type
- object
- Description
Name.
- Name
nationality
- Type
- object
- Description
Nationality.
- Name
nric_no
- Type
- object
- Description
NRIC number.
- Name
race
- Type
- object
- Description
Race.
- Name
sex
- Type
- object
- Description
Sex.
Read Singapore NRIC
Detects a valid Singapore NRIC image and returns the information as text.
Required parameter
- Name
image
- Type
- file (.png, .jpg, .jpeg)
- Description
The image file for the Singapore NRIC.
Sample Request
1
2
3
4
5
import ApiClient from '@glair/vision';
const vision = new Vision({ apiKey: 'api-key', username: 'username', password: 'password' });
await vision.ocr.singaporeNRIC({ image: '/path/to/image/NRIC.jpg' });
Sample Response
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
{
"images": {
"photo": "iVBOR..."
},
"read": {
"address": {
"confidence": 0,
"value": ""
},
"blood_type": {
"confidence": 0,
"value": ""
},
"card_number": {
"confidence": 0,
"value": ""
},
"country_of_birth": {
"confidence": 99,
"value": "SINGAPORE"
},
"date_of_birth": {
"confidence": 99,
"value": "01-06-1968"
},
"issue_date": {
"confidence": 0,
"value": ""
},
"name": {
"confidence": 97,
"value": "SUGUNA D/O RAJOO DORAISAMY"
},
"nationality": {
"confidence": 0,
"value": ""
},
"nric_no": {
"confidence": 99,
"value": "S0000007G"
},
"race": {
"confidence": 99,
"value": "INDIAN"
},
"sex": {
"confidence": 99,
"value": "F"
}
},
"reason": "File successfully read.",
"status": "SUCCESS"
}
Request ID
An associated request identifier is generated for every request made to this endpoint.
This value can be found in the response headers under Request-Id
Responses
Various responses for this endpoint, in addition to general responses specified in Errors.
200 - OK
Request with readable Singapore NRIC image
Response
1
2
3
4
5
{
"status": "SUCCESS",
"reason": "File successfully read.",
//...,
}
400 - Bad Request
Request without form-data image
Response
1
2
3
4
5
{
"status": "NO_FILE",
"reason": "No file in request body. Some fields are invalid.",
//...,
}
415 - Unsupported Media Type
Request with non-image file format
Response
1
2
3
4
5
{
"status": "FILE_INVALID_FORMAT",
"reason": "Failed to process invalid file format. Please upload the correct file format. Some fields are invalid.",
//...,
}