---
title: Aadhaar Extraction
slug: api-marketplace/NSJ1-aadhaar-extraction
createdAt: 2023-11-02T11:46:52.780Z
---

## Introduction

The Aadhar Extraction API is a powerful tool designed to simplify the process of extracting essential details such as Date of Birth (DOB), address, and gender from an individual's Aadhar card.&#x20;The Aadhar Extraction API emerges as an invaluable resource for leveraging the wealth of information contained in Aadhar cards securely and efficiently.



***

## API details

### Endpoint

:::CodeblockTabs
Production environment

```jsx
POST https://api.signzy.app/api/v3/aadhaar/extractions
```
:::

:::CodeblockTabs
UAT/Testing environment

```jsx
POST https://api-preproduction.signzy.app/api/v3/aadhaar/extractions
```
:::

***

### Request headers&#x20;

| Name          | Value            | Required  | Description                                                                                                |
| ------------- | ---------------- | --------- | ---------------------------------------------------------------------------------------------------------- |
| Content-Type  | application/json | Mandatory | The type of content that the request body contains.                                                        |
| Authorization | XXXXXXXXXXXXXXX  | Mandatory | An authentication token to authorize the request. Reach out to the Signzy support team to get one created. |

***

### Request body parameters

| **Parameter**  | **Data type** | **Description**                                                             | **Required** |
| -------------- | ------------- | --------------------------------------------------------------------------- | ------------ |
| frontUrl       | String        | URL of the front Aadhaar Image                                              | Mandatory    |
| backUrl        | String        | URL of the back Aadhaar Image                                               | Mandatory    |
| mask           | Boolean       | if "false", return the UID unmasked                                         | Optional     |
| password       | String        | password of the file  if it is password protected                           | Conditional  |
| additionalInfo | Boolean       | To check if the provided URL valid front aadhaar and similarly for the back | Optional     |

:::CodeblockTabs
File without password

```json
{
    "files": [
        "https://preproduction-persist.signzy.tech/api/files/27363499/download/XXXXXXXXXXX.jpg",
        "https://preproduction-persist.signzy.tech/api/files/27363753/download/XXXXXXXXXXX.jpg"
    ]
}
```

Password Protected File

```json
{
    "files": [
        "https://staging-persist.signzy.tech/api/files/5038781/download/xxxxx.pdf"
    ],
    "password": "12345"
}
```
:::

***

### Code samples

:::CodeblockTabs
```curl
curl --location 'https://api.signzy.app/api/v3/aadhaar/extractions' \
--header 'Content-Type: application/json' \
--header 'Authorization: <authkey>' \
--data '{
    "frontUrl": "https://preproduction-persist.signzy.tech/api/files/42460441/download/cbc84c154a8644129fd938c28326a8ab41d1b9b8f8d84325bb9b2e8b22c531e0.png",
    "backUrl": "https://persist.signzy.tech/api/files/1241057898/download/c23efe453d5645ccacf7fc52f17dcb40de52a1e0c018410d9697a372a4ec4f53.png",
    "mask": false,
    "additionalInfo": false
}'
```

```nodejs
const axios = require('axios');
let data = JSON.stringify({
  "files": [
    "https://preproduction-persist.signzy.tech/api/files/27363499/download/XXXXXXXXXXX.jpg",
    "https://preproduction-persist.signzy.tech/api/files/27363753/download/XXXXXXXXXXX.jpg"
  ]
});

let config = {
  method: 'post',
  maxBodyLength: Infinity,
  url: 'https://api-preproduction.signzy.app/api/v3/aadhaar/extraction',
  headers: { 
    'Content-Type': 'application/json', 
    'Authorization': '<Your access token>'
  },
  data : data
};

axios.request(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});

```

```python
import http.client
import json

conn = http.client.HTTPSConnection("api-preproduction.signzy.app")
payload = json.dumps({
  "files": [
    "https://preproduction-persist.signzy.tech/api/files/27363499/download/XXXXXXXXXXX.jpg",
    "https://preproduction-persist.signzy.tech/api/files/27363753/download/XXXXXXXXXXX.jpg"
  ]
})
headers = {
  'Content-Type': 'application/json',
  'Authorization': '<Your access token>'
}
conn.request("POST", "/api/v3/aadhaar/extraction", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
```

