Surat Tanda Nomor Kendaraan (STNK)
Surat Tanda Nomor Kendaraan (STNK).
STNK 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 STNK fields.
- Name
alamat
- Type
- string
- Description
Address.
- Name
bahan_bakar
- Type
- string
- Description
Fuel type.
- Name
berlaku_sampai
- Type
- string
- Description
Expiration date.
- Name
isi_sillinder
- Type
- string
- Description
Cylinder content.
- Name
jenis
- Type
- string
- Description
Type.
- Name
kode_lokasi
- Type
- string
- Description
Location code.
- Name
merk
- Type
- string
- Description
Brand name.
- Name
model
- Type
- string
- Description
Model.
- Name
nama_pemilik
- Type
- string
- Description
Owner's name.
- Name
nomor_bpkb
- Type
- string
- Description
Number of BPKB.
- Name
nomor_mesin
- Type
- string
- Description
Machine number.
- Name
nomor_registrasi
- Type
- string
- Description
Registration number.
- Name
nomor_stnk
- Type
- string
- Description
STNK number.
- Name
nomor_urut_pendaftaran
- Type
- string
- Description
Registration serial number.
- Name
tahun_pembuatan
- Type
- string
- Description
Manufacture year.
- Name
tahun_registrasi
- Type
- string
- Description
Registration year.
- Name
tipe
- Type
- string
- Description
Type.
- Name
warna
- Type
- string
- Description
Color.
- Name
warna_tnkb
- Type
- string
- Description
TNKB (Tanda Nomor Kendaraan Bermotor) number.
Read STNK
Detects a valid STNK image and returns the information as text.
Required parameter
- Name
image
- Type
- file (.png, .jpg, .jpeg)
- Description
The image file for the STNK.
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.stnk({ image: '/path/to/image/STNK.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
{
"status": "SUCCESS",
"reason": "File Successfully Read",
"read": {
"alamat": "PERUM ASRI JATIBARANG",
"bahan_bakar": "BENSIN",
"berlaku_sampai": "25-01-2021",
"isi_sillinder": "1495 CC",
"jenis": "MOBIL PENUMPANG",
"kode_lokasi": "04 (UPT CIKOKOL)",
"merk": "TOYOTA",
"model": "MINIBUS",
"nama_pemilik": "KIBO PUTRA",
"nomor_bpkb": "",
"nomor_mesin": "DDN6723",
"nomor_rangka": "MHKM1CB3KDKO19389",
"nomor_registrasi": "B-1124-KMS",
"nomor_stnk": "18213497",
"nomor_urut_pendaftaran": "",
"tahun_pembuatan": "2013",
"tahun_registrasi": "",
"tipe": "NEW AVANZA VELOZ 1.5",
"warna": "HITAM METALIK",
"warna_tnkb": "HITAM"
}
}
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 STNK image
Response
1
2
3
4
5
{
"status": "SUCCESS",
"reason": "File Successfully Read",
//...,
}
200 - OK
Request with non STNK 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",
//...,
}