Skip to main content

Passport OCR

Extract passport data page fields, including the MRZ lines.

Base URL​

https://use.api.co.id

Send a passport data page image to POST /ocr/passport-extract as multipart/form-data (field file) with the x-api-co-id header. The response contains the printed passport fields plus the raw MRZ lines.

File format & limits​

RequirementValue
FormatsJPG, JPEG, PNG
Maximum size5 MB
ContentPassport data page (photo page)

Extracted fields​

  • Passport type
  • Country code
  • Passport number
  • Full name
  • Surname / given names (from MRZ)
  • Nationality
  • Date of birth
  • Sex
  • Place of birth
  • Date of issue
  • Date of expiry
  • Issuing office
  • Registration number
  • MRZ lines 1 & 2

How it works​

  • The API reads both the printed fields and the MRZ. When printed text and MRZ disagree, the MRZ wins.
  • Dates are returned as DD-MM-YYYY.
  • Sex is returned as M or F.

Example request​

curl -X POST "https://use.api.co.id/ocr/passport-extract" \
-H "x-api-co-id: YOUR_API_KEY" \
-F "file=@/path/to/passport.jpg"
Was this page helpful?