```go
package main

import (
  "fmt"
  "strings"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://api-preproduction.signzy.app/api/v3/aadhaar/extraction"
  method := "POST"

  payload := strings.NewReader(`{
    "files": [
        "https://preproduction-persist.signzy.tech/api/files/27363499/download/XXXXXXXXXXX.jpg",
        "https://preproduction-persist.signzy.tech/api/files/27363753/download/XXXXXXXXXXX.jpg"
    ]
}`)

  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, payload)

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("Content-Type", "application/json")
  req.Header.Add("Authorization", "<Your access token>")

  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := ioutil.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}
```
:::

***

### Response body parameters

| Parameter                               | Data Type        | Description                                                                                                       |
| --------------------------------------- | ---------------- | ----------------------------------------------------------------------------------------------------------------- |
| files                                   | Array of strings | An array of file URLs.                                                                                            |
| id                                      | Integer          | Unique ID for the request.                                                                                        |
| result                                  | Object           | Contains the result of the task.                                                                                  |
| result.uid                              | String           | The Unique Identification Number (UID) with the first 8 digits masked.<br />In format ”00000000XXXX”              |
| result.vid                              | String           | The Virtual ID associated with the Aadhaar number.                                                                |
| result.name                             | String           | Name of the individual.                                                                                           |
| result.dob                              | String           | Date of Birth of the individual. In the format **DD/MM/YYYY**.                                                    |
| result.yob                              | String           | Year of Birth of the individual.                                                                                  |
| result.pincode                          | String           | Pincode.                                                                                                          |
| result.address                          | String           | The complete address.                                                                                             |
| result.gender                           | String           | Gender of the individual.                                                                                         |
| result.splitAddress                     | Object           | Contains the address in split format.                                                                             |
| result.splitAddress.district            | Array of strings | District.                                                                                                         |
| result.splitAddress.state               | Array of strings | State.                                                                                                            |
| result.splitAddress.city                | Array of strings | City.                                                                                                             |
| result.splitAddress.pincode             | String           | Pincode.                                                                                                          |
| result.splitAddress.country             | Array of strings | Country.                                                                                                          |
| result.splitAddress.addressLine         | String           | Address line.                                                                                                     |
| result.uidHash                          | String           | UID hash.                                                                                                         |
| result.summary                          | Object           | Summary of extracted details.                                                                                     |
| result.summary.number                   | String           | The UID number with the first 8 digits masked.<br />In format ”00000000XXXX”                                      |
| result.summary.name                     | String           | Name of the individual.                                                                                           |
| result.summary.dob                      | String           | Date of Birth of the individual.<br />In the format **DD/MM/YYYY**.                                               |
| result.summary.address                  | String           | The complete address of the individual.                                                                           |
| result.summary.splitAddress             | Object           | Contains the address in split format.                                                                             |
| result.summary.splitAddress.district    | Array of strings | District                                                                                                          |
| result.summary.splitAddress.state       | Array of strings | State                                                                                                             |
| result.summary.splitAddress.city        | Array of strings | City                                                                                                              |
| result.summary.splitAddress.pincode     | String           | Pincode.                                                                                                          |
| result.summary.splitAddress.country     | Array of strings | Country.                                                                                                          |
| result.summary.splitAddress.addressLine | String           | Address line.                                                                                                     |
| result.summary.gender                   | String           | The gender of the individual.<br />The possible values are:<br />Male or female                                   |
| result.summary.guardianName             | String           | The name of the guardian.                                                                                         |
| result.summary.issueDate                | String           | The issue date.<br />In the format **DD/MM/YYYY.**                                                                |
| result.summary.expiryDate               | String           | The expiry date.<br />In the format **DD/MM/YYYY.**                                                               |
| result.summary.dateOfBirth              | String           | Date of Birth of the individual. In the format **DD/MM/YYYY.**                                                    |
| result.validBackAndFront                | Boolean          | Indicates whether the back and front images of the Aadhaar card are valid.<br />**true** if valid else **false**. |
| result.dateOfBirth                      | String           | Date of Birth of the individual. In the format **DD/MM/YYYY.**                                                    |

