ID document OCR API
Read PAN, Aadhaar, DL, voter ID and passport images into fields.
Overview
Upload a photo or scan; get structured fields back. Detects the document type on its own, flags blurred, cropped or photocopied images, and masks the Aadhaar number in the returned image.
POST/v1/ocr/id
Where it’s used
- Form autofill on mobile
- Back-office document processing
- Pre-check before source verification
How the check runs
- You upload a photo or PDF of an ID.
- We detect the document type, crop and straighten it, and run quality checks.
- Fields are extracted with a confidence per field. Aadhaar numbers are masked in the returned image.
Request
| Field | Description |
|---|---|
front | Image or PDF |
back | Optional. Back side |
curl -X POST https://api.yetlix.com/v1/ocr/id \
-H "x-client-id: $YETLIX_CLIENT_ID" \
-H "x-client-secret: $YETLIX_CLIENT_SECRET" \
-H "Content-Type: application/json" \
-d '{"front":"data:image/jpeg;base64,/9j/4AAQ…"}'
{
"status": "success",
"request_id": "req_7Hq2kD91",
"data": {
"document_type": "PAN",
"fields": {
"name": "ROHIT KUMAR VERMA",
"father_name": "SURESH VERMA",
"dob": "05-09-1991",
"pan": "ABCPV1234K"
},
"quality": {
"blur": false,
"cropped": false,
"photocopy": false
}
}
}
Response fields
Inside the data object. The envelope (status, request_id, billable, timestamp) is the same for every API and is described in the docs.
| Field | Type | Meaning |
|---|---|---|
document_type | enum | PAN, AADHAAR, DL, VOTER_ID, PASSPORT or UNKNOWN. |
fields | object | Name, DOB, ID number, address… depends on document. |
confidence | object | 0–1 per field. |
quality | object | blur, cropped, glare, photocopy flags. |
masked_image | string | Base64 image with the Aadhaar number masked (for Aadhaar only). |
Outcomes and what to do
Every check can end in a handful of ways. Decide up front what your product does in each case, so nothing falls through to a support ticket.
Clean read
All fields read with high confidence.
Do this: Pre-fill the form, then verify the number at source.
photocopy / cropped
Image isn’t the original.
Do this: Ask for a photo of the original card.
Sandbox test values
Send these values in front with your sandbox key to get each result. Anything else returns INVALID_INPUT in sandbox.
| Value | Returns |
|---|---|
pan.jpg | PAN read cleanly |
copy.jpg | Photocopy detected |
Best practices
- OCR tells you what a card says, not whether it’s real. Always follow with the source check (PAN, DL, voter ID).
Compliance note. When you store Aadhaar images, keep only the masked version.
Frequently asked
Does it read regional languages?
It reads the English fields. Bilingual cards are supported.