ISO 8601 Passport Date Parsing API
Stop wrestling with complex regex and localization bugs. Instantly extract and normalize passport birth dates, issue dates, and expiry dates into strict YYYY-MM-DD format.
200 free credits = 100 Passport scans, no credit card. Then from $5 for 500 credits, pay as you go. See pricing

The Nightmare of Global Date Formats
Extracting dates from international passports is notoriously difficult. Different countries use varying visual formats (e.g., DD MMM YY, DD/MM/YYYY) and localized month abbreviations (like 'FEV' for February or 'MAI' for May). Relying on heavy mobile SDKs or writing custom regex to parse these locally often leads to timezone bugs, application crashes, and rejected KYC applications. For a broader look at frictionless onboarding architectures, explore our travel identity verification solutions.
StructOCR: Deterministic Date Normalization
Powered by our core Passport OCR engine, StructOCR completely eliminates date parsing errors. We provide a pure, API-first architecture—meaning zero SDK bloat. Whether you upload a direct file or stream a Base64 string to our Cloudflare edge nodes, the engine intelligently parses both the MRZ and VIZ, automatically normalizing all dates into the universally accepted ISO 8601 (`YYYY-MM-DD`) standard before returning the JSON.
Live Demo: Passport scanner
No registration required. Upload a file to test the extraction.
Drop files here or click to browse
JPG · PNG · PDF · TIFF · up to 500 files · max 4.5 MB each
No document handy?
Core Developer Applications
Age Verification & KYC
Calculate a user's exact age deterministically for Crypto, Gaming, or FinTech onboarding without worrying about epoch conversion errors. We support Crypto/USDT payments for global Web3 developers. View our straightforward API pricing.
Airlines & APIS Validation
Instantly verify if a passport's expiry date meets the strict "6-month validity" rule required for international flight boarding.
Visa & Immigration Software
Autofill visa application forms accurately by converting complex visual date strings into standardized database fields.
Hotel Property Management (PMS)
Ensure all guest records maintain perfect database hygiene by standardizing date of birth and expiry entries across all properties.
Technical Specs
- Strict ISO 8601 Normalization: Guarantees all extracted dates (`date_of_birth`, `date_of_issue`, `date_of_expiry`) are returned perfectly as `YYYY-MM-DD`.
- API-First Architecture: 100% RESTful integration eliminates the need for OS-specific SDKs and version conflicts.
- Edge Processing: Sub-1.2s latency globally, powered by Cloudflare's distributed edge network.
- Base64 & File Native: Stream image data securely without exposing PII on public cloud storage.
Key Features
- MRZ Checksum Validation: Automatically verifies the mathematical check digits tied to date fields in the MRZ to ensure 100% optical accuracy.
- VIZ Language Translation: Intelligently maps localized month abbreviations (e.g., 'AOU', 'OCT', 'DEZ') found in the visual zone into standard numerical formats.
- 24-Hour Data Retention: Images and results are deleted within 24 hours, which helps with GDPR and DPDP obligations.
Integration & AI Prompts
Integrate directly using standard HTTP requests. Avoid SDK compatibility issues by passing Base64 directly to the API. For complete payload schemas, consult our Passport OCR Developer Documentation.
import requests
import base64
from datetime import datetime
# 📚 Developer Docs: https://structocr.com/developers/passport-ocr
# Note: StructOCR is strictly API-first. Send Base64 natively
# without installing any complex date-parsing SDKs.
with open("traveler_passport.jpg", "rb") as image_file:
base64_image = base64.b64encode(image_file.read()).decode('utf-8')
url = "https://api.structocr.com/v1/passport"
headers = {
"x-api-key": "YOUR_API_KEY",
"Content-Type": "application/json"
}
payload = {
"img": base64_image
}
try:
# Processed securely at the Cloudflare edge
response = requests.post(url, headers=headers, json=payload)
result = response.json()
if result.get('success'):
print("✅ ISO 8601 Extraction Complete!\n")
core = result['data']
dob = core.get('date_of_birth')
expiry = core.get('date_of_expiry')
print(f"Holder: {core.get('given_names')} {core.get('surname')}")
print(f"DOB: {dob} (Ready for DB insertion)")
print(f"Expiry: {expiry}")
# Easy deterministic date logic in Python
if datetime.strptime(expiry, "%Y-%m-%d") > datetime.now():
print("Status: 🟢 Document is currently valid.")
else:
print("Status: 🔴 Document has expired.")
else:
print(f"❌ Extraction Failed")
except Exception as e:
print(f"Error: {e}")Standardized JSON Output
Receive deterministic, cleanly structured MRZ and VIZ data with perfectly formatted date fields.
{
"success": true,
"data": {
"type": "passport",
"country_code": "IND",
"nationality": "INDIAN",
"passport_number": "Z1234567",
"surname": "SHARMA",
"given_names": "RAHUL",
"sex": "M",
"date_of_birth": "1988-07-22",
"place_of_birth": "NEW DELHI",
"date_of_issue": "2021-04-10",
"date_of_expiry": "2031-04-09",
"issuing_authority": "MINISTRY OF EXTERNAL AFFAIRS",
"country_specific": {
"last_page": {
"father_name": "AMIT SHARMA",
"mother_name": "SITA SHARMA",
"spouse_name": "PRIYA SHARMA",
"address": "FLAT 4B, GREENWOOD APARTMENTS, NEW DELHI PIN: 110001, INDIA",
"old_passport_number": "P7654321",
"old_passport_issue_date": "2010-01-05",
"old_passport_issue_place": "DELHI",
"file_no": "DL1076071103622",
"ecr_status": null
}
}
}
}Frequently Asked Questions
How does the API handle 2-digit years found in the MRZ?
The MRZ format uses a 2-digit format for years (e.g., '88' for 1988 or '24' for 2024). Our engine uses intelligent pivot-year logic based on the specific field (DOB vs Expiry) to accurately infer the century and normalize the output to a full 4-digit year (YYYY).
Does the API handle non-English month abbreviations in the visual zone?
Yes. When falling back to the Visual Inspection Zone (VIZ) for damaged passports, our NLP engine recognizes localized month abbreviations (e.g., French, Spanish, German) and accurately converts them into the standardized ISO 8601 month format.
Do I need to install an SDK to parse these dates?
No, StructOCR is strictly API-first. You simply send us a Base64 string or file upload via a standard HTTP POST request. Our backend handles all the heavy lifting and returns the cleaned ISO 8601 strings directly in the JSON response.
Explore More Travel & KYC Solutions
Passport VIZ Extraction API for Airlines
Automate airline check-ins by extracting both MRZ and VIZ passport data instantly via a pure REST API. Upload an image to test our free live demo today.
Proof of Address (PoA) OCR India
Automate PoA verification. Extract and validate permanent residential addresses from Indian passport back pages. API-first integration with 24-hour data retention.
Remote Hiring Identity OCR API
Automate global remote hiring with our identity OCR API; images are deleted within 24 hours. Extract passport data securely without SDKs. Upload an image to test our free live demo.
REST API for Global Passport MRZ
Extract global passport MRZ data instantly via our fast REST API. No SDK required. Upload an image to test our live demo for free.
Right to Work Passport Verification API
Automate global HR compliance. Extract passport data instantly with our OCR API; images are deleted within 24 hours. No SDK required. Upload an image to test our free live demo.
Passport OCR for Neo-Banks: 24-Hour Retention, SOC 2 Type II
Passport OCR API for neo-bank onboarding: MRZ and VIZ fields as JSON, SOC 2 Type II, and images deleted within 24 hours. No SDK needed. Upload an image to test free.
Automated Hotel Check-In Passport Scanner API
Streamline hotel check-ins with our automated passport scanner API. Extract global guest data instantly without SDKs. Upload an image to test our free live demo.
Crypto KYC Passport API (No SDK)
Passport OCR API for Web3 and Crypto KYC, with 24-hour data retention. Extract global MRZ and VIZ data instantly without SDK bloat. Upload an image to test our free live demo.
DPDP Compliant Indian Passport OCR API
DPDP-friendly OCR API for Indian passports, with 24-hour data retention. Securely extract back-page PII (Address, Parents' Names) for KYC workflows. File, Base64, and URL supported.
GDPR Compliant Passport OCR API
Extract passport data securely with our OCR API; images are deleted within 24 hours. Upload an image to test our free live demo.
Technical Comparisons & Integrations
Explore platform integrations and competitive analysis
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.
Add Passport OCR to Your Bolt.new App in 5 Minutes
Step-by-step guide to integrating the StructOCR Passport scanner API into a Bolt.new app. Build travel, hospitality, and global KYC flows right in your browser.
Add Passport OCR using Cursor in 5 Minutes
Step-by-step guide to integrating the StructOCR Passport scanner API using the Cursor AI code editor. Build travel, hospitality, and global KYC flows rapidly.
Extracting ECR Status & File Numbers: Generic OCR vs. StructOCR Indian Passport API
Learn why generic text extractors fail to capture critical Indian KYC fields like ECR status and File Numbers, and how a specialized API structures this data automatically.
Heavy KYC SDKs vs. StructOCR Passport API for Mobile Apps
Discover why modern app developers are abandoning bulky on-device OCR SDKs in favor of lightweight, edge-deployed Passport APIs.
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.
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.