Background supergraphic

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.

    1. SUCCESS
    2. NO_FILE
    3. FILE_INVALID_FORMAT
    4. 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 of halaman_pajak_tahunan and halaman_stnk.

  • Name
    halaman_pajak_tahunan
    Type
    object
    Description

    Contains the reading for each halaman_pajak_tahunan fields

    • Name
      alamat
      Type
      string
      Description

      Address.

    • Name
      bahan_bakar
      Type
      string
      Description

      Fuel type.

    • Name
      berlaku_sampai
      Type
      string
      Description

      Expiration date.

    • Name
      ditetapkan_tanggal
      Type
      string
      Description

      Approval date.

    • Name
      ident
      Type
      string
      Description

      Ident.

    • Name
      isi_silinder
      Type
      string
      Description

      Cylinder content.

    • Name
      jenis
      Type
      string
      Description

      Type.

    • Name
      jumlah_sumbu
      Type
      string
      Description

      Number of axes.

    • Name
      kepemilikan_ke
      Type
      string
      Description

      Possession number.

    • Name
      kode_njkb
      Type
      string
      Description

      NJKB 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_identitas_pemilik
      Type
      string
      Description

      Owner's ID number.

    • Name
      nomor_mesin
      Type
      string
      Description

      Machine number.

    • Name
      nomor_pajak_tahunan
      Type
      string
      Description

      Annual tax number.

    • Name
      nomor_rangka
      Type
      string
      Description

      Chassis number.

    • Name
      nomor_registrasi
      Type
      string
      Description

      Registration number.

    • Name
      nomor_registrasi_lama
      Type
      string
      Description

      Old registration number.

    • Name
      samsat_provinsi
      Type
      string
      Description

      Provincial Samsat.

    • 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.

  • Name
    halaman_stnk
    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_silinder
      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_identitas_pemilik
      Type
      string
      Description

      Owner's ID number.

    • Name
      nomor_mesin
      Type
      string
      Description

      Machine number.

    • Name
      nomor_rangka
      Type
      string
      Description

      Chassis 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
      polda_penerbitan
      Type
      string
      Description

      Provincial police publisher.

    • Name
      tahun_pembuatan
      Type
      string
      Description

      Manufacture year.

    • Name
      tahun_registrasi
      Type
      string
      Description

      Registration year.

    • Name
      tanggal_penerbitan
      Type
      string
      Description

      Publishing date.

    • Name
      tempat_penerbitan
      Type
      string
      Description

      Publishing place.

    • Name
      tipe
      Type
      string
      Description

      Type.

    • Name
      warna
      Type
      string
      Description

      Color.

    • Name
      warna_tnkb
      Type
      string
      Description

      TNKB (Tanda Nomor Kendaraan Bermotor) number.


POST/ocr/v1/stnk

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

POST
/ocr/v1/stnk
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
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
{ "status": "SUCCESS", "reason": "File Successfully Read", "read": { "halaman_pajak_tahunan": { "alamat": { "confidence": 92, "value": "DESA MULI RT/RW. 010/005 KEL. RAJA REC. BARAJA LAMPUNG SELATAN" }, "bahan_bakar": { "confidence": 99, "value": "BENSIN" }, "berlaku_sampai": { "confidence": 88, "value": "22-12-2021" }, "ditetapkan_tanggal": { "confidence": 91, "value": "22-12-2021" }, "ident": { "confidence": 0, "value": "" }, "isi_silinder": { "confidence": 96, "value": "110.55 CC" }, "jenis": { "confidence": 96, "value": "SEPEDA MOTOR" }, "jumlah_sumbu": { "confidence": 0, "value": "" }, "kepemilikan_ke": { "confidence": 0, "value": "" }, "kode_njkb": { "confidence": 0, "value": "" }, "merk": { "confidence": 99, "value": "HONDA" }, "model": { "confidence": 0, "value": "" }, "nama_pemilik": { "confidence": 93, "value": "YANTI" }, "nomor_bpkb": { "confidence": 99, "value": "B00884808" }, "nomor_identitas_pemilik": { "confidence": 0, "value": "" }, "nomor_mesin": { "confidence": 97, "value": "JM02F1098541" }, "nomor_pajak_tahunan": { "confidence": 94, "value": "AI 01238765" }, "nomor_rangka": { "confidence": 90, "value": "MH1M0210MK098765" }, "nomor_registrasi": { "confidence": 95, "value": "BE 5421 DA" }, "nomor_registrasi_lama": { "confidence": 0, "value": "" }, "samsat_provinsi": { "confidence": 92, "value": "LAMPUNG" }, "tahun_pembuatan": { "confidence": 99, "value": "2021" }, "tahun_registrasi": { "confidence": 0, "value": "" }, "tipe": { "confidence": 87, "value": "F2C12N56L0 A/T" }, "warna": { "confidence": 96, "value": "PUTIH" }, "warna_tnkb": { "confidence": 99, "value": "HITAM" } }, "halaman_stnk": { "alamat": { "confidence": 91, "value": "DESA MULI RT/RW. 010/005 KEL. RAJA REC. BARAJA LAMPUNG SELATAN" }, "bahan_bakar": { "confidence": 92, "value": "BENSIN" }, "berlaku_sampai": { "confidence": 68, "value": "12-12-2026" }, "isi_silinder": { "confidence": 99, "value": "110,55" }, "jenis": { "confidence": 99, "value": "SEPEDA MOTOR" }, "kode_lokasi": { "confidence": 69, "value": "03" }, "merk": { "confidence": 93, "value": "HONDA" }, "model": { "confidence": 94, "value": "SPD. MTR 5OLO" }, "nama_pemilik": { "confidence": 99, "value": "YANTI" }, "nomor_bpkb": { "confidence": 87, "value": "B00884808" }, "nomor_identitas_pemilik": { "confidence": 0, "value": "" }, "nomor_mesin": { "confidence": 91, "value": "JM02F1098541" }, "nomor_rangka": { "confidence": 86, "value": "MH1M0210MK098765" }, "nomor_registrasi": { "confidence": 92, "value": "BE 5421 DA" }, "nomor_stnk": { "confidence": 99, "value": "07361045" }, "nomor_urut_pendaftaran": { "confidence": 80, "value": "1212.1221/A/2202202" }, "polda_penerbitan": { "confidence": 56, "value": "SN" }, "tahun_pembuatan": { "confidence": 99, "value": "2021" }, "tahun_registrasi": { "confidence": 99, "value": "2021" }, "tanggal_penerbitan": { "confidence": 0, "value": "" }, "tempat_penerbitan": { "confidence": 0, "value": "" }, "tipe": { "confidence": 88, "value": "F2C12N56L0 A/T" }, "warna": { "confidence": 99, "value": "PUTIH" }, "warna_tnkb": { "confidence": 94, "value": "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", //..., }