Kartu Keluarga (KK)
KK is an identity card for a family issued in Indonesia.
KK 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
read
- Type
- object
- Description
Contains the reading for each KK fields. Each fields has
confidence
(in percentage) andvalue
(the reading).- Name
alamat
- Type
- object
- Description
Address.
- Name
desa_kelurahan
- Type
- object
- Description
District.
- Name
kabupaten_kota
- Type
- object
- Description
City.
- Name
kecamatan
- Type
- object
- Description
Prefecture.
- Name
kode_pos
- Type
- object
- Description
Postal code.
- Name
nama_kepala_keluarga
- Type
- object
- Description
Head of family.
- Name
nomor_blanko
- Type
- object
- Description
Form number.
- Name
nomor_kk
- Type
- object
- Description
KK number.
- Name
provinsi
- Type
- object
- Description
Province.
- Name
rt_rw
- Type
- object
- Description
Neighborhood number.
- Name
tanggal_dikeluarkan
- Type
- object
- Description
Date issued.
- Name
table
- Type
- array of object
- Description
Information for Each person in the family. Each fields has
confidence
(in percentage) andvalue
(the reading).- Name
agama
- Type
- object
- Description
Religion.
- Name
golongan_darah
- Type
- object
- Description
Blood type.
- Name
jenis_kelamin
- Type
- object
- Description
Sex.
- Name
jenis_pekerjaan
- Type
- object
- Description
Job.
- Name
kewarganegaraan
- Type
- object
- Description
Nationality.
- Name
nama_ayah
- Type
- object
- Description
Father's name.
- Name
nama_ibu
- Type
- object
- Description
Mother's name.
- Name
nama_lengkap
- Type
- object
- Description
Full name.
- Name
nik
- Type
- object
- Description
KTP number.
- Name
no
- Type
- object
- Description
Number.
- Name
no_kitas_kitap
- Type
- object
- Description
Temporary/permanent residence number.
- Name
no_paspor
- Type
- object
- Description
Passport number.
- Name
pendidikan
- Type
- object
- Description
Latest education.
- Name
status_hubungan_dalam_keluarga
- Type
- object
- Description
Status in the family.
- Name
status_perkawinan
- Type
- object
- Description
Marital status.
- Name
tanggal_lahir
- Type
- object
- Description
Date of birth.
- Name
tanggal_perkawinan
- Type
- object
- Description
Date of marriage.
- Name
tempat_lahir
- Type
- object
- Description
Place of birth.
Read KK
Detects a valid KK image and returns the information as text.
Required parameter
- Name
image
- Type
- file (.png, .jpg, .jpeg, .pdf, .tiff)
- Description
The image file for the KK.
Sample Request
1
2
3
4
5
import { Vision } from '@glair/vision';
const vision = new Vision({ apiKey: 'api-key', username: 'username', password: 'password' });
await vision.ocr.kk({ image: '/path/to/image/KK.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
{
"read": {
"alamat": {
"confidence": 97,
"value": "JL NANGKA NO 10"
},
"desa_kelurahan": {
"confidence": 99,
"value": "PADURENAN"
},
"kabupaten_kota": {
"confidence": 98,
"value": "KOTA BEKASI"
},
"kecamatan": {
"confidence": 97,
"value": "MUSTIKA JAYA"
},
"kode_pos": {
"confidence": 99,
"value": "17156"
},
"nama_kepala_keluarga": {
"confidence": 93,
"value": "MUKLIS"
},
"nomor_blanko": {
"confidence": 0,
"value": ""
},
"nomor_kk": {
"confidence": 99,
"value": "3123456789012345"
},
"provinsi": {
"confidence": 99,
"value": "JAWA BARAT"
},
"rt_rw": {
"confidence": 92,
"value": "001/001"
},
"table": [
{
"agama": {
"confidence": 98,
"value": "ISLAM"
},
"golongan_darah": {
"confidence": 0,
"value": "-"
},
"jenis_kelamin": {
"confidence": 98,
"value": "LAKI-LAKI"
},
"jenis_pekerjaan": {
"confidence": 98,
"value": "KARYAWAN SWASTA"
},
"kewarganegaraan": {
"confidence": 98,
"value": "WNI"
},
"nama_ayah": {
"confidence": 98,
"value": "SUPARMAN"
},
"nama_ibu": {
"confidence": 98,
"value": "DEWI"
},
"nama_lengkap": {
"confidence": 98,
"value": "MUKLIS"
},
"nik": {
"confidence": 98,
"value": "3123456789012346"
},
"no": {
"confidence": 98,
"value": "1"
},
"no_kitas_kitap": {
"confidence": 0,
"value": "-"
},
"no_paspor": {
"confidence": 0,
"value": "-"
},
"pendidikan": {
"confidence": 98,
"value": "SLTA/SEDERAJAT"
},
"status_hubungan_dalam_keluarga": {
"confidence": 98,
"value": "KEPALA KELUARGA"
},
"status_perkawinan": {
"confidence": 98,
"value": "KAWIN"
},
"tanggal_lahir": {
"confidence": 98,
"value": "06-01-1960"
},
"tanggal_perkawinan": {
"confidence": 0,
"value": "-"
},
"tempat_lahir": {
"confidence": 98,
"value": "JAKARTA"
}
},
{
"agama": {
"confidence": 98,
"value": "ISLAM"
},
"golongan_darah": {
"confidence": 0,
"value": "-"
},
"jenis_kelamin": {
"confidence": 98,
"value": "PEREMPUAN"
},
"jenis_pekerjaan": {
"confidence": 98,
"value": "MENGURUS RUMAH TANGGA"
},
"kewarganegaraan": {
"confidence": 98,
"value": "WNI"
},
"nama_ayah": {
"confidence": 98,
"value": "ARMAN"
},
"nama_ibu": {
"confidence": 98,
"value": "MARYAM"
},
"nama_lengkap": {
"confidence": 98,
"value": "SARI"
},
"nik": {
"confidence": 98,
"value": "3123456789012347"
},
"no": {
"confidence": 98,
"value": "2"
},
"no_kitas_kitap": {
"confidence": 0,
"value": "-"
},
"no_paspor": {
"confidence": 0,
"value": "-"
},
"pendidikan": {
"confidence": 98,
"value": "BELUM TAMAT SD/SEDERAJAT"
},
"status_hubungan_dalam_keluarga": {
"confidence": 98,
"value": "ANAK"
},
"status_perkawinan": {
"confidence": 98,
"value": "KAWIN"
},
"tanggal_lahir": {
"confidence": 98,
"value": "54"
},
"tanggal_perkawinan": {
"confidence": 0,
"value": "-"
},
"tempat_lahir": {
"confidence": 98,
"value": "JAKARTA"
}
},
{
"agama": {
"confidence": 98,
"value": "ISLAM"
},
"golongan_darah": {
"confidence": 0,
"value": "-"
},
"jenis_kelamin": {
"confidence": 98,
"value": "PEREMPUAN"
},
"jenis_pekerjaan": {
"confidence": 98,
"value": "PELAJAR/MAHASISWA"
},
"kewarganegaraan": {
"confidence": 98,
"value": "WNI"
},
"nama_ayah": {
"confidence": 98,
"value": "MUKLIS"
},
"nama_ibu": {
"confidence": 98,
"value": "SARI"
},
"nama_lengkap": {
"confidence": 98,
"value": "FIRDA"
},
"nik": {
"confidence": 98,
"value": "3123456789012349"
},
"no": {
"confidence": 98,
"value": "3"
},
"no_kitas_kitap": {
"confidence": 0,
"value": "-"
},
"no_paspor": {
"confidence": 0,
"value": "-"
},
"pendidikan": {
"confidence": 98,
"value": "TIDAK/BLM SEKOLAH"
},
"status_hubungan_dalam_keluarga": {
"confidence": 98,
"value": "ANAK"
},
"status_perkawinan": {
"confidence": 98,
"value": "BELUM KAWIN"
},
"tanggal_lahir": {
"confidence": 98,
"value": "04-07-1994"
},
"tanggal_perkawinan": {
"confidence": 0,
"value": "-"
},
"tempat_lahir": {
"confidence": 98,
"value": "BEKASI"
}
},
{
"agama": {
"confidence": 98,
"value": "ISLAM"
},
"golongan_darah": {
"confidence": 0,
"value": "-"
},
"jenis_kelamin": {
"confidence": 98,
"value": "LAKI-LAKI"
},
"jenis_pekerjaan": {
"confidence": 98,
"value": "BELUM/TDAK BEKERJA"
},
"kewarganegaraan": {
"confidence": 98,
"value": "WNI"
},
"nama_ayah": {
"confidence": 98,
"value": "MUKLIS"
},
"nama_ibu": {
"confidence": 98,
"value": "SARI"
},
"nama_lengkap": {
"confidence": 98,
"value": "PUTRA"
},
"nik": {
"confidence": 98,
"value": "3123456789012348"
},
"no": {
"confidence": 98,
"value": "4"
},
"no_kitas_kitap": {
"confidence": 0,
"value": "-"
},
"no_paspor": {
"confidence": 0,
"value": "-"
},
"pendidikan": {
"confidence": 98,
"value": "SLTA/SEDERAJAT"
},
"status_hubungan_dalam_keluarga": {
"confidence": 98,
"value": "ANAK"
},
"status_perkawinan": {
"confidence": 98,
"value": "BELUM KAWIN"
},
"tanggal_lahir": {
"confidence": 0,
"value": "-"
},
"tanggal_perkawinan": {
"confidence": 0,
"value": "-"
},
"tempat_lahir": {
"confidence": 98,
"value": "MEKARI"
}
},
{
"agama": {
"confidence": 98,
"value": "ISLAM"
},
"golongan_darah": {
"confidence": 0,
"value": "-"
},
"jenis_kelamin": {
"confidence": 98,
"value": "LAKI-LAKI"
},
"jenis_pekerjaan": {
"confidence": 98,
"value": "BURUH HARIAN LEPAS"
},
"kewarganegaraan": {
"confidence": 0,
"value": "-"
},
"nama_ayah": {
"confidence": 0,
"value": "-"
},
"nama_ibu": {
"confidence": 0,
"value": "-"
},
"nama_lengkap": {
"confidence": 98,
"value": "DIMAS"
},
"nik": {
"confidence": 98,
"value": "3123456789012350"
},
"no": {
"confidence": 98,
"value": "5"
},
"no_kitas_kitap": {
"confidence": 0,
"value": "-"
},
"no_paspor": {
"confidence": 0,
"value": "-"
},
"pendidikan": {
"confidence": 98,
"value": "STRATA II"
},
"status_hubungan_dalam_keluarga": {
"confidence": 98,
"value": "SUAMI"
},
"status_perkawinan": {
"confidence": 98,
"value": "BELUM KAWIN"
},
"tanggal_lahir": {
"confidence": 0,
"value": "-"
},
"tanggal_perkawinan": {
"confidence": 0,
"value": "-"
},
"tempat_lahir": {
"confidence": 98,
"value": "JAKARTA"
}
}
],
"tanggal_dikeluarkan": {
"confidence": 99,
"value": "06-05-2014"
}
},
"reason": "File successfully read.",
"status": "SUCCESS"
}
Read KK With Query Parameter
Optional query parameter
You can use the following queries in url.
- Name
withPolygon
- Type
- true|false, default: false
- Description
For displaying
polygon
coordinate of the field in response JSON.
- Name
withRawText
- Type
- true|false, default: false
- Description
For displaying raw text of the field in response JSON.
- Name
withConfidenceField
- Type
- true|false, default: false
- Description
For displaying confidence field value in response JSON.
Sample Request
1
2
3
4
curl -v -L -X POST 'https://api.vision.glair.ai/ocr/v1/kk?withPolygon=true&withRawText=true&withConfidenceField=true' \
-H "Authorization: Basic $(printf "%s" "USERNAME:PASSWORD" | base64)" \
-H 'x-api-key: API_KEY' \
-F 'image=@"/path/to/image/KK.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
54
55
56
57
58
59
60
{
"read": {
"alamat": {
"confidence": 95,
"confidence_field": 88,
"polygon": [
[
272.0,
137.0
],
[
365.0,
137.0
],
[
365.0,
153.0
],
[
272.0,
153.0
]
],
"raw_text": "GARUNG LOR",
"value": "GARUNG LOR"
},
...
"table": [
{
"agama": {
"confidence": 98,
"confidence_field": 88,
"polygon": [
[
272.0,
137.0
],
[
365.0,
137.0
],
[
365.0,
153.0
],
[
272.0,
153.0
]
],
"raw_text": "ISLAM",
"value": "ISLAM"
},
...
},
]
},
"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 KK image
Response
1
2
3
4
5
{
"status": "SUCCESS",
"reason": "File Successfully Read",
//...,
}
200 - OK
Request with non KK image
Response
1
2
3
4
5
{
"status": "SUCCESS",
"reason": "File successfully read. Some fields are invalid.",
//...,
}
400 - Bad Request
Request without form-data image
Response
1
2
3
4
5
{
"status": "NO_FILE",
"reason": "No file in request body",
//...,
}
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",
//...,
}