Kazakhstan Identity Card (Udostoverenie) OCR Python SDK

Instantly extract dual-script visual data, the 12-digit IIN, and validate cryptographic MRZ checksums from Kazakhstani IDs using our native Python library.

AI extracting data, IIN, and TD1 MRZ from a Kazakhstan Identity Card
StructOCR engine analyzing a Kazakhstani document, handling Cyrillic text, and cross-validating the MRZ in real-time.

Parsing Identity Card (Udostoverenie) Challenges

Kazakhstan Identity Cards (Udostoverenie) present unique challenges. Firstly, the presence of both Cyrillic (Kazakh/Russian) and Latin script within the same document requires specialized OCR models for accurate native script recognition. Secondly, ensuring the document's authenticity requires reliably locating and strictly validating the Machine-Readable Zone (MRZ) on the back of the card, while successfully extracting the critical 12-digit IIN (Индивидуальный идентификационный номер) embedded within it.

Why StructOCR for Kazakhstan

StructOCR's model is specifically trained on a diverse dataset of Kazakhstani Identity Cards, accounting for variations in layout, dual-script typography, and print quality. This specialized id card parsing capability ensures precise extraction of the IIN. Our Python SDK effortlessly automates image preprocessing and actively parses the embedded TD1 MRZ, making KYC automation workflows highly secure and reliable.

Common Use Cases in Kazakhstan

  • Digital Onboarding: Verify users for Fintech apps in Kazakhstan by automatically matching VIZ data and the IIN against the cryptographic MRZ.
  • Telecom Registration: Automate SIM card registration with robust extraction of Cyrillic addresses and standard identifiers.
  • Hotel Check-in: Speed up guest registration workflows with automated MRZ scanning.

Live Demo: ID card scanner

No registration required. Upload a file to test the extraction.

1
Upload
2
Results

Drop files here or click to browse

JPG · PNG · WebP  ·  up to 500 files · max 4.5 MB each

No files selected
Need more testing? Create a free account to get 200 free credits (equals 100 National ID scans).

Python SDK Integration

Install the SDK via pip: `pip install structocr`. The SDK automatically maps Kazakhstani visual fields and extracts the raw TD1 MRZ lines.

Prerequisite: Python 3.6+ and `structocr` library installed.

from structocr import StructOCR

# 💰 Save 30%+ vs competitors. Get 200 free credits instantly:
# 👉 https://structocr.com/register
# Initialize with your API Key
client = StructOCR("YOUR_API_KEY_HERE")

def scan_kazakhstan_id():
    # Note: Supports JPG, PNG, WebP (Max 4.5MB)
    # Target: Identity Card (Udostoverenie)
    image_path = "kazakhstan_national_id.jpg"

    try:
        print(f"Scanning {image_path}...")
        
        # The SDK handles file upload and API communication
        result = client.scan_national_id(image_path)

        if result.get('success'):
            data = result['data']
            print("✅ Kazakhstan Extraction Successful!")
            
            # Basic Identity
            print(f"Region:      {data.get('country_code')} (Series: {data.get('card_series')})")
            print(f"Name:        {data.get('given_names')} {data.get('surname')}")
            print(f"Document No: {data.get('document_number')}")
            
            # Critical Field: IIN (Индивидуальный идентификационный номер)
            print(f"IIN:         {data.get('personal_number')}")
            
            # Demographics
            print(f"DOB:         {data.get('date_of_birth')} ({data.get('sex')})")
            print(f"Address:     {data.get('address')}")
            
            # Extract TD1 MRZ Data
            additional = data.get('additional_fields', {})
            if additional.get('mrz_line_1'):
                print("\n🔍 MRZ Data Extracted & Validated:")
                print(f"Line 1: {additional.get('mrz_line_1')}")
                print(f"Line 2: {additional.get('mrz_line_2')}")
                print(f"Line 3: {additional.get('mrz_line_3')}")
        else:
            print(f"❌ Extraction Failed: {result.get('error')}")

    except Exception as e:
        print(f"An error occurred: {e}")

if __name__ == "__main__":
    scan_kazakhstan_id()

Technical Specs

  • Latency: < 4s (Average)
  • Uptime: 99.9% SLA
  • Security: AES-256 Encryption & SOC2 Compliant
  • Input: JPG, PNG, WebP (Max 4.5MB)
  • Output: JSON (Structured Data + MRZ Block)

Key Features

  • IIN Extraction: Automatically locates and accurately formats the critical 12-digit IIN (ИИН).
  • Dual-Script Engine: Natively parses both Cyrillic and Latin characters within the visual document fields.
  • Hybrid VIZ + MRZ AI: Cross-validates unstructured visual data against cryptographic TD1 MRZ checksums for zero hallucination.
  • Smart Crop: Removes background noise and deskews automatically, ideal for mobile photo submissions.

JSON Response Example

