Hungary Személyazonosító OCR Python SDK

Instantly extract visual data and validate cryptographic MRZ checksums from Hungarian IDs using our native Python library.

AI extracting data and TD1 MRZ from a Hungary Személyazonosító
StructOCR engine analyzing a Hungarian document, interpreting special characters, and cross-validating the MRZ in real-time.

Parsing Személyazonosító Challenges

Hungarian Személyazonosító cards pose unique OCR challenges. First, the presence of specific native Hungarian characters and accents (such as ő, ű, á, é, í) requires highly robust native script recognition to prevent data corruption. Second, varying layouts across different card versions and print quality variations complicate data extraction. Finally, ensuring the document's authenticity requires reliably locating and strictly validating the Machine-Readable Zone (MRZ) on the back of the card, while correctly transliterating Hungarian visual text into the MRZ format.

Why StructOCR for Hungary

Our model is specifically trained on a large dataset of Hungarian Személyazonosító cards, including variations in layout and print quality, making it ideal for advanced id card parsing tasks. The Python SDK simplifies integration, effortlessly handling complex Hungarian typography. It automatically preprocesses images and actively parses the embedded TD1 MRZ, allowing developers to quickly and securely deploy KYC automation workflows with minimal code.

Common Use Cases in Hungary

  • Digital Onboarding: Verify users for Fintech apps in Hungary by automatically matching VIZ data against the cryptographic MRZ.
  • Telecom Registration: Automate SIM card registration with robust extraction of Hungarian addresses and special characters.
  • Hotel Check-in: Speed up guest registration workflows with automated eSzemélyi 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 Hungarian 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_hungary_id():
    # Note: Supports JPG, PNG, WebP (Max 4.5MB)
    # Target: Személyazonosító
    image_path = "hungary_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("✅ Hungary 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 Field: Personal Identity Number
            print(f"Personal #:  {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_hungary_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 Hungarian OCR: Perfectly captures complex diacritics (ő, ű, á, é, í, etc.) without encoding errors.
  • Hybrid VIZ + MRZ AI: Cross-validates unstructured visual data against cryptographic TD1 MRZ checksums for zero hallucination.
  • Blur Detection: Automatically rejects blurry images.
  • Smart Crop: Removes background noise and deskews rotated images automatically, ideal for mobile photos.

JSON Response Example

The SDK returns a Python dictionary matching this JSON structure, including the parsed visual data with native Hungarian characters and the raw Machine-Readable Zone (MRZ).

{
  "success": true,
  "data": {
    "type": "national_id",
    "country_code": "HUN",
    "nationality": "MAGYAR",
    "document_number": "123456AB",
    "card_series": "",
    "personal_number": "1 900101 1234",
    "surname": "NAGY",
    "given_names": "ISTVÁN",
    "sex": "M",
    "date_of_birth": "1990-05-15",
    "place_of_birth": "BUDAPEST",
    "address": "1052 Budapest, Deák Ferenc tér 1.",
    "date_of_issue": "2020-01-01",
    "date_of_expiry": "2030-01-01",
    "issuing_authority": "Budapest Főváros Kormányhivatala",
    "additional_fields": {
      "tramite_number": null,
      "mrz_line_1": "IDHUN123456AB<9<<<<<<<<<<<<<<<",
      "mrz_line_2": "9005156M3001018HUN<<<<<<<<<<<4",
      "mrz_line_3": "NAGY<<ISTVAN<<<<<<<<<<<<<<<<<<"
    }
  }
}

Frequently Asked Questions

Does the SDK validate the MRZ on the back of the Személyazonosító?

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.

Does it support Hungarian special characters like ő and ű?

Absolutely. The OCR engine is fully optimized for Hungarian typography. It natively processes all special characters in the Visual Zone (VIZ) and maps them to their ICAO transliterated equivalents when checking the MRZ.

Does the Python SDK handle image uploads?

Yes, the SDK automatically handles base64 encoding and file uploads securely.

You May Also Like

Related tutorials, platform guides, and comparisons

Country Tutorial

Hungary Passport OCR with Python SDK

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

Python · Passport
Country Tutorial

Bangladesh Passport OCR with Python SDK

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

Python · Passport
Country Tutorial

Czech Republic Občanský průkaz OCR Python SDK

Python Tutorial: Automate KYC in the Czech Republic. Extract Czech text with diacritics, Rodné číslo, and validate TD1 MRZ from Občanský průkaz.

Python · občanský průkaz
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

Ghana Passport OCR with Python SDK

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

Python · Passport
Country Tutorial

Estonia Passport OCR with Python SDK

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

Python · Passport
Country Tutorial

Switzerland ID Card OCR Python SDK

Python Tutorial: Automate KYC in Switzerland. Extract data from the Swiss Identity Card (Identitätskarte) using StructOCR Python SDK. Supports multi-lingual text and MRZ extraction.

Python · swiss id
Country Tutorial

Spain DNI (DNIe) OCR Python SDK

Python Tutorial: Automate KYC in Spain. Extract data from DNI (DNIe) using StructOCR Python SDK. Supports native text and MRZ extraction.

Python · dni (dnie)
Country Tutorial

Serbia Lična karta OCR Python SDK

Python Tutorial: Automate KYC in Serbia. Extract data from Lična karta using StructOCR Python SDK. Supports native text and MRZ extraction.

Python · lična karta
Country Tutorial

South Africa Smart ID Card OCR Python SDK

Python Tutorial: Automate KYC in South Africa. Extract data from Smart ID Card using StructOCR Python SDK. Supports native text and MRZ extraction.

Python · smart id card

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