Indian KYC: Single-Page MRZ SDKs vs. Dual-Page API
Reading the front page MRZ isn't enough. Discover how to automate full Indian passport extraction—including the unstructured back page address.
Executive Summary for Developers
Standard open-source and legacy mobile SDKs are designed only to read the Machine Readable Zone (MRZ) on the front page of a passport. However, Indian KYC compliance strictly requires the back page for proof of address and family details. StructOCR provides a comprehensive REST API deployed on Cloudflare that eliminates the need for limited local SDKs. By passing Base64 encoded images of both the front and back pages, the API instantly cross-references the data and returns a single, unified JSON payload containing the MRZ details, back page address, and PIN code.
KYC Workflow & Extraction Matrix
| Feature / Workflow | Legacy MRZ SDK (On-Device) | StructOCR Indian KYC API |
|---|---|---|
| Page Coverage | Front page only (Fails on the back page due to lack of MRZ) | Processes both front (Identity) and back (Address & Family) natively |
| Data Merging | Requires custom backend logic to link front and back page images manually | Returns a unified JSON object with `country_specific.last_page` automatically nested |
| App Architecture | Bloats the mobile app with heavy machine learning models | Zero footprint. Sends Base64 strings directly to the edge network |
| Cross-Verification | None | Automatically cross-references file numbers and old passport IDs between pages |
The 'Front Page Only' Trap in Indian KYC
Many developers attempt to build an Indian user onboarding flow using standard MRZ scanning SDKs. These SDKs work perfectly for reading the two lines of code at the bottom of the front page. However, the Indian passport is unique: the traveler's address, father's name, spouse's name, and old passport details are printed on the back page, which has no MRZ. When developers realize the SDK cannot read the back page, they are forced to either build a brittle secondary OCR pipeline just for the address, or fall back to expensive manual human verification. This disjointed workflow destroys the user experience and increases drop-off rates.
A Unified, API-First Verification Flow
StructOCR approaches Indian passport extraction holistically. Instead of wrestling with limited client-side SDKs, developers can capture both pages in the app frontend and send them as Base64 payloads directly to the StructOCR API. Running on a low-latency Cloudflare infrastructure, our specialized AI processes both sides simultaneously. It decodes the complex address layouts on the back page, validates the MRZ on the front page, and merges everything into a clean, hierarchical JSON response. You get full KYC compliance data in one seamless network request, ready to be inserted into your database.
Implementation: The Unified Indian Passport JSON
Notice how the API returns data from the front page (MRZ) and neatly nests the unstructured back page data within the same object.
{
"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",
"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",
"file_no": "DL1076071103622",
"old_passport_number": "P7654321"
}
}
}
}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