The SDK returns a Python dictionary matching this JSON structure, including the parsed visual data (VIZ), the 12-digit IIN, and the raw Machine-Readable Zone (MRZ).

{
  "success": true,
  "data": {
    "type": "national_id",
    "country_code": "KAZ",
    "nationality": "ҚАЗАҚСТАН / KAZAKHSTAN",
    "document_number": "123456789",
    "card_series": "",
    "personal_number": "900101300456",
    "surname": "АЛИЕВ",
    "given_names": "НУРСУЛТАН",
    "sex": "M",
    "date_of_birth": "1990-05-15",
    "place_of_birth": "ALMATY",
    "address": "мкр. Самал-2, д. 15, кв. 4, Алматы",
    "date_of_issue": "2020-01-01",
    "date_of_expiry": "2030-01-01",
    "issuing_authority": "MINISTRY OF INTERNAL AFFAIRS",
    "additional_fields": {
      "tramite_number": null,
      "mrz_line_1": "I<KAZ1234567895900101300456<<<",
      "mrz_line_2": "9005156M3001018KAZ<<<<<<<<<<<4",
      "mrz_line_3": "ALIEV<<NURSULTAN<<<<<<<<<<<<<<"
    }
  }
}

Frequently Asked Questions

Does the SDK validate the MRZ on the back of the Kazakhstan Identity Card?

Yes. Our engine extracts the TD1 format MRZ lines and runs the standard ICAO 9303 checksum verification (modulus 10 with 7-3-1 weighting) to ensure data integrity.

Can it extract the 12-digit IIN (ИИН)?

Absolutely. The models natively target the unique 12-digit IIN (Индивидуальный идентификационный номер), mapping it directly to the `personal_number` field and matching it against the embedded MRZ sequence.

How does it handle Cyrillic names in the MRZ validation?

The MRZ strictly uses Latin characters. StructOCR automatically applies standard ICAO transliteration rules to map the Visual Zone's Cyrillic characters (e.g., АЛИЕВ) to the MRZ's Latin characters (ALIEV) during validation.

You May Also Like

Related tutorials, platform guides, and comparisons

Country Tutorial

Kazakhstan Passport OCR with Python SDK

Use the official StructOCR Python SDK and FastAPI to extract structured MRZ and VIZ data from Kazakhstan passports with a server-side integration.

Python · Passport
Country Tutorial

France Carte Nationale d'Identité OCR Python SDK

Python Tutorial: Automate KYC in France. Extract data from Carte Nationale d'Identité and validate TD1/TD2 MRZ using StructOCR Python SDK. Supports native text.

Python · National ID
Country Tutorial

UK Passport OCR with Python SDK

Use the official StructOCR Python SDK and FastAPI to extract structured MRZ and VIZ data from UK passports with a server-side integration.

Python · Passport
Country Tutorial

Pakistan Passport OCR with Python SDK

Use the official StructOCR Python SDK and FastAPI to extract structured MRZ and VIZ data from Pakistan passports with a server-side integration.

Python · Passport
Country Tutorial

Greece Deltio Taftotitas OCR Python SDK

Python Tutorial: Automate KYC in Greece. Extract dual-script data from Deltio Taftotitas and validate TD1 MRZ using StructOCR Python SDK.

Python · deltio taftotitas
Country Tutorial

Serbia Passport OCR with Python SDK

Use the official StructOCR Python SDK and FastAPI to extract structured MRZ and VIZ data from Serbia passports with a server-side integration.

Python · Passport
Country Tutorial

Chile Cédula OCR Python SDK

Python Tutorial: Automate KYC in Chile. Extract data from the Chilean Cédula de Identidad using StructOCR Python SDK. Supports RUN/RUT extraction and native Spanish text parsing.

Python · cédula de identidad
Country Tutorial

Colombia Cédula OCR Python SDK

Python Tutorial: Automate KYC in Colombia. Extract data from the Colombian Cédula de Ciudadanía using StructOCR Python SDK. Supports NUIP extraction and complex address parsing.

Python · cédula de ciudadanía
Country Tutorial

Bulgaria Lichna karta (Лична карта) OCR Python SDK

Python Tutorial: Automate KYC in Bulgaria. Extract Cyrillic/Latin text, EGN (ЕГН), and validate TD1 MRZ from Lichna karta using StructOCR Python SDK.

Python · lichna karta (лична карта)
Country Tutorial

Côte d'Ivoire CNI (Carte Nationale d'Identité) OCR Python SDK

Python Tutorial: Automate KYC in Côte d'Ivoire. Extract French text, NNI, and validate TD1 MRZ from the ONECI CNI using StructOCR Python SDK.

Python · National ID

Technical Comparisons & Integrations

Explore platform integrations and competitive analysis

From tutorial to production in 5 minutes.

You've seen the code. Now get your API key, grab your 200 free credits, and see it work with your own images. No credit card required.

Instant Access Cancel Anytime 99.9% Uptime