PassportOCR

Passport OCR API: fields, MRZ lines and a fraud score in one JSON response

One POST with the image or PDF, one JSON back: every field of the data page, the two lines of the machine readable zone (MRZ), a confidence level per value and a fraud score from 0 to 100. Works on passports from any country that follows the ICAO 9303 standard, from a phone photo, a scan or a native PDF. The limit, stated first: the API reads and controls the document, it does not verify the person (no face match, no liveness, no chip).

What the passport OCR API returns

The response is the same for every document type on Koncile: a status, a document id, the extracted fields, and the fraud result. For a passport, the default template returns the fields below. Names and formats are yours to change in the interface; the API follows without a deployment on your side.

Sample values. The issue date, the place of birth and the authority exist only in the printed zone: an MRZ only reader cannot return them.
FieldExampleSource on the document
surnameDOEVisual zone, compared with MRZ line 1
given_namesJOHN MICHAELVisual zone, compared with MRZ line 1
document_number19AB12345Visual zone, compared with MRZ line 2 and its check digit
nationalityFRAThree letter code (ISO 3166-1 alpha-3), from the MRZ
issuing_countryFRAMRZ line 1
sexMVisual zone and MRZ
date_of_birth1993-03-03ISO 8601, MRZ check digit recomputed
place_of_birthColumbus, OhioVisual zone only (not in the MRZ)
date_of_issue2021-03-01Visual zone only (not in the MRZ)
date_of_expiry2031-03-01ISO 8601, MRZ check digit recomputed, compared with the day of analysis
issuing_authorityPréfecture de ParisVisual zone only
mrz_line_1 / mrz_line_2P<FRADOE<<JOHN<MICHAEL<<… / 19AB123454FRA9303036M3103016<<<…The two 44 character lines, as read
confidence (per field)0.98Koncile's confidence in the value; low values are flagged for review

A request and its response

Upload the file with your API key and the template to use. Large files go through a presigned upload. The result is available by polling the document id or pushed to your webhook when the analysis is done.

curl -X POST https://api.koncile.ai/v1/upload \
  -H "Authorization: Bearer $KONCILE_API_KEY" \
  -F "template_id=passport" \
  -F "file=@passport.jpg"

{
  "status": "DONE",
  "document_id": "doc_8f1c2a",
  "general_fields": {
    "surname": {"value": "DOE", "confidence": 0.99},
    "given_names": {"value": "JOHN MICHAEL", "confidence": 0.98},
    "document_number": {"value": "19AB12345", "confidence": 0.99},
    "nationality": {"value": "FRA", "confidence": 0.99},
    "date_of_birth": {"value": "1993-03-03", "confidence": 0.99},
    "date_of_expiry": {"value": "2031-03-01", "confidence": 0.99},
    "mrz_line_1": {"value": "P<FRADOE<<JOHN<MICHAEL<<<<<<<<<<<<<<<<<<<<<<"},
    "mrz_line_2": {"value": "19AB123454FRA9303036M3103016<<<<<<<<<<<<<<02"}
  },
  "fraud": {"score": 12, "level": "low", "signals": []}
}

The exact field names, the status values (DONE, DUPLICATE, IN PROGRESS), the error codes (a 422 for a file the template cannot process, rate limits) and the webhook payload are in the Koncile API documentation. Duplicates are detected on Koncile's side: the same passport sent twice returns the first document id.

How the API reads a passport

  1. Classification. The page is identified as a passport (and not an ID card or a visa), its issuing country is read, and the right template is applied. A multi page PDF is read page by page.
  2. Extraction of the visual zone. The printed fields are read with Koncile's OCR, including non Latin scripts (Arabic, Cyrillic, Chinese, Japanese), with transliteration when the MRZ provides the Latin form.
  3. MRZ parsing. The two lines are located, read as fixed position characters, split into fields, and the check digits of the document number, birth date, expiry date and composite line are recomputed.
  4. Consistency. Names, number and dates from the MRZ are compared with the printed zone; a disagreement lowers the confidence and raises the fraud score.
  5. File controls. Metadata, editing software, incremental saves and fonts on a PDF; retouching and AI generated areas on a photo (K-Detect). The result is a score from 0 to 100 with its signals.

What makes a passport hard to read, and what the API does about it

Glare on the laminate, a cut MRZ, a tilted photo, a scan at low resolution: these are the usual reasons a field comes back with a low confidence. The API does not silently guess. Each value carries a confidence, the doubtful ones are flagged, and your workflow decides: accept, send to a person, or ask the user for a new photo. The usual reasons a reader misses the zone altogether are listed in the guide to the machine readable zone (MRZ).

Passport OCR API versus an SDK

An SDK (Regula, Microblink, Dynamsoft) captures the document live in your mobile app and reads it on the device. An API like Koncile's receives a file your application already has: a photo from a form, a scan from a portal, an attachment from an inbox, a PDF from a partner. If documents reach you as files, the API is the simpler route. If you must guide the capture on a phone and read the chip, an SDK does that and Koncile can process the resulting image. The comparison of passport OCR APIs and SDKs details both families.

Pricing and limits

  • 20 free credits at signup, no credit card, for professional use.
  • Advanced plan: €199 per month for 1,000 credits; Pro: €799 per month for 5,000; volume pricing above. Prices on koncile.ai, taxes excluded.
  • 1 credit per page for an extraction, 2 credits per page for a fraud analysis.
  • PDF, JPG and PNG up to 20 MB. Rate limits and duplicates handled by the API.
  • Documents processed on European infrastructure, deleted after analysis unless your account keeps them, never used to train models. SOC 2 Type II, GDPR.

Beyond the passport

The same API and the same account read national ID cards on both sides (ID card OCR), driver licenses and residence permits, and the other documents of a KYC file: proof of address, bank statement, payslip, tax notice, each with the same fraud score. For the machine readable zone alone, see MRZ OCR.

Frequently asked questions

01Which passports does the API read?

Any passport that follows the ICAO 9303 standard, which covers the machine readable passports of every country. The extraction is not tied to a list of templates per country: fields are read from the document and from the MRZ, so a new design does not require an update on Koncile's side.

02Does the API return the MRZ?

Yes. Both lines are returned as read, and the check digits of the document number, birth date, expiry date and the composite check are recomputed. The parsed MRZ fields are compared with the printed zone.

03What file formats are accepted?

PDF, JPG and PNG up to 20 MB, as a phone photo, a scanner output or a native PDF. A multi page PDF is read page by page.

04How fast is it?

A passport takes a few seconds per page. Use the webhook to be notified when the document is done rather than polling.

05Can I change the fields?

Yes. Templates are managed in the Koncile interface: add, rename or reformat fields and the API response follows. No deployment needed on your side.

06Does the API verify that the passport is genuine?

It controls the file and the consistency of the document and returns a fraud score from 0 to 100 with its signals. It does not read the chip, inspect physical security features or match a face. A score is a signal to verify, not a decision.

07Is there a sandbox?

Every new account gets 20 free credits, which you can use through the API with your own key. Create the account, generate the key, and send a passport.

Get an API key and send a passport

Create a Koncile account, generate your key in the interface, and read the fields, the MRZ and the score within seconds.

Create a free Koncile accountTalk to an expert

20 free credits, no credit card. For professional use only; documents are deleted after analysis.