Errors and limits
Error codes, HTTP statuses, file types and limits.
Subscribe on RapidAPI{
"success": false,
"error": {
"code": "UNSUPPORTED_FILE_TYPE",
"message": "Upload PDF, JPEG, PNG or WebP files.",
"details": { "field": "last_page", "index": 1, "supported": ["application/pdf", "image/jpeg", "image/png", "image/webp"] }
}
}When an error concerns one file, details.field names it (front_page or last_page).
| Code | HTTP | Meaning |
|---|---|---|
INVALID_CONTENT_TYPE | 400 | The request is not multipart/form-data |
MISSING_FILE | 400 | No file in the front_page field |
EMPTY_FILE | 400 | A file is empty |
UNEXPECTED_FIELD | 400 | A field other than front_page and last_page was sent; details.field names it |
TOO_MANY_FILES | 400 | More than one file in a field |
UNAUTHORIZED | 401 | No valid credentials: call the API through your RapidAPI subscription |
FILE_TOO_LARGE | 413 | A file is over 8 MB; details.max_bytes gives the limit |
REQUEST_TOO_LARGE | 413 | The files are over 16 MB in total |
UNSUPPORTED_FILE_TYPE | 415 | A file is not a PDF, JPEG, PNG or WebP (checked from its content, not its name) |
UNREADABLE_FILE | 422 | A file cannot be read; details.reason is encrypted (password-protected PDF) or no_text (PDF without selectable text) |
NOT_A_PASSPORT | 422 | The front_page file does not appear to show a passport's photo/data page |
EXTRACTION_FAILED | 422 | The data could not be read reliably; details.reason is invalid_output or inconsistent_dates (expiry not after issue). Try a clearer image |
NOT_FOUND | 404 | Unknown endpoint |
INTERNAL_ERROR | 500 | Unexpected error |
UNAVAILABLE | 503 | Extraction is temporarily unavailable; details.reason is timeout or unavailable. Retry shortly |
A missing or unreadable field is never an error: it is returned as null.
Limits
| Limit | Value |
|---|---|
| Files per request | front_page (required) and last_page (optional), one file each |
| File types | PDF (with selectable text), JPEG, PNG, WebP |
| File size | 8 MB per file, 16 MB in total (MCP: 5 MB in total) |
| Response time | PDFs with selectable text: usually under 10 seconds. Images: usually 30–40 seconds per request. Allow at least 90 seconds before timing out on your side. When processing takes too long, the request returns UNAVAILABLE with reason timeout; retry shortly |
MCP
Use Passport Extractor as a tool in AI assistants.
Extract passport data POST
Reads one passport from its photo/data page (`front_page`, required) and, optionally, its last page (`last_page`, the address page), sent as multipart/form-data with one file per field. Each page is read separately and the results are combined: names, date and place of birth, nationality, passport number, issue and expiry dates, place of issue, issuing country, sex and the machine readable zone (MRZ) with its check digits verified by the API; from the last page, parents' and spouse's names, address, file number and previous passport. Accepted: PDF (with selectable text), JPEG, PNG and WebP, up to 8 MB per file and 16 MB in total; the file type is detected from the content. Missing or unreadable values are null, never guessed. Uploaded files and extracted data are not stored.