# 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`)                            |
| `checkName` | Yes      | Name to verify against extracted data (e.g. `Adarsh Kumar`) |

## Body

Send **form-data** where the key name must be `files` and the value should be an image file in PNG or JPEG format.

For Aadhaar, upload two images — front and back.

## Example request

```bash
curl --request POST 'https://api.qidpro.xyz/di/scanxtract?docType=ADHAR&checkName=Adarsh%20Kumar' \
  --header 'Authorization: Bearer your-secret-key' \
  --header 'tokenId: your-token-id' \
  --form 'files=@aadhaar-front.jpg' \
  --form 'files=@aadhaar-back.jpg'
```

## Example response

```json
{
  "masterKeyWords": ["KOR", "भरत सरकार", "नाम/Name:", "Adarsh kumar"],
  "masterKeyString": "KOR भरत सरकार INMENT OF INDI नाम/Name: Adarsh kumar ...",
  "scannedImages": [
    {
      "imageUrl": "fe39d9a864.jpeg",
      "keywords": ["KOR", "भरत सरकार", "नाम/Name:", "Adarsh kumar"],
      "keyString": "KOR भरत सरकार INMENT OF INDI नाम/Name: Adarsh kumar",
      "faceLandmark": [
        { "x": 39, "y": 153 },
        { "x": 148, "y": 153 },
        { "x": 148, "y": 280 },
        { "x": 39, "y": 280 }
      ]
    }
  ],
  "sidMatched": true,
  "sidPhotosMatched": true,
  "extractedIdNumber": "203267322804",
  "extractedFields": {
    "idNumber": "203267322804",
    "idType": "Aadhaar Number",
    "nameOnId": "Adarsh Kumar",
    "gender": "Male",
    "yearOfBirth": 1995
  },
  "extractedNameOnId": "Adarsh Kumar",
  "nameMatchPercentage": 90
}
```

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