Chile Cédula OCR Python SDK
Instantly extract data from Chilean Identity Cards (Cédula de Identidad) using our native Python library.
Parsing Cédula de Identidad Challenges
The Chilean Cédula de Identidad poses unique OCR challenges. Accurately extracting the Rol Único Nacional (RUN) or RUT, handling complex Spanish surnames, and parsing data embedded alongside micro-printing and holographic security features require highly specialized computer vision models to ensure accurate data capture.
Why StructOCR for Chile
StructOCR's model is specifically trained on a large dataset of Latin American ID images, ensuring high accuracy for national id ocr extraction. The v1.4.0 Python SDK simplifies the integration process, while our Cloudflare Workers infrastructure ensures ultra-low latency processing. With just a few lines of code, you can extract structural data, including the RUN mapped directly to the personal number field, to fully automate your verification workflows.
Common Use Cases in Chile
- Digital Onboarding: Verify users for Fintech apps, digital wallets, and banking services across Chile.
- Telecom & Utility Registration: Automate document parsing for mobile SIM card sales and essential service applications.
- Notary & Legal Tech: Speed up identity verification for contract signing and legal document processing.
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
# 💰 Note: Deposit via Crypto (USDT/USDC) to automatically receive a 10% credit bonus.
# Initialize with your API Key
client = StructOCR("YOUR_API_KEY_HERE")
def scan_chile_id():
# Note: Supports JPG, PNG, WebP (Max 4.5MB)
# Target: Cédula de Identidad
image_path = "chile_national_id.jpg"
try:
print(f"Scanning {image_path}...")
# The SDK handles file upload and API communication
# It automatically detects that this is a Chilean 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("✅ Chile Extraction Successful!")
# Basic Identity
print(f"Region: {data.get('country_code')}")
print(f"Name: {data.get('given_names')} {data.get('surname')}")
# Critical Field: RUN / RUT (Rol Único Nacional)
print(f"RUN/RUT: {data.get('personal_number')}")
print(f"Doc Number: {data.get('document_number')}")
# Demographics
print(f"DOB: {data.get('date_of_birth')} ({data.get('sex')})")
print(f"Nationality: {data.get('nationality')}")
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_chile_id()Technical Specs
- •Latency: < 4s (Average)
- •Availability: Served from Cloudflare's global edge network
- •Security: AES-256 Encryption & SOC2 Compliant
- •Input: JPG, PNG, WebP (Max 4.5MB)
- •Output: JSON (Structured Data)
Key Features
- •Native Spanish Support: Reads Spanish names, special characters, and regional formatting seamlessly.
- •RUN / RUT Extraction: Automatically extracts and structure-validates the Rol Único Nacional (RUN) identifier.
- •Date Normalization: Standardizes issue dates and birth dates into a consistent `YYYY-MM-DD` format.
- •Smart Crop & Blur Detection: Rejects blurry images and removes background noise automatically to ensure high precision.
JSON Response Example
The SDK returns a Python dictionary matching this JSON structure.
{
"success": true,
"data": {
"type": "national_id",
"country_code": "CHL",
"nationality": "CHILENO",
"document_number": "A1234567",
"card_series": "",
"personal_number": "12.345.678-9",
"surname": "SOTO PÉREZ",
"given_names": "JUAN CARLOS",
"sex": "M",
"date_of_birth": "1990-01-01",
"place_of_birth": null,
"address": null,
"date_of_issue": "2020-01-01",
"date_of_expiry": "2030-01-01",
"issuing_authority": "SERVICIO DE REGISTRO CIVIL E IDENTIFICACION",
"additional_fields": {
"phone_number": null,
"tramite_number": null,
"ejemplar": null,
"mrz_line_1": null,
"mrz_line_2": null,
"mrz_line_3": null
}
}
}Frequently Asked Questions
Does the Python SDK handle image uploads?
Yes, the SDK automatically handles base64 encoding and file uploads.
Is data stored?
Only briefly. Uploaded images and results are kept for at most 24 hours for quality spot-checks, then deleted, which helps with global data privacy regulations and Latin American data protection standards.
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
Tajikistan ID Card (Karta) OCR Python SDK
Python Tutorial: Automate KYC in Tajikistan. Extract data from ID Card (Karta) using StructOCR Python SDK. Supports native text and MRZ extraction.
Tunisia Passport OCR with Python SDK
Use the official StructOCR Python SDK and FastAPI to extract structured MRZ and VIZ data from Tunisia passports with a server-side integration.
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.
Egypt ID OCR API & Python SDK
Python tutorial: read Egyptian national IDs, including the 14-digit national number (century, date of birth, governorate, gender and check digit), as JSON. Test the ID OCR engine free.
Japan Passport OCR with Python SDK
Use the official StructOCR Python SDK and FastAPI to extract structured MRZ and VIZ data from Japan passports with a server-side integration.
Python VIN OCR API
Tutorial: How to use the StructOCR Python SDK to extract data from VIN (Vehicle Identification Number)s. Upload an image for a free test! Includes code samples and JSON schema.
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 National ID OCR API
Extract National ID data with our Node.js SDK. Upload an image for a free test! Get clean, validated JSON output from any ID card image. Integrate KYC in minutes.
Java National ID Parser API
Upload an image for a free test! Eliminate manual data entry for national IDs. Our Java ID card parsing API provides AES-256 encrypted JSON output in <4s average latency, ensuring SOC2 compliant verification.
Technical Comparisons & Integrations
Explore platform integrations and competitive analysis
Add Container OCR to Your v0 App in 5 Minutes
Step-by-step guide to integrating the StructOCR shipping container API into a v0 by Vercel app. Build logistics and yard management tools with zero backend.
Add Driver's License OCR to Your v0 App in 5 Minutes
Step-by-step guide to integrating the StructOCR Driver's License scanner API into a v0 by Vercel app. Build car rental and mobility onboarding flows with zero backend.
Add HIN OCR to Your v0 App in 5 Minutes
Step-by-step guide to integrating the StructOCR HIN (Hull Identification Number) scanner API into a v0 by Vercel app. Build marine and boat management tools with zero backend.
Add Invoice OCR to Your v0 App in 5 Minutes
Step-by-step guide to integrating the StructOCR invoice API into a v0 by Vercel app. Build accounts payable and expense tracking tools with zero backend.
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 Passport OCR to Your v0 App in 5 Minutes
Step-by-step guide to integrating the StructOCR Passport scanner API into a v0 by Vercel app through a secure Next.js server route.
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.