Passport Front Extraction
Extracts data fields from the front page of any country's passport. Provide a passport image as input and the response returns the extracted parameters.
Content-Type: application/json
Headers
| Header | Type | Required | Description |
|---|---|---|---|
key | string | Yes | API key issued for authentication. |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
recordId | string | Yes | Unique ID you assign to correlate the request with the response. |
image | string | Yes | Base64 string / data URI of the passport front image. |
face_image_required | boolean | No | Return the extracted face image in the response. Defaults to false. |
Example
POST/pcs/passport/front
curl --location 'https://sandbox/pcs/passport/front' \
--header 'key: <your-api-key>' \
--header 'Content-Type: application/json' \
--data '{
"recordId": "1",
"image": "data:image/png;base64,<BASE64_STRING>",
"face_image_required": false
}'200
{
"recordId": "1",
"dataRetrievalStatus": "success",
"data": {
"firstName": "first-name-string",
"lastName": "last-name-string",
"DOB": "dob-string",
"countryCode": "code",
"nationality": "nationality-string",
"sex": "F",
"passportType": "P",
"passportNumber": "ABC123",
"issueDate_DDMMYYYY": "22-11-2014",
"expiryDate_DDMMYYYY": "22-11-2019",
"placeOfBirth": "pob-string",
"placeOfIssue": "poi-string",
"faceImage": ""
},
"utc_time_stamp": "25/06/2024, 07:45:32"
}Response
| Field | Type | Description |
|---|---|---|
recordId | string | Echoes the recordId sent in the request. |
dataRetrievalStatus | string | success when data was extracted. |
data.firstName | string | Holder's first name. |
data.lastName | string | Holder's last name. |
data.DOB | string | Date of birth. |
data.countryCode | string | Issuing country code. |
data.nationality | string | Holder's nationality. |
data.sex | string | Holder's sex, e.g. F / M. |
data.passportType | string | Passport type code, e.g. P for personal. |
data.passportNumber | string | Passport number. |
data.issueDate_DDMMYYYY | string | Issue date, DD-MM-YYYY. |
data.expiryDate_DDMMYYYY | string | Expiry date, DD-MM-YYYY. |
data.placeOfBirth | string | Place of birth. |
data.placeOfIssue | string | Place of issue. |
data.faceImage | string | Base64 face image, returned only when face_image_required is true. |
utc_time_stamp | string | UTC timestamp of the response, DD/MM/YYYY, HH:mm:ss. |
Error handling
200 on success, 422 on a validation error — see
Error handling for the common error shape.