ScanXtract
OCR extraction from identity document images
POST /di/scanxtract
Extract structured data from identity document images using OCR.
Query parameters
| Param | Required | Description |
|---|---|---|
docType | Yes | Document type key (e.g. ADHAR). See Document types. |
checkName | Yes | Name to verify against extracted data (e.g. Rahul Sharma). If omitted, the request still succeeds but nameMatchPercentage is left out of the response. |
Document types
docType | Document | Images required |
|---|---|---|
ADHAR | Aadhaar | 2 (front and back) |
PANCR | PAN card | 1 |
DRVLC | Driving licence | 2 (front and back) |
PSPRT | Passport | 1 |
VISA | Visa | 1 |
VTRID | Voter ID | 2 (front and back) |
Body
Send form-data where the key name must be files and the value should be an image file in PNG or JPEG format.
Upload exactly the number of images listed for the docType. For Aadhaar, driving licence and voter ID, upload two images — front and back — as two separate files entries. A single image containing both sides is rejected.
Example request
curl --request POST 'https://api.qidpro.xyz/di/scanxtract?docType=ADHAR&checkName=Rahul%20Sharma' \
--header 'Authorization: Bearer your-secret-key' \
--header 'tokenId: your-token-id' \
--form '[email protected]' \
--form '[email protected]'Example response
A successful scan returns HTTP 201 Created.
{
"masterKeyString": "XXXXXXXX0123,AADHAAR,Rahul Sharma,Male,1995-03-14,1995,S/O: Ramesh Kumar, 12, MG Road, Indiranagar, Bengaluru, Karnataka, 560038,560038",
"scannedImages": [
{
"imageUrl": "4f8a2c91d07.jpeg",
"faceLandmark": [
{ "x": 36, "y": 94 },
{ "x": 98, "y": 94 },
{ "x": 98, "y": 168 },
{ "x": 36, "y": 168 }
]
},
{
"imageUrl": "b31e7d05a2c.jpeg",
"faceLandmark": null
}
],
"sidMatched": true,
"sidPhotosMatched": true,
"extractedIdNumber": "XXXXXXXX0123",
"extractedFields": {
"idNumber": "XXXXXXXX0123",
"idType": "AADHAAR",
"nameOnId": "Rahul Sharma",
"gender": "Male",
"dob": "1995-03-14",
"yearOfBirth": 1995,
"addressLine": "S/O: Ramesh Kumar, 12, MG Road, Indiranagar, Bengaluru, Karnataka, 560038",
"zipcode": "560038"
},
"extractedNameOnId": "Rahul Sharma",
"faceMatchStatus": "UNATTEMPTED",
"nameMatchPercentage": 100,
"scanXtractRequestId": "6a1f2c3d4e5f6a7b8c9d0e1f"
}Response fields
| Field | Type | Description |
|---|---|---|
masterKeyString | string | Comma-separated values of extractedFields, in order. Missing values are empty. |
scannedImages | array | One entry per uploaded image, in upload order. |
scannedImages[].imageUrl | string | Stored image file name. |
scannedImages[].faceLandmark | array | null | Four { x, y } integer points bounding the face photo, or null if no face was found on that image. |
sidMatched | boolean | Returned for ADHAR, PANCR and DRVLC only. |
sidPhotosMatched | boolean | Photo check result. |
extractedIdNumber | string | null | Document number. Aadhaar numbers are masked to the last four digits (e.g. XXXXXXXX0123). |
extractedFields | object | Fields read from the document. Keys depend on docType (see below). Any value can be null if it could not be read. |
extractedNameOnId | string | null | Name as printed on the document. |
faceMatchStatus | string | Face match status (e.g. UNATTEMPTED). |
nameMatchPercentage | integer | Match between checkName and the name on the document, from 0 to 100. Omitted when checkName is not sent. |
scanXtractRequestId | string | ID of this scan request. |
Extracted fields by document type
Every docType returns idNumber, idType and nameOnId. The remaining keys are:
docType | idType value | Other keys (in order) |
|---|---|---|
ADHAR | AADHAAR | gender, dob, yearOfBirth (integer), addressLine, zipcode |
PANCR | Permanent Account Number Card | fathers_name, dob |
DRVLC | Driving Licence | gender, dob |
PSPRT | PASSPORT | issue_country, issue_city, doi, expiry, gender, dob |
VISA | Visa type as read (e.g. e-VISA) | issue_country, issue_city, doi, expiry, type |
VTRID | ELECTION COMMISSION OF INDIA IDENTITY CARD | gender, dob |
Dates (dob, doi, expiry) use YYYY-MM-DD.
For example, a PAN card returns:
"extractedFields": {
"idNumber": "ABCPK1234F",
"idType": "Permanent Account Number Card",
"nameOnId": "Rahul Sharma",
"fathers_name": "Ramesh Kumar",
"dob": null
}Errors
Errors return this shape:
{
"statusCode": 400,
"message": "Provide all the required images",
"timestamp": "2026-11-10T11:44:39.873Z",
"path": "/di/scanxtract?docType=ADHAR&checkName=Rahul%20Sharma",
"requestId": "3b9d2f6e-1c4a-4e8b-9f2d-7a6c5e4b3d21"
}| Status | Message | Cause |
|---|---|---|
400 | Provide a valid docType | docType is missing |
400 | Could not find a valid docType | docType is not a supported value |
400 | Provide all the required images | No files, or fewer images than the docType requires |
400 | Extra Files Received: This docType required only 1 images | More images than the docType requires |
401 | Error: Token Missing | Authorization header is missing |
401 | HttpException: Invalid Token ID | tokenId header is missing |
401 | HttpException: No record found with the provided Token ID | tokenId does not match any account |
Use the ScanXtract response as the body when creating a document.
Updated 17 days ago
Did this page help you?