ScanXtract

OCR extraction from identity document images

POST /di/scanxtract

Extract structured data from identity document images using OCR.

Query parameters

ParamRequiredDescription
docTypeYesDocument type key (e.g. ADHAR). See Document types.
checkNameYesName 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

docTypeDocumentImages required
ADHARAadhaar2 (front and back)
PANCRPAN card1
DRVLCDriving licence2 (front and back)
PSPRTPassport1
VISAVisa1
VTRIDVoter ID2 (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

FieldTypeDescription
masterKeyStringstringComma-separated values of extractedFields, in order. Missing values are empty.
scannedImagesarrayOne entry per uploaded image, in upload order.
scannedImages[].imageUrlstringStored image file name.
scannedImages[].faceLandmarkarray | nullFour { x, y } integer points bounding the face photo, or null if no face was found on that image.
sidMatchedbooleanReturned for ADHAR, PANCR and DRVLC only.
sidPhotosMatchedbooleanPhoto check result.
extractedIdNumberstring | nullDocument number. Aadhaar numbers are masked to the last four digits (e.g. XXXXXXXX0123).
extractedFieldsobjectFields read from the document. Keys depend on docType (see below). Any value can be null if it could not be read.
extractedNameOnIdstring | nullName as printed on the document.
faceMatchStatusstringFace match status (e.g. UNATTEMPTED).
nameMatchPercentageintegerMatch between checkName and the name on the document, from 0 to 100. Omitted when checkName is not sent.
scanXtractRequestIdstringID of this scan request.

Extracted fields by document type

Every docType returns idNumber, idType and nameOnId. The remaining keys are:

docTypeidType valueOther keys (in order)
ADHARAADHAARgender, dob, yearOfBirth (integer), addressLine, zipcode
PANCRPermanent Account Number Cardfathers_name, dob
DRVLCDriving Licencegender, dob
PSPRTPASSPORTissue_country, issue_city, doi, expiry, gender, dob
VISAVisa type as read (e.g. e-VISA)issue_country, issue_city, doi, expiry, type
VTRIDELECTION COMMISSION OF INDIA IDENTITY CARDgender, 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"
}
StatusMessageCause
400Provide a valid docTypedocType is missing
400Could not find a valid docTypedocType is not a supported value
400Provide all the required imagesNo files, or fewer images than the docType requires
400Extra Files Received: This docType required only 1 imagesMore images than the docType requires
401Error: Token MissingAuthorization header is missing
401HttpException: Invalid Token IDtokenId header is missing
401HttpException: No record found with the provided Token IDtokenId does not match any account

Use the ScanXtract response as the body when creating a document.


Did this page help you?