ICAO Doc 9303: A Developer’s Guide to Passport Data
What ICAO Doc 9303 standardizes for passports and ID cards, from the data page layout and MRZ to the chip, and what it means for OCR integrations.
What 9303 covers
ICAO Doc 9303 defines machine readable travel documents: passport data page layout, MRZ formats, check digits, country codes, and the electronic chip used in e-passports.
Extracting It Automatically
When you read this data from photos, the Passport OCR API returns it as structured JSON, and you can apply the rules on this page as validation. Try it with the free scanner.
Where This Fits
- Visual inspection zone: The printed fields above the MRZ follow a standard order but allow national variation in labels, languages, and optional fields such as place of birth or personal numbers.
- Country codes: Issuing state and nationality use three-letter codes based on ISO 3166-1 alpha-3, with ICAO-specific codes for some organizations and special cases.
- What OCR can and cannot do: OCR reads the printed data page. Chip reading needs NFC hardware and access keys and is outside an image-based API.
Extract It with the API
Read the document from a photo and validate the returned fields.
Prerequisite: Python 3.9+, `pip install requests`, and a STRUCTOCR_API_KEY
import base64
import os
import requests
with open("passport.jpg", "rb") as image_file:
image = base64.b64encode(image_file.read()).decode("ascii")
response = requests.post(
"https://api.structocr.com/v1/passport",
headers={"x-api-key": os.environ["STRUCTOCR_API_KEY"]},
json={"img": image},
timeout=30,
)
response.raise_for_status()
data = response.json()["data"]
print("passport_number:", data.get("passport_number"))
print("surname:", data.get("surname"))
print("given_names:", data.get("given_names"))
print("date_of_expiry:", data.get("date_of_expiry"))Technical Specs
- •Endpoint: POST https://api.structocr.com/v1/passport
- •Authentication: x-api-key request header
- •Inputs: JPG, PNG, or WebP as Base64 JSON; maximum 4.5MB
- •Price: 2 credits per successful request; failed requests are not billed
- •Free trial: 200 free credits on sign-up, no credit card required
Key Features
- •Visual inspection zone: The printed fields above the MRZ follow a standard order but allow national variation in labels, languages, and optional fields such as place of birth or personal numbers.
- •Country codes: Issuing state and nationality use three-letter codes based on ISO 3166-1 alpha-3, with ICAO-specific codes for some organizations and special cases.
- •What OCR can and cannot do: OCR reads the printed data page. Chip reading needs NFC hardware and access keys and is outside an image-based API.
- •Validate after OCR: Apply these rules to API output before storing it.
Reference Summary
Key facts from this page in structured form, for quick lookup.
{
"What 9303 covers": "ICAO Doc 9303 defines machine readable travel documents: passport data page layout, MRZ formats, check digits, country codes, and the electronic chip used in e-passports..",
"Visual inspection zone": "The printed fields above the MRZ follow a standard order but allow national variation in labels, languages, and optional fields such as place of birth or personal numbers..",
"Country codes": "Issuing state and nationality use three-letter codes based on ISO 3166-1 alpha-3, with ICAO-specific codes for some organizations and special cases..",
"What OCR can and cannot do": "OCR reads the printed data page."
}Frequently Asked Questions
Is reading the MRZ enough to verify a passport?
No. Reading data and verifying authenticity are different steps; authenticity checks need security-feature or chip verification.
Which fields does StructOCR return?
Passport number, names, nationality, dates, sex, issuing details, and country-specific fields where printed.
You May Also Like
Related tutorials, platform guides, and comparisons
New Zealand Passport OCR with Node.js SDK
Use the official StructOCR Node.js SDK with TypeScript and Express to extract structured MRZ and VIZ data from New Zealand passports.
France Passport OCR with Python SDK
Use the official StructOCR Python SDK and FastAPI to extract structured MRZ and VIZ data from France passports with a server-side integration.
Mindee passport API Alternative: Passport OCR API
Mindee passport API compared with the StructOCR REST API for passport extraction: deployment, pricing model, and when each fits.
Thailand Passport OCR with Node.js SDK
Use the official StructOCR Node.js SDK with TypeScript and Express to extract structured MRZ and VIZ data from Thailand passports.
Mexico Passport OCR with Python SDK
Use the official StructOCR Python SDK and FastAPI to extract structured MRZ and VIZ data from Mexico passports with a server-side integration.
Malaysia Passport OCR with Python SDK
Use the official StructOCR Python SDK and FastAPI to extract structured MRZ and VIZ data from Malaysia passports with a server-side integration.
Java Passport OCR API
Extract passport MRZ and VIZ data in Java. Upload an image for a free test! Our API provides structured JSON output, handling glare and blur automatically.
Morocco Passport OCR with Node.js SDK
Use the official StructOCR Node.js SDK with TypeScript and Express to extract structured MRZ and VIZ data from Morocco passports.
Mexico Passport OCR with Node.js SDK
Use the official StructOCR Node.js SDK with TypeScript and Express to extract structured MRZ and VIZ data from Mexico passports.
Idaho Driver License & ID Card PDF417 API
Decode the PDF417 barcode on Idaho driver licenses and state ID cards into AAMVA JSON, with document_kind to tell licenses from ID cards.
Technical Comparisons & Integrations
Explore platform integrations and competitive analysis
Add Passport OCR to Your Lovable.dev App in 5 Minutes
Step-by-step guide to integrating the StructOCR Passport scanner API into a Lovable.dev app through a secure server-side function for travel and KYC flows.
Add Passport OCR to Your Replit App in 5 Minutes
Step-by-step guide to integrating the StructOCR Passport scanner API into a Replit application. Build travel, hospitality, and global KYC flows using Replit Agent and Secrets.
Tesseract & PassportEye vs. StructOCR Passport API
A technical evaluation for developers deciding between open-source MRZ scanners and a dedicated cloud-based Passport OCR API.
Add Passport OCR to Your v0 App in 5 Minutes
Step-by-step guide to integrating the StructOCR Passport scanner API into a v0 by Vercel app through a secure Next.js server route.
AWS Textract vs. StructOCR API for Indian Passport Back Page Extraction
Why generic OCR fails at parsing the back page of Indian passports, and how a dedicated KYC API instantly extracts structured addresses, PIN codes, and family details.
AWS Textract & Google Vision vs. StructOCR Passport API
How AWS Textract AnalyzeID, Google Cloud Vision OCR, and the StructOCR Passport API differ for passport data, quoting each vendor’s own documentation.
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.