Background supergraphic

Surat Izin Mengemudi (SIM)

SIM is a driver license issued in Indonesia.

SIM 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 for each SIM fields. Each field contains:

    • confidence (number): Overall confidence score in percentage
    • value (string): The processed/extracted value
    • value_original (string): The original text as read from the document
    • confidence_text (number): Text recognition confidence in percentage
    • polygon (array): Array of coordinate pairs [x, y] representing the bounding box of the field
    • page_index (number): Page number where the field was found (0-indexed)
    • Name
      alamat
      Type
      object
      Description

      Address.

    • Name
      berlaku
      Type
      object
      Description

      Expiration date.

    • Name
      foto
      Type
      object
      Description

      Face image in base64 format.

    • Name
      golongan_darah
      Type
      object
      Description

      Blood type.

    • Name
      jenis_kelamin
      Type
      object
      Description

      Sex.

    • Name
      nama
      Type
      object
      Description

      Name.

    • Name
      nomor_sim
      Type
      object
      Description

      SIM number.

    • Name
      pekerjaan
      Type
      object
      Description

      Job.

    • Name
      tanda_tangan
      Type
      object
      Description

      Signature image in base64 format.

    • Name
      tanggal_lahir
      Type
      object
      Description

      Date of birth.

    • Name
      tempat_lahir
      Type
      object
      Description

      Place of birth.

    • Name
      tinggi
      Type
      object
      Description

      Owner's height.

    • Name
      tipe_sim
      Type
      object
      Description

      SIM type.

    • Name
      wilayah
      Type
      object
      Description

      Region.


POST/ocr/v1/sim

Read SIM

Detects a valid SIM image and returns the information as text.

Required parameter

  • Name
    image
    Type
    file (.png, .jpg, .jpeg)
    Description

    The image file for the SIM.

Sample Request

POST
/ocr/v1/sim
1
2
3
4
curl -v -L -X POST 'https://api.vision.glair.ai/ocr/v1/sim' \ -H "Authorization: Basic $(printf "%s" "USERNAME:PASSWORD" | base64)" \ -H 'x-api-key: API_KEY' \ -F 'image=@"/path/to/image/SIM.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
{ "read": { "tipe_sim": { "confidence": 99.01, "value": "A", "page_index": 0 }, "nomor_sim": { "confidence": 98.31, "value": "7596-5759-903990", "page_index": 0 }, "nama": { "confidence": 93.77, "value": "JOYCE MORTON", "page_index": 0 }, "foto": { "confidence": 99.13, "value": "iVBORw0KGgoAAAANSUhEUgAAAMAAAAEXCAIAAAB08txzAAEAA...", "page_index": 0 }, "golongan_darah": { "confidence": 99.16, "value": "B", "page_index": 0 }, "jenis_kelamin": { "confidence": 99.26, "value": "WANITA", "page_index": 0 }, "tempat_lahir": { "confidence": 98, "value": "JAKARTA", "page_index": 0 }, "tanggal_lahir": { "confidence": 91.79, "value": "04-09-1994", "page_index": 0 }, "alamat": { "confidence": 89.47, "value": "KAROSSA RT.010 RW.009 KAB. MAMUJU TENGAH", "page_index": 0 }, "pekerjaan": { "confidence": 96.01, "value": "PETANI", "page_index": 0 }, "tanda_tangan": { "confidence": 97.3, "value": "iVBORw0KGgoAAAANSUhEUgAAAGMAAABkCAIAAAAdXBl6AAA8PEl...", "page_index": 0 }, "wilayah": { "confidence": 93.11, "value": "SULAWESI", "page_index": 0 }, "berlaku": { "confidence": 97.06, "value": "05-02-2022", "page_index": 0 }, "tinggi": { "confidence": 0, "value": "", "page_index": 0 } }, "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 SIM 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.", //..., }