Passport MRZ OCR vs NFC Chip Reading

When to read a passport from a photo of the data page and when you need the e-passport chip, with the trade-offs for onboarding flows.

Photo-based OCR

Reads the data page from an image. It works on any device that can upload a photo, including desktops and kiosks, and returns the printed fields.

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

  • NFC chip reading: Reads the signed data stored in the e-passport chip. It needs an NFC-capable phone or reader and the MRZ-derived access key, and it allows cryptographic checks of the data.
  • Choosing: Use OCR when you need the data quickly with broad device support. Add chip reading when regulations or fraud risk require cryptographic proof that the data is genuine.
Need more testing? Create a free account to get 200 free credits (equals 100 Passport scans).

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

PYTHON EXAMPLE
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

  • •NFC chip reading: Reads the signed data stored in the e-passport chip. It needs an NFC-capable phone or reader and the MRZ-derived access key, and it allows cryptographic checks of the data.
  • •Choosing: Use OCR when you need the data quickly with broad device support. Add chip reading when regulations or fraud risk require cryptographic proof that the data is genuine.
  • •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.

{
  "Photo-based OCR": "Reads the data page from an image.",
  "NFC chip reading": "Reads the signed data stored in the e-passport chip.",
  "Choosing": "Use OCR when you need the data quickly with broad device support."
}

Frequently Asked Questions

Does StructOCR read passport chips?

No. StructOCR reads images of the data page. Chip reading requires on-device NFC.

Can OCR output feed a chip read?

Yes. The passport number, date of birth, and expiry date from OCR are the inputs used to derive the chip access key.

You May Also Like

Related tutorials, platform guides, and comparisons

Country Tutorial

Belgium Passport OCR with Python SDK

Use the official StructOCR Python SDK and FastAPI to extract structured MRZ and VIZ data from Belgium passports with a server-side integration.

Python · Passport
Country Tutorial

Serbia Passport OCR with Python SDK

Use the official StructOCR Python SDK and FastAPI to extract structured MRZ and VIZ data from Serbia passports with a server-side integration.

Python · Passport
Country Tutorial

Lithuania Passport OCR: Extract Fields with Python

Extract visible fields from Lithuania passport images into JSON. Map identifiers, names and dates, with a review workflow for incomplete results.

Python · Passport
Country Tutorial

Turkey 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 Turkey passports.

Node.js · Passport
Country Tutorial

Algeria Passport OCR with Python SDK

Use the official StructOCR Python SDK and FastAPI to extract structured MRZ and VIZ data from Algeria passports with a server-side integration.

Python · Passport
Country Tutorial

Uzbekistan 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 Uzbekistan passports.

Node.js · Passport
Country Tutorial

US Passport OCR with Python SDK

Use the official StructOCR Python SDK and FastAPI to extract structured MRZ and VIZ data from US passports with a server-side integration.

Python · Passport
Country Tutorial

Uzbekistan Passport OCR with Python SDK

Use the official StructOCR Python SDK and FastAPI to extract structured MRZ and VIZ data from Uzbekistan passports with a server-side integration.

Python · Passport
Country Tutorial

US 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 US passports.

Node.js · Passport
Tutorial

Passport OCR API Pricing and Cost per Scan

What passport OCR costs with StructOCR: 2 credits per successful scan, prepaid credits that never expire, and no charge for failed requests.

Passport

Technical Comparisons & Integrations

Explore platform integrations and competitive analysis

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.

Instant Access Cancel Anytime No Credit Card