Home / Documents / Passport

KYC

Passport OCR API

Read the passport data page. The machine-readable zone (MRZ) carries check digits for the number, birth date and expiry, so when they pass, those fields are near-certain. Printed fields fill in the rest.

Fields returned

FieldWhat it is
passport_number1 letter + 7 digits
surname, given_namesFrom the MRZ
dob, expiry_date, issue_dateDates
nationality, genderFrom the MRZ
place_of_birth, place_of_issue, file_numberPrinted fields

Every field comes with a confidence score from 0 to 1.

Checks

  • All four MRZ check digits
  • Passport has not expired
  • Number format

If a required field is missing, unsure, or a check fails, the response hasneeds_review: true and a warning explaining why.

Used for

  • NRI customers
  • High-value onboarding

Request

Send a JPEG, PNG, WebP, TIFF, BMP or PDF up to 10 MB. Leave out document_type to detect it automatically.

curl https://api.lendocr.com/v1/documents:extract \
  -H "Authorization: Bearer lo_test_..." \
  -F file=@document.jpg \
  -F document_type=passport

Authentication, errors, batch uploads and webhooks →

Questions about the passport API

Why is the MRZ important?

The two lines of characters at the bottom of the data page carry check digits for the passport number, date of birth and expiry. When they pass, those fields are almost certainly correct; when they fail, the passport is flagged.

Can I send a phone photo of a passport?

Yes. Send a JPEG, PNG, WebP, TIFF, BMP or PDF up to 10 MB. Tilted and low-resolution photos are handled; if an image is too unclear, the response is flagged for review and says why.

Do you store the passport after reading it?

No. On the extract API the document is processed in memory and dropped. For background jobs it is kept encrypted only until processed, and results are erased after 24 hours.