El Salvador DUI OCR API with Node.js
Extract the DUI number, names, and dates from the El Salvador Documento Único de Identidad (DUI) with the StructOCR Node.js SDK and a server-side integration.
Working with the Documento Único de Identidad (DUI)
The DUI number has eight digits followed by a check digit and is also used as a tax number. 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 DUI 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 Único de Identidad (DUI) 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.
El Salvador DUI OCR API with Node.js
The official Node.js SDK reads a local file and calls /v1/national-id from your backend.
Prerequisite: `npm install structocr`; set the server-side `STRUCTOCR_API_KEY` environment variable.
Prefer another stack? Open the Python SDK + FastAPI integration.
const StructOCR = require("structocr");
const client = new StructOCR(process.env.STRUCTOCR_API_KEY);
async function main() {
const result = await client.scanNationalId("id-card.jpg");
if (result.success) {
const data = result.data;
console.log(data.document_number);
console.log(data.given_names, data.surname);
} else {
console.error(result.error);
}
}
main().catch(console.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 Único de Identidad (DUI) as a national identity document.
- •Identifier output: Returns the DUI 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 Único de Identidad (DUI); unavailable fields are null.
{
"success": true,
"data": {
"type": "national_id",
"country_code": "SLV",
"document_number": "00000000-0",
"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": "SAN SALVADOR",
"additional_fields": {}
}
}Frequently Asked Questions
Does the API validate the DUI 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 Python version of this tutorial covers the same document.
You May Also Like
Related tutorials, platform guides, and comparisons
El Salvador DUI OCR API with Python
Extract the DUI number, names, and dates from the El Salvador Documento Único de Identidad (DUI) with the StructOCR Python SDK and a server-side integration.
Dominican Republic Cédula OCR API with Node.js
Extract the cédula number, names, and dates from the Dominican Republic Cédula de Identidad y Electoral with the StructOCR Node.js SDK and a server-side integration.
Zambia NRC OCR API with Node.js
Extract the NRC number, names, and dates from the Zambia National Registration Card (NRC) with the StructOCR Node.js SDK and a server-side integration.
India Aadhaar OCR with Node.js SDK
Extract Aadhaar number, names, dates and other visible fields from Aadhaar card with the StructOCR Node.js SDK and Express.
Philippines PhilID OCR with Node.js SDK
Extract PhilSys Card Number, names, dates and other visible fields from Philippine Identification Card (PhilID) with the StructOCR Node.js SDK and Express.
Venezuela Cédula OCR API with Node.js
Extract the cédula number, names, and dates from the Venezuela Cédula de Identidad with the StructOCR Node.js SDK and a server-side integration.
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.
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.
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.
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 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 Driver's License OCR to Your Bolt.new App in 5 Minutes
Step-by-step guide to integrating the StructOCR Driver's License scanner API into a Bolt.new app. Build car rental and mobility onboarding flows 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.