:::CodeblockTabs
200 (mask\:false)

```json
{
    "files": [
        "https://preproduction-persist.signzy.tech/api/files/27363499/download/XXXXXXXXXXX.jpg",
        "https://preproduction-persist.signzy.tech/api/files/27363753/download/XXXXXXXXXXX.jpg"
    ],
    "id": 16,
    "result": {
        "uid": "00000000XXXX",
        "vid": "",
        "name": "Name",
        "dob": "DD/MM/YYYY",
        "yob": "YYYY",
        "pincode": "421503",
        "address": "Address",
        "gender": "Male",
        "splitAddress": {
            "district": [
                "THANE"
            ],
            "state": [
                [
                    "MAHARASHTRA",
                    "MH"
                ]
            ],
            "city": [
                "SAI"
            ],
            "pincode": "421503",
            "country": [
                "IN",
                "IND",
                "INDIA"
            ],
            "addressLine": "Address line"
        },
        "uidHash": "<UID HASH>",
        "summary": {
            "number": "00000000XXXX",
            "name": "Name",
            "dob": "DD/MM/YYYY",
            "address": "Full Address",
            "splitAddress": {
                "district": [
                    "THANE"
                ],
                "state": [
                    [
                        "MAHARASHTRA",
                        "MH"
                    ]
                ],
                "city": [
                    "SAI"
                ],
                "pincode": "421503",
                "country": [
                    "IN",
                    "IND",
                    "INDIA"
                ],
                "addressLine": "ADDRESS LINE"
            },
            "gender": "Male",
            "guardianName": "",
            "issueDate": "",
            "expiryDate": "",
            "dateOfBirth": "DD/MM/YYYY"
        },
        "validBackAndFront": true,
        "dateOfBirth": "DD/MM/YYYY"
    }
}
```

400

```json
{
    "error": {
        "name": "Bad Request",
        "statusCode": 400,
        "message": "Please provide valid Aadhaar images.",
        "status": 400
    }
}

// Invalid image passed or incorrect password
{
    "error": {
        "name": "Error",
        "message": "Only image(s)/pdf(s) are allowed, one of the urls does not respond like an image",
        "status": 400
    }
}

// No input passed
{
    "error": {
        "statusCode": 400,
        "name": "Error",
        "message": "The `Extraction` instance is not valid. Details: `files` can't be blank (value: [])."
    }
}
```

401

```json
{
    "message": "Invalid authentication credentials"
}
```

409

```json
{
    "error": {
        "reason": "Error From Upstream",
        "status": 409,
        "message": "Upstream Down",
        "type": "Conflict",
        "statusCode": 409,
        "name": "error"
    }
}
```

500

```json
{
    "error": {
        "name": "Internal Server Error",
        "statusCode": 500,
        "message": "Internal Server Error"
    }
}
```
:::

***

### Document related constraints

:::hint{type="info"}
The size of the document should not exceed&#x20;**&#x20;10 MB**.

For best results, ensure the image you use fits tightly in the camera view and horizontally aligned.

In case of password protected pdf, only one file is expected in the request body.&#x20;

Supported document types:

- Image - JPEG, JPG, PNG and TIFF/TIF.
- PDF page limit upto 7 pages.&#x20;

NOTE : In the case of multipage PDF input the API will only consider the first page for extraction.
:::

***

**Contact Us for Any Assistance**

If you have any questions or need assistance, please reach out to our customer support team. You can contact us via email at <font color="#2166ae">**help\@signzy.com**</font>. We strive to provide prompt and reliable assistance, ensuring your queries are addressed effectively.

We value your feedback and are committed to making your experience smooth and enjoyable. Our team is dedicated to assisting you with any needs you may have. Thank you for choosing our services. We look forward to helping you!

