Belgium eID OCR Python SDK

Instantly extract data from Belgian IDs (eID) using our native Python library.

AI extracting data from a Belgium eID card
StructOCR engine analyzing a Belgian Electronic Identity Card (eID) in real-time.

Parsing Belgium eID Challenges

The Belgian Electronic Identity Card (eID) poses unique OCR challenges. Accurately extracting the National Register Number (Rijksregisternummer / Numéro de registre national), handling multi-lingual fields (Dutch, French, German), and scanning the MRZ require highly specialized computer vision models.

Why StructOCR for Belgium

StructOCR's model is specifically trained on a large dataset of Belgian ID images, ensuring high accuracy for national id ocr extraction. The Python SDK simplifies the integration process with just a few lines of code, allowing you to instantly extract structural data, including the National Register Number mapped to the personal number field, and automate your verification workflows.

Common Use Cases in Belgium

  • Digital Onboarding: Verify users for Fintech apps and banking services in Belgium.
  • Itsme & eHealth Integration: Automate document parsing for Belgian digital identity and healthcare frameworks.
  • HR & Payroll Processing: Speed up employee registration workflows by accurately extracting the National Register Number.

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`. Then use the following code.

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_belgium_id():
    # Note: Supports JPG, PNG, WebP (Max 4.5MB)
    # Target: Electronic Identity Card (eID)
    image_path = "belgium_national_id.jpg"

    try:
        print(f"Scanning {image_path}...")
        
        # The SDK handles file upload and API communication
        # It automatically detects that this is a Belgian document
        result = client.scan_national_id(image_path)

        # Check success flag (SDK returns a dict matching the JSON response)
        if result.get('success'):
            data = result['data']
            print("✅ Belgium 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: National Register Number
            print(f"National No: {data.get('personal_number')}")
            
            # Demographics
            print(f"DOB:         {data.get('date_of_birth')} ({data.get('sex')})")
            print(f"Address:     {data.get('address')}")
            
            # MRZ Extraction
            additional = data.get('additional_fields', {})
            if additional.get('mrz_line_1'):
                print("\n🔍 MRZ Data Found:")
                print(additional.get('mrz_line_1'))
                print(additional.get('mrz_line_2'))
                print(additional.get('mrz_line_3') or "")
        else:
            print(f"❌ Extraction Failed: {result.get('error')}")

    except Exception as e:
        # Handle SDK or Network errors
        print(f"An error occurred: {e}")

if __name__ == "__main__":
    scan_belgium_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)

Key Features

  • Multi-lingual Support: Reads Dutch, French, and German characters seamlessly.
  • MRZ Extraction: Automatically parses the Machine Readable Zone (MRZ) on the ID.
  • National Register Number Extraction: Automatically extracts and validates the Belgian Rijksregisternummer format (YY.MM.DD-XXX.CD).
  • Multi-line Address Support: Capable of reconstructing complex multi-line addresses common on Belgian cards.
  • Smart Crop & Blur Detection: Rejects blurry images and removes background noise automatically.

JSON Response Example

The SDK returns a Python dictionary matching this JSON structure.

{
  "success": true,
  "data": {
    "type": "national_id",
    "country_code": "BEL",
    "nationality": "BELG/BELGE",
    "document_number": "590123456789",
    "card_series": "",
    "personal_number": "80.01.01-123.45",
    "surname": "PEETERS",
    "given_names": "JAN",
    "sex": "M",
    "date_of_birth": "1980-01-01",
    "place_of_birth": "BRUSSELS",
    "address": "WETSTRAAT 16, 1000 BRUSSELS",
    "date_of_issue": "2022-01-01",
    "date_of_expiry": "2032-01-01",
    "issuing_authority": "GEMEENTE BRUSSELS",
    "additional_fields": {
      "phone_number": null,
      "tramite_number": null,
      "ejemplar": null,
      "mrz_line_1": "IDBEL590123456789<<<<<<<<<<<<<",
      "mrz_line_2": "8001015M3201018BEL800101123456",
      "mrz_line_3": "PEETERS<<JAN<<<<<<<<<<<<<<<<<<"
    }
  }
}

Frequently Asked Questions

Does the Python SDK handle image uploads?

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

Is data stored?

No. Images are processed in-memory and deleted immediately to comply with GDPR and European data protection laws.

How to handle errors?

The SDK result dictionary contains a 'success' boolean and an 'error' code (e.g., FILE_TOO_LARGE) if failed.

You May Also Like

Related tutorials, platform guides, and comparisons

Country Tutorial

Belgium Passport OCR with Python SDK

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

Python · Passport
Country Tutorial

Kazakhstan Identity Card (Udostoverenie) OCR Python SDK

Python Tutorial: Automate KYC in Kazakhstan. Extract dual-script data, the 12-digit IIN, and validate TD1 MRZ from Identity Card (Udostoverenie) using StructOCR Python SDK.

Python · identity card (udostoverenie)
Country Tutorial

Netherlands Identiteitskaart OCR Python SDK

Python Tutorial: Automate KYC in Netherlands. Extract data from Identiteitskaart using StructOCR Python SDK. Supports native text and MRZ extraction.

Python · identiteitskaart
Country Tutorial

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.

Python · Passport
Country Tutorial

Argentina Passport OCR with Python SDK

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

Python · Passport
Country Tutorial

US Driver License OCR with Python SDK

Extract structured fields from a United States state-issued driver license with the StructOCR Python SDK and FastAPI.

Python · Driver License
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

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

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

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