ID Document Extraction
Identity document extraction preset capturing MRZ data, biographic details, and document validity for passports, driver licenses, and national IDs.
The fields this preset extracts.
document_typestringThe primary classification of the identity document.
document_numberstringAlphanumeric document number; preserve leading zeros exactly as printed.
mrzobjectMachine-readable zone data from the document.
surnamestringFamily name exactly as printed on the document.
given_namesstringGiven and middle names exactly as printed, space-separated if multiple.
full_namestringComplete name for lookup purposes; combination of surname and given names.
date_of_birthstringISO-8601 birth date; extract from MRZ or face page, infer century if needed.
place_of_birthstringCity and country of birth if stated on the document.
nationalitystringISO 3166-1 alpha-3 code of citizenship.
sexstringSex or gender marker: M (Male), F (Female), X (Other), U (Unspecified).
issuing_countrystringISO 3166-1 alpha-3 code of the country that issued the document.
issuing_authoritystringName of the government agency or entity that issued the document.
issue_datestringISO-8601 date the document was issued.
expiry_datestringISO-8601 expiry date; critical for validity checking.
addressobjectResidential or registered address as printed on the document.
personal_numberstringNational identification number, tax ID, or personal registration code.
vehicle_classesarrayDriver license vehicle classes or categories authorized (e.g., A, B, C for EU standards).
endorsementsarraySpecial endorsements or qualifications on a driver license.
restrictionsarrayDriving restrictions or medical conditions noted on a driver license.
height_cmnumberHeight in centimeters if present on the document.
weight_kgnumberWeight in kilograms if present on the document.
eye_colorstringEye color as stated (e.g., brown, blue, hazel).
hair_colorstringHair color as stated.
photo_presentbooleanWhether a photo or biometric image is visible on the document.
signature_presentbooleanWhether a signature or thumbprint is visible on the document.
curl -X POST 'https://app.staging.xberg.io/v1/extract' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-F 'file=@your-document.pdf' \
--form-string 'options={"preset":"id_document"}'- Call mode
- Vision only
- Citations
- Enabled
- Version
- v1
The instructions Xberg gives the AI model when it extracts this document type.
You are a document verification specialist. Extract identity document data with absolute accuracy. For the MRZ, transcribe all characters exactly as printed or scanned; preserve all leading zeros and special characters. Convert dates to ISO-8601 format only when the complete date, including the century, is explicit in the document. For biographic fields, use the face page as primary source and cross-check with MRZ data. Extract personal identification numbers preserving their exact format including leading zeros. Flag mismatches between MRZ and face data but report both. If the document does not match this preset, return {}. Extract only values supported by the document. Omit absent, illegible, or incomplete values, including within nested objects, while retaining other supported values. Do not infer, guess, supply defaults, or calculate missing values. Omit dates whose complete year, month, and day are not explicit. Do not emit null or placeholder strings such as "null" or "2023-XX-XX" for missing values.