Estonia ID-kaart OCR Python SDK

Instantly extract data from Estonian IDs (ID-kaart) using our native Python library.

AI extracting data from an Estonia ID card
StructOCR engine analyzing an Estonian Identity Card (ID-kaart) in real-time.

Parsing ID-kaart Challenges

The Estonian Identity Card (ID-kaart) is one of the most advanced electronic IDs globally, but visually parsing its layout introduces unique OCR challenges. Accurately extracting the eleven-digit Personal Identification Code (Isikukood), handling bilingual field labels (Estonian/English), and scanning the multi-line MRZ on the reverse require highly specialized computer vision models.

Why StructOCR for Estonia

StructOCR's model is specifically trained on a large dataset of Estonian 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 Isikukood mapped to the personal number field, and automate your verification workflows.

Common Use Cases in Estonia

  • Digital Onboarding & e-Residency: Verify local citizens and global e-residents for Fintech apps and digital services in Estonia.
  • Crypto & Web3 KYC: Automate compliant user identity verification for digital asset platforms operating under Estonian FIU regulations.
  • Business Process Automation: Speed up employee and client registrations by instantly capturing verified identity details directly into your CRM.

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_estonia_id():
    # Note: Supports JPG, PNG, WebP (Max 4.5MB)
    # Target: Estonian Identity Card (ID-kaart)
    image_path = "estonia_national_id.jpg"

    try:
        print(f"Scanning {image_path}...")
        
        # The SDK handles file upload and API communication
        # It automatically detects that this is an Estonian 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("✅ Estonia 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: Isikukood (Personal Code)
            print(f"Isikukood:   {data.get('personal_number')}")
            
            # Demographics
            print(f"DOB:         {data.get('date_of_birth')} ({data.get('sex')})")
            
            # MRZ Extraction (Present on the back of Estonian ID-kaart)
            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_estonia_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

  • Bilingual Layout Support: Reads Estonian special characters and English headings seamlessly.
  • MRZ Extraction: Automatically parses the Machine Readable Zone (MRZ) on the reverse of the card.
  • Isikukood Extraction: Seamlessly extracts and structure-validates the 11-digit Estonian personal identification code.
  • Normalized Date Formats: Standardizes birth, issue, and expiry dates into the clean `YYYY-MM-DD` standard.
  • 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": "EST",
    "nationality": "ESTONIAN",
    "document_number": "AA0000000",
    "card_series": "",
    "personal_number": "49001010123",
    "surname": "TAMM",
    "given_names": "MARI-LIIS",
    "sex": "F",
    "date_of_birth": "1990-01-01",
    "place_of_birth": "TALLINN",
    "address": null,
    "date_of_issue": "2021-05-12",
    "date_of_expiry": "2031-05-11",
    "issuing_authority": "PPA",
    "additional_fields": {
      "phone_number": null,
      "tramite_number": null,
      "ejemplar": null,
      "mrz_line_1": "IDESTAA00000004<<<<<<<<<<<<<<<",
      "mrz_line_2": "9001011F3105117EST490010101238",
      "mrz_line_3": "TAMM<<MARI<LIIS<<<<<<<<<<<<<<<"
    }
  }
}

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

Ghana Ghana Card OCR Python SDK

Python Tutorial: Automate KYC in Ghana. Extract data, Personal ID Number, and validate TD1 MRZ from Ghana Card using StructOCR Python SDK.

Python · ghana card
Country Tutorial

Sri Lankan Passport OCR with Python SDK

Use the StructOCR Python SDK and FastAPI to extract visible identity, validity and MRZ fields from Sri Lankan passports.

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

Poland Passport OCR with Python SDK

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

Python · Passport
Country Tutorial

Portugal Passport OCR with Python SDK

Use the official StructOCR Python SDK and FastAPI to extract structured MRZ and VIZ data from Portugal 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

Saudi Arabia Passport OCR with Python SDK

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

Python · Passport
Country Tutorial

Ethiopia Fayda ID OCR Python SDK

Python Tutorial: Automate KYC in Ethiopia. Extract data from Fayda ID using StructOCR Python SDK. Supports native text.

Python · fayda id
Country Tutorial

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.

Python · personalausweis
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

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