openapi: 3.0.0
info:
  title: Api Ocr Sim
  description: >-
    Complete API collection for Indonesian SIM (driver's license) data extraction. Extract SIM data from image files
    (JPG, JPEG, PNG) with automatic field extraction and validation. Maximum file size: 5 MB.
    Supports both modern full SIM and simple 6-line SIM formats.
  version: 1.0.0
servers:
  - url: https://use.api.co.id
tags:
  - name: SIM Extraction
    description: >-
      SIM extraction endpoints for processing Indonesian driver's license (SIM)
      images.
paths:
  /ocr/sim-extract:
    post:
      tags:
        - SIM Extraction
      summary: Extract SIM from Image
      description: >-
        Extract structured SIM data from an uploaded image file. Maximum file size: 5 MB.
        Supported formats: JPG, JPEG, PNG. Supports both modern full SIM and simple 6-line SIM formats.
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - file
              properties:
                file:
                  type: string
                  format: binary
                  description: 'SIM image file. Maximum size: 5 MB. Supported formats: JPG, JPEG, PNG'
      parameters:
        - name: x-api-co-id
          in: header
          schema:
            type: string
          description: Your API key for authentication
          example: '{{api_key}}'
      responses:
        '200':
          description: Success - SIM Extracted
          content:
            application/json:
              schema:
                type: object
                properties:
                  is_success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: Success
                  data:
                    type: object
                    properties:
                      nomor_sim:
                        type: string
                        description: SIM number
                        example: '1234567890123456'
                      nama:
                        type: string
                        description: Full name
                        example: 'JOHN DOE'
                      tempat_lahir:
                        type: string
                        description: Birth place
                        example: 'JAKARTA'
                      tanggal_lahir:
                        type: string
                        description: Birth date (DD-MM-YYYY)
                        example: '01-01-1990'
                      jenis_kelamin:
                        type: string
                        description: Gender (LAKI-LAKI/PEREMPUAN)
                        example: 'LAKI-LAKI'
                      golongan_darah:
                        type: string
                        description: Blood type
                        example: 'O'
                      alamat:
                        type: string
                        description: Address
                        example: 'JL. MERDEKA NO. 123'
                      rt:
                        type: string
                        description: RT (neighborhood unit)
                        example: '001'
                      rw:
                        type: string
                        description: RW (community unit)
                        example: '002'
                      kelurahan:
                        type: string
                        description: Village/Kelurahan
                        example: 'GAMBIR'
                      kecamatan:
                        type: string
                        description: Subdistrict/Kecamatan
                        example: 'GAMBIR'
                      kota:
                        type: string
                        description: City
                        example: 'JAKARTA PUSAT'
                      provinsi:
                        type: string
                        description: Province
                        example: 'DKI JAKARTA'
                      tinggi_badan:
                        type: string
                        description: Height in centimeters
                        example: '170'
                      jenis_sim:
                        type: string
                        description: SIM type (A, C, B1, B2, etc.)
                        example: 'A'
                      pekerjaan:
                        type: string
                        description: Occupation
                        example: 'KARYAWAN SWASTA'
                      tempat_pembuatan:
                        type: string
                        description: Place of issue
                        example: 'POLRES JAKARTA PUSAT'
                      tanggal_terbit:
                        type: string
                        description: Issue date (DD-MM-YYYY)
                        example: '01-01-2020'
                      tanggal_berlaku:
                        type: string
                        description: Expiry date (DD-MM-YYYY)
                        example: '01-01-2025'
              examples:
                success:
                  summary: Success - SIM Extracted
                  value:
                    is_success: true
                    message: Success
                    data:
                      nomor_sim: '1234567890123456'
                      nama: 'JOHN DOE'
                      tempat_lahir: 'JAKARTA'
                      tanggal_lahir: '01-01-1990'
                      jenis_kelamin: 'LAKI-LAKI'
                      golongan_darah: 'O'
                      alamat: 'JL. MERDEKA NO. 123'
                      rt: '001'
                      rw: '002'
                      kelurahan: 'GAMBIR'
                      kecamatan: 'GAMBIR'
                      kota: 'JAKARTA PUSAT'
                      provinsi: 'DKI JAKARTA'
                      tinggi_badan: '170'
                      jenis_sim: 'A'
                      pekerjaan: 'KARYAWAN SWASTA'
                      tempat_pembuatan: 'POLRES JAKARTA PUSAT'
                      tanggal_terbit: '01-01-2020'
                      tanggal_berlaku: '01-01-2025'
        '400':
          description: Bad Request
          content:
            application/json:
              examples:
                Missing File:
                  summary: Missing File
                  value:
                    is_success: false
                    message: 'File is required'
                Invalid File Type:
                  summary: Invalid File Type
                  value:
                    is_success: false
                    message: 'Invalid file type. Supported formats: JPG, JPEG, PNG'
                File Too Large:
                  summary: File Too Large
                  value:
                    is_success: false
                    message: 'File size exceeds maximum limit of 5 MB'
                Invalid SIM Image:
                  summary: Invalid SIM Image
                  value:
                    is_success: false
                    message: 'Invalid SIM image. Please provide a valid Indonesian SIM image'
        '401':
          description: Unauthorized
          content:
            application/json:
              examples:
                Missing API Key:
                  summary: Missing API Key
                  value:
                    is_success: false
                    message: 'Missing API key in x-api-co-id header'
                Invalid API Key:
                  summary: Invalid API Key
                  value:
                    is_success: false
                    message: 'Invalid API key'
        '429':
          description: Too Many Requests
          content:
            application/json:
              examples:
                Rate Limit Exceeded:
                  summary: Rate Limit Exceeded
                  value:
                    is_success: false
                    message: 'Rate limit exceeded. Please try again later'
