Colombia Cédula OCR Python SDK
Instantly extract data from Colombian Identity Cards (Cédula de Ciudadanía) using our native Python library.
Parsing Cédula de Ciudadanía Challenges
The Colombian Cédula de Ciudadanía poses unique OCR challenges. Accurately extracting the Número Único de Identificación Personal (NUIP), parsing complex Spanish multi-line structures, and handling holographic overlays require highly specialized computer vision models to ensure accurate data capture.
Why StructOCR for Colombia
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 NUIP mapped directly to the personal number field, to fully automate your verification workflows.
Common Use Cases in Colombia
- Digital Onboarding: Verify users for Fintech apps, digital wallets, and banking services across Colombia.
- 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_colombia_id():
# Note: Supports JPG, PNG, WebP (Max 4.5MB)
# Target: Cédula de Ciudadanía
image_path = "colombia_national_id.jpg"
try:
print(f"Scanning {image_path}...")
# The SDK handles file upload and API communication
# It automatically detects that this is a Colombian 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("✅ Colombia Extraction Successful!")
# Basic Identity
print(f"Region: {data.get('country_code')}")
print(f"Name: {data.get('given_names')} {data.get('surname')}")
# Critical Field: NUIP (Personal Identification Number)
print(f"NUIP: {data.get('personal_number')}")
# Demographics
print(f"DOB: {data.get('date_of_birth')} ({data.get('sex')})")
print(f"Birthplace: {data.get('place_of_birth')}")
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_colombia_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.
- •NUIP Extraction: Automatically extracts and validates the Número Único de Identificación Personal (NUIP).
- •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": "COL",
"nationality": "COLOMBIANA",
"document_number": "1098765432",
"card_series": "",
"personal_number": "1098765432",
"surname": "GARCÍA PÉREZ",
"given_names": "CARLOS ARTURO",
"sex": "M",
"date_of_birth": "1992-08-15",
"place_of_birth": "BOGOTÁ, D.C.",
"address": null,
"date_of_issue": "2010-08-20",
"date_of_expiry": null,
"issuing_authority": "REGISTRADURÍA NACIONAL DEL ESTADO CIVIL",
"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
Ukraine Passport OCR with Python SDK
Use the official StructOCR Python SDK and FastAPI to extract structured MRZ and VIZ data from Ukraine passports with a server-side integration.
Morocco Passport OCR with Python SDK
Use the official StructOCR Python SDK and FastAPI to extract structured MRZ and VIZ data from Morocco passports with a server-side integration.
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.
Ukraine National ID OCR Python SDK
Python Tutorial: Automate KYC in Ukraine. Extract data from National ID using StructOCR Python SDK. Supports native text and MRZ extraction.
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.
Sweden Passport OCR with Python SDK
Use the official StructOCR Python SDK and FastAPI to extract structured MRZ and VIZ data from Sweden passports with a server-side integration.
Brazil CIN OCR Python SDK: Extract CPF & MRZ
Python Tutorial: Automate KYC in Brazil. Extract Portuguese text, CPF numbers, and validate TD1 MRZ from the new CIN using the StructOCR Python SDK.
Bangladesh Smart NID OCR Python SDK
Python Tutorial: Automate KYC in Bangladesh. Extract complex Bengali text and decode 2D barcodes from Smart NIDs using StructOCR Python SDK.
Belgium eID OCR Python SDK
Python Tutorial: Automate KYC in Belgium. Extract data from Electronic Identity Card (eID) using StructOCR Python SDK. Supports native text, National Register Number, and MRZ extraction.
Bulgaria Lichna karta (Лична карта) OCR Python SDK
Python Tutorial: Automate KYC in Bulgaria. Extract Cyrillic/Latin text, EGN (ЕГН), and validate TD1 MRZ from Lichna karta using StructOCR Python SDK.
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 Passport OCR to Your Bolt.new App in 5 Minutes
Step-by-step guide to integrating the StructOCR Passport scanner API into a Bolt.new app. Build travel, hospitality, and global KYC flows right in your browser.
Add Receipt OCR to Your Bolt.new App in 5 Minutes
Step-by-step guide to integrating the StructOCR receipt API into a Bolt.new app. Build expense tracking and receipt scanning tools right in your browser.
Add VIN OCR to Your Bolt.new App in 5 Minutes
Step-by-step guide to integrating the StructOCR VIN scanner API into a Bolt.new app. Build automotive and fleet tools right in your browser.
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.
Add Driver's License OCR using Cursor in 5 Minutes
Step-by-step guide to integrating the StructOCR Driver's License scanner API using the Cursor AI code editor. Build car rental and mobility onboarding flows 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.