Bulgaria Lichna karta (Лична карта) OCR Python SDK
Instantly extract Cyrillic text, EGN numbers, and validate cryptographic MRZ checksums from Bulgarian IDs using our native Python library.

Parsing Lichna karta (Лична карта) Challenges
Bulgarian Lichna karta presents unique OCR challenges. First, the mix of Cyrillic and Latin characters within the same document necessitates robust bilingual recognition that standard OCR engines struggle to provide. Second, locating and accurately extracting the 10-digit EGN (ЕГН - Uniform Civil Number) is critical for local compliance but formatting often varies. Finally, manually parsing the Machine-Readable Zone (MRZ) on the back of the card to mathematically verify the document's authenticity adds significant engineering overhead.
Why StructOCR for Bulgaria
StructOCR is specifically trained on a large dataset of Bulgarian Lichna karta, ensuring unparalleled accuracy with both Cyrillic and Latin scripts. Our Python SDK automatically locates critical fields like the EGN and simplifies integration via our national ID parsing API, making it ideal for accelerating your KYC automation platform.
Common Use Cases in the Balkans
- Digital Onboarding: Verify users for Fintech apps in Bulgaria by pre-filling EGN and Cyrillic name data in < 2 seconds.
- Telecom Registration: Automate SIM card registration with native Cyrillic script extraction.
- Pan-Balkan Expansion: Seamlessly process users across Eastern Europe. Our unified Python SDK automatically detects and extracts data from neighboring documents, such as the Romania ID or Greece ID, without requiring custom rules.
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 Bulgaria-specific fields (like EGN) and parses the TD1 MRZ block.
Prerequisite: Python 3.6+ and `structocr` library installed.
from structocr import StructOCR
# 🔑 Need a key for Bulgaria? Get 200 free credits instantly:
# 👉 https://structocr.com/register
# Initialize with your API Key
client = StructOCR("YOUR_API_KEY_HERE")
def scan_bulgaria_id():
# Note: Supports JPG, PNG, WebP (Max 4.5MB)
image_path = "bulgaria_lichna_karta.jpg"
try:
print(f"Scanning {image_path}...")
result = client.scan_national_id(image_path)
if result.get('success'):
data = result['data']
print("✅ Bulgaria Lichna Karta Extraction Successful!")
# Basic Identity
print(f"Region: {data.get('country_code')}")
print(f"Name: {data.get('given_names')} {data.get('surname')}")
print(f"ID Number: {data.get('document_number')}")
# Critical Local Field: EGN (ЕГН)
print(f"EGN (ЕГН): {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_bulgaria_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
- •Native Cyrillic OCR: Perfectly captures Bulgarian Cyrillic characters seamlessly alongside Latin scripts, returning standardized Unicode.
- •EGN (ЕГН) Extraction: Automatically locates and formats the critical 10-digit Uniform Civil Number.
- •Hybrid VIZ + MRZ AI: Cross-validates unstructured visual data against cryptographic TD1 MRZ checksums for zero hallucination.
- •Smart Crop: Removes background noise and deskews rotated images automatically, ideal for user-submitted mobile photos.
JSON Response Example
The SDK returns a Python dictionary containing the parsed visual data (VIZ) in Cyrillic, the EGN, and the raw Machine-Readable Zone (MRZ) block.
{
"success": true,
"data": {
"type": "national_id",
"country_code": "BGR",
"nationality": "БЪЛГАРИЯ",
"document_number": "640123456",
"card_series": "",
"personal_number": "9005151234",
"surname": "ИВАНОВ",
"given_names": "ДИМИТЪР",
"sex": "M",
"date_of_birth": "1990-05-15",
"place_of_birth": "СОФИЯ",
"address": "ж.к. Младост 1, бл. 10, вх. А, ап. 3, София",
"date_of_issue": "2020-01-01",
"date_of_expiry": "2030-01-01",
"issuing_authority": "МВР София",
"additional_fields": {
"tramite_number": null,
"mrz_line_1": "IDBGR6401234560<<<<<<<<<<<<<<<",
"mrz_line_2": "9005156M3001018BGR<<<<<<<<<<<4",
"mrz_line_3": "IVANOV<<DIMITAR<<<<<<<<<<<<<<<"
}
}
}Frequently Asked Questions
Does the SDK validate the MRZ on the back of the Bulgarian Lichna karta?
Yes. Our engine extracts the TD1 format MRZ lines and runs the ICAO 9303 checksum verification (modulus 10 with 7-3-1 weighting) on the document number and date of birth to ensure data integrity.
Can it extract the EGN (ЕГН)?
Absolutely. The models natively target the 10-digit EGN (Uniform Civil Number) required for official database verification in Bulgaria, mapping it to the `personal_number` field.
Does it support Cyrillic characters?
Yes, our OCR engine is fully optimized for Bulgarian Cyrillic typography. It simultaneously processes both Bulgarian and English text, outputting clean, standardized Unicode strings without encoding errors.
You May Also Like
Related tutorials, platform guides, and comparisons
Bulgaria Passport OCR with Python SDK
Use the official StructOCR Python SDK and FastAPI to extract structured MRZ and VIZ data from Bulgaria passports with a server-side integration.
Senegal Carte d'Identité CEDEAO OCR Python SDK
Python Tutorial: Automate KYC in Senegal. Extract data from Carte d'Identité CEDEAO using StructOCR Python SDK. Supports native text and MRZ extraction.
Morocco Passport OCR with Python SDK
Use the official StructOCR Python SDK and FastAPI to extract structured MRZ and VIZ data from Morocco passports with a server-side integration.
UAE Emirates ID OCR Python SDK
Python Tutorial: Automate KYC in the UAE. Extract data from Emirates ID using the StructOCR Python SDK. Supports bilingual (Arabic/English) text, front/back sides, and 3-line MRZ extraction.
Ukraine Passport OCR with Python SDK
Use the official StructOCR Python SDK and FastAPI to extract structured MRZ and VIZ data from Ukraine passports with a server-side integration.
Germany Personalausweis OCR Python SDK
Python Tutorial: Automate KYC in Germany. Extract data from Personalausweis and validate TD1 MRZ using StructOCR Python SDK. Supports native German text.
Vietnam Passport OCR with Python SDK
Use the official StructOCR Python SDK and FastAPI to extract structured MRZ and VIZ data from Vietnam passports with a server-side integration.
Uzbekistan ID Karta OCR Python SDK
Python Tutorial: Automate KYC in Uzbekistan. Extract data from ID Karta using StructOCR Python SDK. Supports native text and MRZ parsing.
Vietnam CCCD OCR Python SDK
Python Tutorial: Automate KYC in Vietnam. Extract data from the Vietnamese Identity Card (Căn cước công dân / CCCD) using StructOCR Python SDK. Supports native text, diacritics, and MRZ extraction.
Vietnam Passport OCR with Node.js SDK
Use the official StructOCR Node.js SDK with TypeScript and Express to extract structured MRZ and VIZ data from Vietnam passports.
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.
Add Container OCR to Your Replit App in 5 Minutes
Step-by-step guide to integrating the StructOCR shipping container API into a Replit application. Build logistics and yard management tools using Replit Agent and Secrets.
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.