Offline Aadhaar Verification API (XML / QR)
You send the offline eKYC ZIP with its share code, or the data from the secure QR on the card. We check UIDAI's digital signature and return the name, DOB, gender, address and photo inside it.
- Source
- UIDAI-signed offline eKYC XML or secure QR code (verified against UIDAI's public signing certificate)
- Turnaround
- Real time, under a second or two, since no live call to UIDAI is needed
- Endpoint
- POST /v1/aadhaar/offline/verify
- Who can use it
- Open to any business with the user's consent. This is the route UIDAI intends for private companies that are not allowed to do OTP eKYC.
Overview
Offline Aadhaar is how a private company can verify Aadhaar details without being an authentication user agency. The user downloads a signed XML (or you scan the secure QR on their card), and we check UIDAI's signature. If the signature holds, the data inside has not been changed.
Good to know
The file can be up to a few days old and doesn't prove the person holding the phone is the Aadhaar holder. Add a selfie match for that.
What you get
- Signature check, not OCRWe verify UIDAI's digital signature, so an edited name or address fails, even if the photo looks right.
- No Aadhaar number exposedThe XML carries a reference ID, not the full Aadhaar number, which keeps you clear of storage rules.
- Works with the card QRUsers without a smartphone can just show their printed Aadhaar. Scan the QR and send us the data.
- Freshness checkWe return when the file was generated, so you can reject files older than your policy allows.
Request
POST https://api.ampletrails.com/v1/aadhaar/offline/verify
| Field | Type | Status | Description |
|---|---|---|---|
file_base64 | string | Optional | Offline eKYC ZIP or XML file, base64 encoded (use this or qr_data) |
share_code | string | Optional | 4-character share code set by the user when downloading the ZIP |
qr_data | string | Optional | Raw data scanned from the secure Aadhaar QR code |
consent | string | Required | Y if the user has given explicit consent |
Response
Fields inside data. Every response also carries status, request_id and, on errors, message. See error codes.
| Field | Meaning | Example |
|---|---|---|
signature_valid | Whether UIDAI's digital signature on the file or QR is valid | true |
full_name | Name as per Aadhaar | Ravi Kumar |
dob | Date of birth | 1990-04-12 |
gender | Gender: M, F or T | M |
address.state | State | Haryana |
address.pincode | PIN code | 122001 |
photo_base64 | Photograph embedded in the file, base64 encoded | /9j/4AAQSkZJRg... |
reference_id | Reference ID from the XML (last 4 digits of Aadhaar plus timestamp) | 4321202612041530 |
generated_at | When the offline file was generated | 2026-12-04T15:30:00+05:30 |
Example
curl -X POST https://api.ampletrails.com/v1/aadhaar/offline/verify \
-H "Authorization: Bearer $AMPLE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"file_base64": "UEsDBBQAAAAI...", "share_code": "1234", "qr_data": "2374971804270526477...", "consent": "Y"}'import os, requests
resp = requests.post(
"https://api.ampletrails.com/v1/aadhaar/offline/verify",
headers={"Authorization": f"Bearer {os.environ['AMPLE_API_KEY']}"},
json={
"file_base64": "UEsDBBQAAAAI...",
"share_code": "1234",
"qr_data": "2374971804270526477...",
"consent": "Y"
},
timeout=30,
)
resp.raise_for_status()
print(resp.json()["data"])const resp = await fetch("https://api.ampletrails.com/v1/aadhaar/offline/verify", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.AMPLE_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"file_base64": "UEsDBBQAAAAI...",
"share_code": "1234",
"qr_data": "2374971804270526477...",
"consent": "Y"
}),
});
const { data } = await resp.json();$ch = curl_init("https://api.ampletrails.com/v1/aadhaar/offline/verify");
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer " . getenv("AMPLE_API_KEY"),
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode(["file_base64" => "UEsDBBQAAAAI...", "share_code" => "1234", "qr_data" => "2374971804270526477...", "consent" => "Y"]),
]);
$data = json_decode(curl_exec($ch), true)["data"];{
"status": "success",
"request_id": "req_7f3a9c21e4",
"data": {
"signature_valid": true,
"full_name": "Ravi Kumar",
"dob": "1990-04-12",
"gender": "M",
"address": {
"state": "Haryana",
"pincode": "122001"
},
"photo_base64": "/9j/4AAQSkZJRg...",
"reference_id": "4321202612041530",
"generated_at": "2026-12-04T15:30:00+05:30"
}
}Example data. The exact field list for your account comes with your sandbox documentation.
Use cases
Fintech and gaming KYC
Companies that cannot do OTP eKYC use offline XML as their main Aadhaar route.
Rental and co-living
Operators scan the QR on a tenant's Aadhaar card at check-in instead of filing a photocopy.
Field onboarding
Agents scan the QR on a printed card in places with poor connectivity and sync later.
Questions about this API
How does the user get the XML file?
From the myAadhaar portal or the mAadhaar app: they choose Offline eKYC, set a four-character share code and download a ZIP. They share the ZIP and the code with you.
What if the share code is wrong?
The ZIP can't be opened, and we return INVALID_SHARE_CODE. Ask the user to re-enter it; most mistakes are a capital letter.
Can a user edit the XML before sending?
They can try, but any change breaks the UIDAI signature, and signature_valid comes back false.
Do old printed cards have a secure QR?
Cards printed in roughly the last several years have the secure (signed) QR. Very old cards carry a plain QR that is not signed; we flag those so you can ask for the XML instead.
Try the Offline Aadhaar Verification API (XML / QR) API
Sandbox keys, the full field reference and a Postman collection, usually within a working day.