ID Document Extraction

Identity & Government

Identity document extraction preset capturing MRZ data, biographic details, and document validity for passports, driver licenses, and national IDs.

curl -X POST $XBERG_ENTERPRISE_URL/v1/extract \
  -H "Authorization: Bearer $XBERG_API_KEY" \
  -F file=@your-id_document.pdf \
  -F 'preset=id_document'
Sample ID Document Extraction document

Structured fields extracted by this preset

document_typestringrequired

The primary classification of the identity document.

document_numberstringrequired

Alphanumeric document number; preserve leading zeros exactly as printed.

mrzobject

Machine-readable zone data from the document.

surnamestringrequired

Family name exactly as printed on the document.

given_namesstringrequired

Given and middle names exactly as printed, space-separated if multiple.

full_namestring

Complete name for lookup purposes; combination of surname and given names.

date_of_birthstringrequired

ISO-8601 birth date; extract from MRZ or face page, infer century if needed.

place_of_birthstring

City and country of birth if stated on the document.

nationalitystring

ISO 3166-1 alpha-3 code of citizenship.

sexstring

Sex or gender marker: M (Male), F (Female), X (Other), U (Unspecified).

issuing_countrystringrequired

ISO 3166-1 alpha-3 code of the country that issued the document.

issuing_authoritystring

Name of the government agency or entity that issued the document.

issue_datestringrequired

ISO-8601 date the document was issued.

expiry_datestringrequired

ISO-8601 expiry date; critical for validity checking.

addressobject

Residential or registered address as printed on the document.

personal_numberstring

National identification number, tax ID, or personal registration code.

vehicle_classesarray

Driver license vehicle classes or categories authorized (e.g., A, B, C for EU standards).

endorsementsarray

Special endorsements or qualifications on a driver license.

restrictionsarray

Driving restrictions or medical conditions noted on a driver license.

height_cmnumber

Height in centimeters if present on the document.

weight_kgnumber

Weight in kilograms if present on the document.

eye_colorstring

Eye color as stated (e.g., brown, blue, hazel).

hair_colorstring

Hair color as stated.

photo_presentboolean

Whether a photo or biometric image is visible on the document.

signature_presentboolean

Whether a signature or thumbprint is visible on the document.

Configuration

Call Mode

vision_only

Citations

Enabled

Version

v1

Tags

id_documentidentitypassportdrivers_licensemrzbiometric
+System Prompt
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. Dates must be converted to ISO-8601 format; for 2-digit years, infer the century from context (typically 19xx for persons over 50, 20xx for younger). 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.

Open-source primitives, composed into one backend. Curated cohort of design partners. Apply to work with us.

Cookies

We value your privacy

Xberg uses cookies to improve your experience, personalize content, and analyze traffic. You can manage your preferences at any time.