Skip to main content
POST
Extract Aadhaar card fields from an image
Aadhaar OCR reads the printed fields from a photo or scan of an Aadhaar card. The front gives the number, name, date of birth and gender; the back gives care-of, address and pincode. OCR reads what is printed: it does not check the card against the Aadhaar database. To confirm the person, follow up with OKYC or DigiLocker.

Environments

How to read the result

  • Send the file as multipart/form-data in the field file, at most 12 MB.
  • error_code: null with data: the card was read. Fields that could not be read are null.
  • error_code: "IDTO_202" with data: null: no Aadhaar number could be read, even if other text was (for example a back side with no number on it). Ask for a clearer image of the front. This is billed.
  • data.aadhaar_number is returned in full, 12 digits. Mask it before you show or store it, and keep only what you need.
  • dob is YYYY-MM-DD. gender is male, female or transgender.
Send an Idempotency-Key header. A retry with the same key and the same file returns the first response without a second charge. See Idempotency.

Errors

A missing or wrong X-Client-ID / X-API-Key pair returns 401 with a detail string and is not billed. The full code list is in v2 error codes.

Test scenarios

See the Aadhaar FAQ and the OCR upload recipe. Was this page helpful? Email us at tech@idto.ai with the page link.

Authorizations

X-Client-ID
string
header
default:<client-id>
required

The Client ID shown on the API Credentials page of the idto dashboard. It is not your account or customer ID, which returns 401. Send it on every server-to-server request together with X-API-Key. Staging and production client IDs are different.

X-API-Key
string
header
default:<api-key>
required

Your API key from the idto dashboard (API credentials). Keep it on your server; never ship it in a browser or mobile app. Send it on every server-to-server request together with X-Client-ID.

Headers

Idempotency-Key
string

Make retries of this exact request safe. If the same key is replayed with an identical request body, the original result is returned without re-running the verification or billing again. If the same key is replayed with a different body, the request is rejected with IDTO_010 (422). Omitting this header runs every request as new.

Maximum string length: 255

Body

multipart/form-data
file
file
required

Photo or scan of the Aadhaar card, at most 12 MB.

workflow_session_token
string

Only when the call is made inside an idto workflow session.

Response

The image was OCR'd.

status
enum<string>
required
Available options:
success
message
string
required
error_code
string | null
required

null on a full match, an IDTO_2xx code on a definitive no-record result. Both are billed.

data
object | null
required
billed
enum<boolean>
required
Available options:
true
tranx_id
string | null
timestamp
string<date-time> | null
Last modified on December 1, 2026