---
title: Voter ID Extraction
slug: api-marketplace/voter-id-extraction
createdAt: 2023-11-02T11:46:52.780Z
---

## Introduction

The Voter ID Extraction API is specifically developed to process and extract data from Voter ID images. Upon receiving the URL of the Voter ID image, the API adeptly returns structured data, encompassing key information such as the voter's name, age, Voter ID number, address, and other pertinent details.

**Performance metrics:**

95% of responses within 4.5 secs.

Accuracy: 92%

***

## API details

### Endpoint

:::CodeblockTabs
Production Environment

```jsx
POST https://api.signzy.app/api/v3/voter-id/extractions
```
:::

:::CodeblockTabs
UAT/Testing environment

```jsx
POST https://api-preproduction.signzy.app/api/v3/voter-id/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** |
| ------------- | ---------------- | --------------------------------------------------------- | ------------ |
| urls          | Array of Strings | An array containing the URL of the files being extracted. | Mandatory    |

```json
{
    "urls": [
        "https://preproduction-persist.signzy.tech/api/files/39733945/download/000000.pdf"
    ]
}
```

***

### Code samples

:::CodeblockTabs
```curl
curl --location 'https://api-preproduction.signzy.app/api/v3/voter-id/extractions' \
--header 'Content-Type: application/json' \
--header 'Authorization: <Your access token>' \
--data '{
    "urls": [
        "https://preproduction-persist.signzy.tech/api/files/39733945/download/000000.pdf"
    ]
}'
```

```nodejs
const axios = require('axios');
let data = JSON.stringify({
  "urls": [
    "https://preproduction-persist.signzy.tech/api/files/39733945/download/000000.pdf"
  ]
});

let config = {
  method: 'post',
  maxBodyLength: Infinity,
  url: 'https://api-preproduction.signzy.app/api/v3/voter-id/extractions',
  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({
  "urls": [
    "https://preproduction-persist.signzy.tech/api/files/39733945/download/000000.pdf"
  ]
})
headers = {
  'Content-Type': 'application/json',
  'Authorization': '<Your access token>'
}
conn.request("POST", "/api/v3/voter-id/extractions", 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/voter-id/extractions"
  method := "POST"

  payload := strings.NewReader(`{
    "urls": [
        "https://preproduction-persist.signzy.tech/api/files/39733945/download/000000.pdf"
    ]
}`)

  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**                                                                          |
| ------------------------------- | ---------------- | ---------------------------------------------------------------------------------------- |
| result                          | Object           | Contains the result of extraction.                                                       |
| result.status                   | String           | Status code of the response.                                                             |
| result.name                     | String           | Name of the individual.                                                                  |
| result.fatherName               | String           | Father's name.                                                                           |
| result.address                  | String           | Full address of the individual.                                                          |
| result.state                    | String           | State.                                                                                   |
| result.ageAsOn                  | String           | Age of the individual as on certain date.                                                |
| reslut.dateOfIssue              | String           | Date of issue of the voter ID.                                                           |
| result.dob                      | String           | Date of birth of the individual in format DD/MM/YYYY.                                    |
| result.gender                   | String           | Gender of the individual.<br />The possible response values are:<br />MALE,<br />FEMALE. |
| result.yob                      | String           | Year of birth of the individual.                                                         |
| result.epicNumber               | String           | EPIC (Electoral Photo Identity Card) number.                                             |
| 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           | Full address line.                                                                       |
| result.msg                      | String           | Message regarding the status of extraction.                                              |
| url                             | Array of Strings | Array containing the URL of the files being extracted.                                   |

:::CodeblockTabs
200

```json
{
    "result": {
        "status": "200",
        "name": "Name",
        "fatherName": "Relative Name",
        "address": "Full address",
        "state": "State",
        "ageAsOn": "Age",
        "dateOfIssue": "",
        "dob": "DD/MM/YYYY",
        "gender": "MALE",
        "yob": "YYYY",
        "epicNumber": "XXX0000000",
        "splitAddress": {
            "district": [],
            "state": [
                []
            ],
            "city": [],
            "pincode": "000000",
            "country": [
                "IN",
                "IND",
                "INDIA"
            ],
            "addressLine": "Address Line"
        },
        "msg": "success"
    },
    "url": [
        "https://preproduction-persist.signzy.tech/api/files/39733945/download/0000000.pdf"
    ]
}
```

422

```json
//required field missing
{
    "error": {
        "name": "Not all fields are present",
        "status": 422,
        "message": "urls field is compulsory, of type list"
    }
}

// invalid url
{
    "error": {
        "name": "image invalid",
        "status": 422,
        "message": "Some URLs contain invalid file type"
    }
}

```

401

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

***

### Document Related Constraints

:::hint{type="danger"}
The size of the document should not exceed **2 MB**.

Provide both front and back side images to extract all the data.

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

Supported document types:

- Image - JPEG, JPG, PNG and TIFF/TIF.
- Single page PDF - 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!

