National ID
OCR API

Automate identity verification across 200+ countries. Powered by a Hybrid Vision AI & MRZ Validation engine, we extract flawless data from complex formats in Africa, the Middle East, Europe, LATAM, and APAC.

POST /v1/national-id
curl -X POST 
https://api.structocr.com/v1/national-id \
-H "x-api-key: Bearer sk_live_..." \
-d '{"img": "data:image/jpeg;base64,/9j/4A..."}'
RESPONSE 200 OK
{
  "success": true,
  "data": {
    "type": "national_id",
    "country_code": "ROU",
    "personal_number": "1930101450032",
    "card_series": "RX",
    "document_number": "654321",
    "surname": "POPESCU",
    "given_names": "ANDREI",
    "place_of_birth": "Jud. CS Mun. Resita",
    // ... smart extracted fields
  }
}

Why Choose Our National ID API

We don't just read text; we understand the structure of government documents, tuned for global variances from Bucharest to Bangkok.

Smart Field Logic

Advanced heuristic rules for complex IDs, automatically parsing composite fields like Place of Birth and issuing authorities.

Multi-line Address

Intelligently concatenates multi-line addresses (Region, City, Street) into a single, clean string for database storage.

Global Coverage

Optimized for diverse layouts across North America, Europe, LATAM, and APAC, supporting 200+ territories.

GDPR Compliant

Strict privacy design. Images are processed in-memory and purged immediately. Fully compliant with EU data protection laws.

Personal Number Parsing

Accurate extraction of unique identifiers (CNP, SSN, NRIC, etc.) crucial for banking and KYC duplicate checks.

Structured JSON

Transforms chaotic ID card layouts into standardized JSON with separate fields for Series, Number, and Dates.

Issuing Authority

Extracts the exact government body that issued the document, vital for fraud validation workflows.

Hybrid VIZ + MRZ AI

Combines Vision AI for unstructured visual zones with strict check-digit validation for Machine Readable Zones (MRZ).

Flowchart demonstrating National ID upload, region-specific AI analysis, and structured JSON data extraction

How it works

From raw scan to verified data in seconds.

01

Upload Document

Send the National ID image via API. We accept standard formats (JPG, PNG) up to 4.5MB.

02

Hybrid AI Analysis

Our engine detects the country, parses Visual Zone (VIZ) data, and cryptographically validates the Machine Readable Zone (MRZ) if present.

03

Receive Clean Data

Get a JSON response with separated fields for Series, Number, Personal ID, and full address strings.

response.json
{
  "success": true,
  "data": {
    "type": "national_id",
    "country_code": "ROU",
    "card_series": "XR",
    "document_number": "654321",
    "personal_number": "1930101450032",
    "surname": "POPESCU",
    "given_names": "ANDREI",
    "place_of_birth": "Jud. CS Mun. Resita",
    "address": "Mun. BUCURESTI Str. Libertatii Nr. 4",
    "issuing_authority": "SPCLEP S1",
    "date_of_birth": "1993-01-01",
    "additional_fields": {
      "phone_number": "null",
      "tramite_number": "null",
      "ejemplar": "null",
      "mrz_line_1": "IDROUPOPESCU<<ANDREI<<<<<<<<<<<<<<<",
      "mrz_line_2": "9301015M3005108ROU19301014500322"
      "mrz_line_3": "null"
    }
  }
}
Data Output

Deep Data Extraction

Our API goes beyond basic OCR. It extracts raw MRZ data while simultaneously understanding unstructured Visual Zone (VIZ) fields like Place of Birth and Multi-line Addresses.

Country Code

Personal Number (CNP/CPF/SSN)

Card Series

Document Number

Place of Birth

Full Address

Issuing Authority

Surname

Given Names

Sex

Date of Birth

Date of Expiry

Phone Number

Trámite Number (Argentina)

Card Edition (Ejemplar)

Raw MRZ Lines (TD1/TD2/TD3)

...and more meta data

Live Demo: ID card scanner

No registration required. Upload a file to test the extraction.

1
Upload
2
Results

Drop files here or click to browse

JPG · PNG · WebP  ·  up to 500 files · max 4.5 MB each

No files selected

Trusted for Global Compliance

Engineered for companies that need precise data from complex government IDs worldwide.

We expanded to Southeast Asia and Europe in the same quarter. StructOCR handled the ID variations perfectly without us needing custom models.

Carlos Mendez
VP Engineering, GlobalPay
FinTech

The accuracy on European ID cards is unmatched. It correctly identifies multi-line addresses and issuing authorities every time.

Sarah Jenkins
Compliance Officer, EuroTrust
Identity Verification

Privacy was our main concern. Knowing that StructOCR is GDPR compliant and purges data immediately sealed the deal for us.

Liam O'Connor
CTO, SecureOnboard
SaaS

Built for Developers,
Optimized for Compliance

We handle the complexity of global identity documents so you can focus on building your application.

Fast Integration

Plug-and-play API design. Start testing with curl in seconds and integrate into your backend in minutes.

High Reliability

Built on a scalable serverless architecture ensuring 99.9% uptime and enterprise-grade performance.

Custom Extraction Rules

Benefit from our pre-tuned logic for countries with complex ID layouts across multiple continents.

Clear Documentation

Comprehensive guides and examples for every supported field, ensuring you never have to guess the output format.

Precise Data Extraction and Seamless Integration with AI-powered OCR API.

Empower your solutions with automated data extraction by integrating best-in class StructOCR via API seamlessly.

No credit card required • Full API access included

Frequently Asked Questions