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.

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.
Drop files here or click to browse
JPG · PNG · WebP · up to 500 files · max 4.5 MB each
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
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
Technical Comparisons & Integrations
Explore platform integrations and competitive analysis
Add National ID OCR to Your Bolt.new App in 5 Minutes
Step-by-step guide to integrating the StructOCR National ID scanner API into a Bolt.new app. Build KYC and identity verification flows right in your browser.
Add National ID OCR using Cursor in 5 Minutes
Step-by-step guide to integrating the StructOCR National ID scanner API using the Cursor AI code editor. Build KYC and identity verification flows rapidly.
Add National ID OCR to Your Lovable.dev App in 5 Minutes
Step-by-step guide to integrating the StructOCR National ID scanner API into a Lovable.dev app. Build KYC and identity verification flows with zero backend.
Add National ID OCR to Your Replit App in 5 Minutes
Step-by-step guide to integrating the StructOCR National ID scanner API into a Replit application. Build KYC and identity verification flows using Replit Agent and Secrets.
Add National ID OCR to Your v0 App in 5 Minutes
Step-by-step guide to integrating the StructOCR National ID scanner API into a v0 by Vercel app. Build KYC and identity verification flows with zero backend.
Single-Page MRZ SDKs vs. Dual-Page Indian KYC API
Why traditional MRZ scanners fail at full Indian Passport verification, and how to process both the front identity page and the back address page in a single API call.
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.