Skip to main content

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.

POSThttps://sandbox/pcs/passport/front

Content-Type: application/json

Headers​

HeaderTypeRequiredDescription
keystringYesAPI key issued for authentication.

Request body​

FieldTypeRequiredDescription
recordIdstringYesUnique ID you assign to correlate the request with the response.
imagestringYesBase64 string / data URI of the passport front image.
face_image_requiredbooleanNoReturn 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​

FieldTypeDescription
recordIdstringEchoes the recordId sent in the request.
dataRetrievalStatusstringsuccess when data was extracted.
data.firstNamestringHolder's first name.
data.lastNamestringHolder's last name.
data.DOBstringDate of birth.
data.countryCodestringIssuing country code.
data.nationalitystringHolder's nationality.
data.sexstringHolder's sex, e.g. F / M.
data.passportTypestringPassport type code, e.g. P for personal.
data.passportNumberstringPassport number.
data.issueDate_DDMMYYYYstringIssue date, DD-MM-YYYY.
data.expiryDate_DDMMYYYYstringExpiry date, DD-MM-YYYY.
data.placeOfBirthstringPlace of birth.
data.placeOfIssuestringPlace of issue.
data.faceImagestringBase64 face image, returned only when face_image_required is true.
utc_time_stampstringUTC 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.