Honduras DNI OCR API with Python
Extract the DNI number, names, and dates from the Honduras Documento Nacional de Identificación (DNI) with the StructOCR Python SDK and a server-side integration.
Working with the Documento Nacional de Identificación (DNI)
The Honduran DNI uses a 13-digit number printed in groups of four, four, and five digits. Re-keying these values is slow, and generic OCR still leaves your team to map each text fragment to the right field.
Structured Extraction for Your Backend
The National ID OCR API returns the DNI number, names, dates, and address when they are printed on the submitted side of the card. Test it with the free ID card scanner.
Common Integration Scenarios
- Customer onboarding: Pre-fill identity fields from the Documento Nacional de Identificación (DNI) before the customer confirms them.
- Account operations: Reduce manual transcription when staff enter identity data.
- Document review: Store normalized output next to your own review decision.
Honduras DNI OCR API with Python
The official Python SDK reads a local file and calls /v1/national-id from your backend.
Prerequisite: `pip install structocr`; set the server-side `STRUCTOCR_API_KEY` environment variable.
Prefer another stack? Open the Node.js SDK + Express integration.
import os
from structocr import StructOCR
client = StructOCR(os.environ["STRUCTOCR_API_KEY"])
result = client.scan_national_id("id-card.jpg")
if result.get("success"):
data = result["data"]
print(data.get("document_number"))
print(data.get("given_names"), data.get("surname"))
else:
print(result.get("error"))Technical Specs
- •Endpoint: POST /v1/national-id
- •Input: Base64-encoded JPG, PNG, WebP, or PDF in JSON (Max 4.5MB)
- •Authentication: Server-side x-api-key header handled by the SDK
- •Cost: 2 credits per successful scan; failed requests are not billed
- •Output: Structured JSON
Key Features
- •Local document: Handles the Documento Nacional de Identificación (DNI) as a national identity document.
- •Identifier output: Returns the DNI number when visible.
- •Normalized names and dates: Consistent JSON keys across countries.
- •Server integration: The API key stays on your backend.
JSON Response Example
Fictional values showing the normalized shape for a readable Documento Nacional de Identificación (DNI); unavailable fields are null.
{
"success": true,
"data": {
"type": "national_id",
"country_code": "HND",
"document_number": "0801-1990-00000",
"personal_number": null,
"surname": "DOE",
"given_names": "ALEX",
"sex": null,
"date_of_birth": "1990-01-01",
"place_of_birth": null,
"date_of_issue": null,
"date_of_expiry": null,
"issuing_authority": null,
"address": "TEGUCIGALPA",
"additional_fields": {}
}
}Frequently Asked Questions
Does the API validate the DNI number?
It extracts the number as printed. Database checks and authenticity verification require official channels or your own review.
Which inputs are supported?
JSON with a Base64-encoded JPG, PNG, WebP, or PDF up to 4.5MB; the SDK handles encoding.
Is there a version for the other SDK language?
Yes. A paired Node.js version of this tutorial covers the same document.
You May Also Like
Related tutorials, platform guides, and comparisons
Honduras DNI OCR API with Node.js
Extract the DNI number, names, and dates from the Honduras Documento Nacional de Identificación (DNI) with the StructOCR Node.js SDK and a server-side integration.
Uruguay identity card OCR: Extract Fields with Python
Extract visible fields from Uruguay identity card images into JSON. Map identifiers, names and dates, with a review workflow for incomplete results.
Python National ID OCR API
High-accuracy National ID OCR for Python. Upload an image for a free test! Get structured JSON output via our dedicated Python SDK. Automate KYC and data entry.
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.
Go National ID OCR API
Upload an image for a free test! High-accuracy National ID data extraction for Go developers. Get structured JSON output via a simple API call, replacing unreliable open-source tools.
PHP National ID OCR API
High-accuracy National ID OCR for PHP. Upload an image for a free test! Get structured JSON output from ID card images. A superior alternative to Tesseract. No complex PHP SDK needed.
Hong Kong HKID OCR API with Node.js
Extract the HKID number, names, and dates from the Hong Kong Identity Card (HKID) with the StructOCR Node.js SDK and a server-side integration.
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.
C# National ID OCR API
Upload an image for a free test! Eliminate manual data entry for national IDs. Integrate hybrid VIZ + MRZ validation into your .NET apps. This C# OCR API delivers structured JSON in seconds, with SOC 2 Type II and AES-256 encryption.
Hong Kong Driver License OCR API with Node.js
Extract licence number, names, dates, and vehicle class from the Hong Kong SAR Hong Kong driving licence with the StructOCR Node.js 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 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 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.
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.