Passport OCR & MRZ
Extract passport fields, read machine-readable zones, and check whether the printed and MRZ data agree.
/passport/scanmultipart/form-dataRequest
Upload the passport photo page using the front multipart form-data field. JPEG and PNG are supported, with a published maximum file size of 20 MB.
| Form field | Type | Required |
|---|---|---|
front | Image file | Yes |
Set RAPIDAPI_KEY and RAPIDAPI_HOST to the values from this API’s listing. The following example uses a POSIX shell. Replace the local filenames with your images.
curl --request POST \
--url "https://$RAPIDAPI_HOST/passport/scan" \
--header "X-RapidAPI-Key: $RAPIDAPI_KEY" \
--header "X-RapidAPI-Host: $RAPIDAPI_HOST" \
--form 'front=@./front.jpg'Response example
{
"fields": {
"documentNumber": "L898902C3",
"surname": "ERIKSSON",
"givenNames": "ANNA MARIA",
"nationality": "UTO",
"issuingState": "UTO",
"birthDate": "1974-08-12",
"sex": "F",
"expiryDate": "2012-04-15"
},
"rawFields": {
"DocumentNumber": {
"value": "L898902C3",
"content": "L898902C3",
"confidence": 0.99
}
},
"verification": {
"match": true,
"mrzValid": true,
"format": "TD3",
"fields": [],
"issues": []
},
"selfConsistent": true,
"issues": []
}Response fields
| Field | Type | Meaning |
|---|---|---|
fields | object | Extracted document fields used for verification. Undetected fields may be null. Dates use yyyy-MM-dd. |
rawFields | object | Provider OCR fields, each with value, printed content, and confidence from 0 to 1. |
mrz | string | null | Raw machine-readable zone text, or null when none is detected. |
verification | object | null | The automatic field-to-MRZ comparison and MRZ validity result. Null when no MRZ is found. |
selfConsistent | boolean | Whether the extracted visual-zone fields and MRZ are consistent. |
issues | array | Detected consistency issues. An empty array indicates no reported issues in this example. |
The response excerpt uses public fictional specimen data. An internally consistent MRZ does not establish that a physical passport is genuine. Low-quality captures should be retaken; field disagreements may need review.
Additional MRZ endpoints
You can validate an MRZ without uploading an image, or compare fields you already have against an MRZ. Both operations use the passport API host and JSON requests.
Validate an MRZ
/passport/mrz/validationSend a mrz string containing complete MRZ lines separated by a newline. The API supports TD1, TD2, and TD3 formats.
{
"mrz": "P<UTOERIKSSON<<ANNA<MARIA<<<<<<<<<<<<<<<<<<<\nL898902C36UTO7408122F1204159ZE184226B<<<<<10"
}The response includes valid, format, parsed fields, field-level check results, compositeCheckValid, and issues.
Compare fields against the MRZ
/passport/mrz/match-verification{
"mrz": "P<UTOERIKSSON<<ANNA<MARIA<<<<<<<<<<<<<<<<<<<\nL898902C36UTO7408122F1204159ZE184226B<<<<<10",
"passport": {
"documentNumber": "L898902C3",
"surname": "Eriksson",
"givenNames": "Anna Maria"
}
}Provide at least one passport field. Only supplied fields are compared. The result includes match, mrzValid, per-field comparisons in fields[], and issues. A match can coexist with an invalid MRZ, so inspect both flags.
Limits and integration notes
- The published image upload limit is 20 MB. Resize files that exceed the limit before sending them.
- Keep keys server-side and use the correct host for the API. See authentication.
- Handle bad inputs and temporary failures using the error guide.
- Vision input images are processed in-request without storage by Tigrate. See data handling.
Based on the published RapidAPI reference, checked September 2026. Consult the listing for the latest full schema, optional parameters, and plan limits.