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
| Requirement | Value |
|---|---|
| Formats | JPG, JPEG, PNG |
| Maximum size | 5 MB |
| Content | Passport 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
MorF.
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"
Extract Passport from Image
POST/ocr/passport-extract
Extract structured passport data from an uploaded image of the passport data page.
### Request
- Method: POST
- Content-Type: multipart/form-data
- File field: file (required)
### Supported File Types - JPG/JPEG (image/jpeg) - PNG (image/png)
### File Size Limit - Maximum: 5 MB
### Response Returns passport fields plus the raw MRZ lines. Dates are DD-MM-YYYY, sex is M or F.
Request
curl -X POST "https://use.api.co.id/ocr/passport-extract" \ -H "x-api-co-id: $API_CO_ID_KEY"Response
Successful responseWas this page helpful?