---
title: Single KYC Extraction
slug: api-marketplace/single-kyc-extraction
createdAt: 2024-03-11T12:10:41.348Z
---

## Introduction


This API allow users to extract information from different ID cards available in the country (currently supports only 'India'). In addition to extracting information from the image, the API employs Al analysis to determine the type of ID and return the same in idType.

***

## API details

### Endpoint

:::CodeblockTabs
Production Environment

```jsx
https://api.signzy.app/api/v3/single-kyc/extraction
```
:::

:::CodeblockTabs
Production Environment

```jsx
https://api-preproduction.signzy.app/api/v3/single-kyc/extraction
```
:::

***

### 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         | A list of URL of the ID images. <br />Acceptable image format TIFF/TIF, JPEG/JPG, PNG, PDF(maximum 2 pages). | Mandatory    |
| country       | String        | Country of Origin of the ID.                                                                                 | Mandatory    |
| idType        | String        | Type of Indian ID                                                                                            | Optional     |

```json
//When passing single URL
{
    "urls": [
        "https://preproduction-persist.signzy.tech/api/files/25535717/download/163.jpg"
    ],
    "country": "India",
    "idType": ""
}

// When passing 2 URLs
{
    "urls": [
        "https://persist.signzy.tech/api/files/1516836988/download/XXXX.png", 
        "https://persist.signzy.tech/api/files/1516836478/download/XXXX.png"
    ],
    "country": "India",
    "idType": ""
}
```

***

### Code samples

:::CodeblockTabs
```curl
curl --location 'https://api-preproduction.signzy.app/api/v3/single-kyc/extraction' \
--header 'Content-Type: application/json' \
--header 'Authorization: < Auth Key >' \
--data '{
    "urls": [
        "https://preproduction-persist.signzy.tech/api/files/25535717/download/163.jpg"
    ],
    "country": "India",
    "idType": ""
}'
```

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

let config = {
  method: 'post',
  maxBodyLength: Infinity,
  url: 'https://api-preproduction.signzy.app/api/v3/single-kyc/extraction',
  headers: { 
    'Content-Type': 'application/json', 
    'Authorization': '< Auth Key >'
  },
  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/25535717/download/163.jpg"
  ],
  "country": "India"
})
headers = {
  'Content-Type': 'application/json',
  'Authorization': '< Auth Key >'
}
conn.request("POST", "/api/v3/single-kyc/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/single-kyc/extraction"
  method := "POST"

  payload := strings.NewReader(`{
    "urls": [
        "https://preproduction-persist.signzy.tech/api/files/25535717/download/163.jpg"
    ],
    "country": "India"
}`)

  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", "< Auth Key >")

  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                                                                  |
| -------------------------------- | --------- | ---------------------------------------------------------------------------- |
| `requestId`                      | String    | Unique identifier of the API request.                                        |
| `idType`                         | String    | Type of ID card as fetched after Al analysis, e.g. :  business PAN, aadhaar. |
| `extractedFields`                | Object    | Object containing all the extracted fields from the ID                       |
| `extractedFields.name`           | String    | Name of the person in the ID                                                 |
| `extractedFields.dob`            | String    | Date of birth of the person in the ID                                        |
| `extractedFields.idNumber`       | String    | Unique Identification number of the ID                                       |
| `extractedFields.guardianName`   | String    | Guardian name of the person in the ID                                        |
| `extractedFields.gender`         | String    | Gender of the person in the ID                                               |
| `extractedFields.additionalData` | Object    | Object containing additional data related to the ID                          |

:::CodeblockTabs
200

```json
{
    "requestId": "8241ef77-0596-42f5-b78a-b4db98f20cc6",
    "idType": "businessPan",
    "extractedFields": {
        "name": "XXXXX XXXXX",
        "dob": "DD/MM/YYYY",
        "idNumber": "xxxxxxxxx",
        "guardianName": "XXXXX XXXXX",
        "gender": "XXXX",
        "additionalData": {
            "dateOfIssue": "DD/MM/YYYY"
        }
    }
}
```

401

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

422

```azcli
{
  "error": {
       "status": 422,
       "msg": "The pdf file contains more than 2 pages"
     }
}
```

413

```azcli
{
  "error": {
       "status": 413, 
       "msg": "The file size is greater than 5 MB"
     }
}
```

409

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

400

```json
// When detected id type does not match id type given by user
{
  "error": {
     "status": 400,
     "msg": "The ID Type does not match detected ID(s)",
            }
}

// When both uploaded id's are not same. 
{
  "error": {
      "status": 400,
      "msg": "Both uploaded ids are different.",
            }
}
```
:::

### Instruction: Passing Multiple URLs in the urls Input

To pass multiple URLs, provide them as an **array of strings** in the urls field. Each URL should be enclosed in double quotes and separated by a comma.

Example

:::BlockQuote
\{
&#x20; "urls": \[
&#x20;   "https\://persist.signzy.tech/api/files/1516836988/download/ee2bfcba2c5d41f4a7054c57a89b12e2d60d6dbe9f8146bdb845dd024e820b11.png",
&#x20;   "https\://persist.signzy.tech/api/files/1516836478/download/2bfc6e89289b41ffa43829e14cd005f13879d67d16614b7d8c25fb1029e45c38.png"
&#x20; ]
}
:::

**Important Notes**

- The urls field **must be an array**.&#x20;
- Each element in the array should be a **valid URL string**.&#x20;
- You can pass **one or multiple URLs** in the same request.

**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!
