Global Passport
OCR API

Extract MRZ and visual inspection zone (VIZ) fields from passport images and PDFs. Send Base64-encoded input through one JSON API and receive normalized passport data for KYC, travel, and onboarding workflows.

100 passport scans • No credit card required
POST /v1/passport
curl -X POST 
https://api.structocr.com/v1/passport \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
-d '{"img": "data:image/jpeg;base64,/9j/4A..."}'
RESPONSE 200 OK
{
  "success": true,
  "data": {
    "type": "passport",
    "country_code": "USA",
    "nationality": "UNITED STATES",
    "passport_number": "900000001",
    // ... more fields
  }
}

Live Demo: Passport 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
Need more testing? Create a free account to get 200 free credits (equals 100 passport scans)

Passport Data Extraction

Passport Data Extraction API for MRZ and VIZ Fields

StructOCR processes passport bio-data pages by combining Machine Readable Zone (MRZ) extraction with Visual Inspection Zone (VIZ) reading. Send a Base64-encoded image or PDF and receive structured passport data through a single JSON API response.

MRZ Field Extraction

Uses the machine-readable zone as the primary source for passport number, names, nationality, sex, date of birth, date of expiry, and issuing country.

VIZ Field Extraction

Reads the visual inspection zone for fields that may not appear in the MRZ, including place of birth, date of issue, and issuing authority.

Normalized JSON Output

Returns consistent field names and ISO-formatted dates so passport data can move directly into KYC, travel, or onboarding workflows.

Our OCR API Key Features

FinTech & Travel Ready

Built as a complete identity verification software solution for FinTech KYC and travel document automation.

Fast API Processing

Submit passport images or PDFs and receive structured JSON through a synchronous API workflow designed for production integrations.

Global Passport Coverage

Process ICAO-compliant passports across international KYC, travel, and customer onboarding workflows.

Zero-Data Retention

Strict privacy compliance; images are purged immediately after processing with no server-side storage.

Advanced Pre-processing

Automatically handles glare, tilt, and perspective correction to ensure clean data extraction.

Structured JSON

Transforms raw document images into clean, developer-friendly JSON output for immediate use.

MRZ + VIZ Extraction

Combines MRZ parsing with visual-zone extraction for passport fields that are not available in the machine-readable zone.

Scalable Infrastructure

Serverless architecture that scales horizontally with your API traffic requirements.

Flowchart demonstrating the Passport OCR process: from image upload to MRZ and VIZ text extraction, outputting structured JSON for KYC

How it works

Integrate professional passport extraction into your app in minutes.

01

Base64 JSON Request

Send a Base64-encoded JPG, PNG, WebP, or PDF in an application/json request and authenticate with the x-api-key header.

02

AI Analysis

Our proprietary models handle glare, tilt, and low-light conditions to extract raw data fields automatically.

03

Structured Output

Receive standardized JSON containing all extracted identity fields ready for your production database.

response.json
{
  "success": true,
  "data": {
    "type": "P",
    "country_code": "USA",
    "nationality": "UNITED STATES",
    "passport_number": "900000001",
    "surname": "DOE",
    "given_names": "JOHN",
    "sex": "M",
    "date_of_birth": "1990-01-01",
    "date_of_expiry": "2030-01-01",
    "date_of_issue": "2020-01-01",
    "place_of_issue": "PASSPORT AGENCY"
  }
}
Data Output

Standard Data Fields You Can Extract

Our API automatically recognizes over 12+ specific data points from passports worldwide. The output is provided via structured JSON by default.

Document Type

Country Code

Nationality

Passport Number

Surname

Given Names

Sex

Date of Birth

Date of Expiry

Date of Issue

Place of Issue

...and more meta data

Developer SDKs

Official Passport OCR SDKs for Python and Node.js

Use the official StructOCR SDKs to handle file encoding, API authentication, and passport OCR requests while keeping your API key on the server.

Trusted by Industry Leaders

Developers and CTOs choose StructOCR for mission-critical identity verification

StructOCR's Passport API reduced our onboarding time by 80%. The accuracy is phenomenal, and integration took less than a day.

Sarah Chen
CTO, TravelTech Solutions
Travel & Hospitality

We process 50,000+ passports monthly with zero manual verification. StructOCR's consistency across different document conditions is unmatched.

Michael Rodriguez
Lead Engineer, GlobalVerify
Identity Verification

The passport extraction is flawless. We've eliminated manual data entry errors completely, which was a game-changer for our compliance team.

Priya Sharma
Head of Engineering, FinanceFlow
FinTech

Why Developers Prefer Our
OCR API for Passport Extraction

We prioritize developer experience without compromising on power, providing the tools needed to embed intelligent document recognition into any stack.

Accelerate Deployment

Streamline your workflow with a plug-and-play setup designed to slash weeks off your production timeline.

Production API Reliability

Integrate with documented HTTP status codes, predictable JSON responses, and clear error handling for production workflows.

Precision-First Extraction

Leverage industry-leading OCR precision to minimize manual reviews and ensure high-fidelity data capture.

Engineer-Centric Docs

Access deep technical guides and APIs crafted by our core team to make integration a seamless experience.

Ready to Build with StructOCR?

Get your API key in under a minute. New users receive 200 free credits to test Passport, VIN, Lincense Plate, Container, Receipt, HIN, Driver License, ID Card, Vehicle Registration, ATM Cassette and Invoice OCR APIs.

✓ No credit card required · ✓ Instant API key · ✓ Full API access

Frequently Asked Questions