Poland Dowód Osobisty OCR Python SDK
Instantly extract data and MRZ from Polish IDs using our native Python library.

Parsing Dowód Osobisty Challenges
Parsing Dowód Osobisty presents several challenges. Firstly, the documents contain both machine-readable zones (MRZ) and fields with native Polish characters (diacritics like 'ą', 'ę', 'ć', 'ń', 'ó', 'ś', 'ź', 'ż') which require accurate character recognition. Secondly, layout variations across different issuing authorities can lead to parsing inconsistencies. Additionally, print quality and document damage can impact OCR accuracy.
Why StructOCR for Poland
Our StructOCR model is specifically trained on a diverse dataset of Polish Dowód Osobisty examples, ensuring high accuracy in recognizing Polish characters and handling layout variations. This advanced id card parsing capability is crucial for efficient kyc automation. The intuitive Python SDK simplifies integration, automatically parsing both visual data and the 3-line MRZ on the back of the card, returning everything in a structured JSON object.
Common Use Cases in Poland
- Digital Onboarding: Verify users for Fintech apps in Poland with full MRZ validation.
- Telecom Registration: Automate SIM card registration with Dowód Osobisty.
- Hotel Check-in: Speed up guest registration workflows using fast 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`. Then use the following code to extract data including the MRZ.
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_poland_id():
# Note: Supports JPG, PNG, WebP (Max 4.5MB)
# Target: Dowód Osobisty
image_path = "poland_national_id.jpg"
try:
print(f"Scanning {image_path}...")
# The SDK handles file upload and API communication
# It automatically detects that this is a Polish 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("✅ Poland 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"ID Number: {data.get('document_number')}")
# Critical Field: PESEL Number (Mapped to personal_number)
print(f"PESEL #: {data.get('personal_number')}")
# Demographics
print(f"DOB: {data.get('date_of_birth')} ({data.get('sex')})")
print(f"Address: {data.get('address')}")
# MRZ Data Extraction
additional = data.get('additional_fields', {})
if additional and additional.get('mrz_line_1'):
print("\n--- MRZ Data ---")
print(f"Line 1: {additional.get('mrz_line_1')}")
print(f"Line 2: {additional.get('mrz_line_2')}")
if additional.get('mrz_line_3'):
print(f"Line 3: {additional.get('mrz_line_3')}")
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_poland_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
- •Native Script Support: Reads English and Polish diacritics effortlessly.
- •MRZ Parsing: Seamlessly extracts the Machine Readable Zone on the back of the Polish ID.
- •Blur Detection: Automatically rejects blurry images.
- •Fraud Check: Validates Dowód Osobisty number and PESEL format.
- •Smart Crop: Removes background noise automatically.
JSON Response Example
The SDK returns a Python dictionary matching this JSON structure. Note the `additional_fields` object handling the MRZ lines.
{
"success": true,
"data": {
"type": "national_id",
"country_code": "POL",
"nationality": "POLSKIE",
"document_number": "ABC123456",
"card_series": "ABC",
"personal_number": "90051512345",
"surname": "KOWALSKI",
"given_names": "JAN PIOTR",
"sex": "M",
"date_of_birth": "1990-05-15",
"place_of_birth": "WARSZAWA",
"address": "ul. Marszałkowska 10 m. 5, 00-590 Warszawa",
"date_of_issue": "2020-01-01",
"date_of_expiry": "2030-01-01",
"issuing_authority": "Prezydent Miasta Stołecznego Warszawy",
"additional_fields": {
"mrz_line_1": "IDPOLABC1234565<<<<<<<<<<<<<<<",
"mrz_line_2": "9005151M3001014POL90051512345<",
"mrz_line_3": "KOWALSKI<<JAN<PIOTR<<<<<<<<<<<",
"tramite_number": null,
"ejemplar": null,
"phone_number": null
}
}
}Frequently Asked Questions
Does the Python SDK handle image uploads?
Yes, the SDK automatically handles base64 encoding and file uploads.
Does the API extract MRZ from Polish IDs?
Yes, if the uploaded image contains the back of the Dowód Osobisty, the API automatically parses the 3-line MRZ and returns it within the `additional_fields` object.
Is data stored?
No. Images are processed in-memory and deleted immediately.
How to handle errors?
The SDK result dictionary contains a 'success' boolean and an 'error' message if failed.
You May Also Like
Related tutorials, platform guides, and comparisons
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.
Uganda Passport OCR with Python SDK
Use the official StructOCR Python SDK and FastAPI to extract structured MRZ and VIZ data from Uganda passports with a server-side integration.
Australia Driver License OCR with Python SDK
Extract structured fields from a Australia state or territory driver licence with the StructOCR Python SDK and FastAPI.
Pakistan CNIC OCR Python SDK
Python Tutorial: Automate KYC in Pakistan. Extract data from CNIC using StructOCR Python SDK. Supports native text.
Chile Passport OCR with Python SDK
Use the official StructOCR Python SDK and FastAPI to extract structured MRZ and VIZ data from Chile passports with a server-side integration.
Colombia Passport OCR with Python SDK
Use the official StructOCR Python SDK and FastAPI to extract structured MRZ and VIZ data from Colombia passports with a server-side integration.
Algeria CNIBE (Biometric ID) OCR Python SDK
Python Tutorial: Automate KYC in Algeria. Extract bilingual text and validate TD1 MRZ from CNIBE (Biometric ID) using StructOCR Python SDK.
Argentina DNI OCR Python SDK
Python Tutorial: Automate KYC in Argentina. Extract Spanish text, CUIL/CUIT, and validate TD1 MRZ from DNI using StructOCR Python SDK.
Node.js Receipt OCR API SDK
Tutorial: Integrate the StructOCR Node.js SDK to extract structured data from retail receipts. Upload an image for a free test! Parse merchants, totals, and line items in your Javascript backends.
Java Receipt OCR API
Tutorial: Integrate StructOCR's Receipt API into your Java enterprise applications. Upload an image for a free test! Extract line items, merchants, and taxes from POS receipts into structured JSON.
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 using Cursor in 5 Minutes
Step-by-step guide to integrating the StructOCR shipping container API using the Cursor AI code editor. Build logistics and yard management tools rapidly.
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.