---
title: Extraction API
slug: v2-apis/bVrQ-extraction-api
description: Learn how to use the Extraction API to easily extract details from passports including name, date of issue, and place of issue. This document includes step-by-step instructions for calling the API, guidelines for inputting data, and comprehensive code exa
createdAt: 2022-09-19T07:28:09.000Z
---

# Introduction

The Extraction API is used to extract details from the Passport such as Name, Date of Issue, place of issue etc. Both front and back side images are mandatory for Passport Extraction.

## How to call the API

You will need to [login](https://docs.signzy.com/sandboxapis) before sending the request. You are required to pass the access token received from the login call, as authorization header in the Extraction API request.

## API Input Guidelines

For best results, please make sure the image you use fits tightly in camera view and is horizontally-aligned. Each image/pdf should be less than 2MB.

&#x20;           Though this engine supports extraction of images as well as pdf files, our test results indicate that there is much better accuracy and faster response time for image extraction. We would suggest you to pass only image file for better results. For pdf files extacrtion, you can use our pdf to image converter API and then pass the resulted image file in this extraction engine.Pdf to Image(JPG).

## Sample Curl

:::ApiMethodV2
```json
{
  "tab": "examples",
  "url": "https://preproduction.signzy.tech/api/v2/patrons/<patron ID>/passportV2",
  "name": "Passport Extraction",
  "method": "POST",
  "request": {
    "pathParameters": [],
    "queryParameters": [],
    "headerParameters": [
      {
        "kind": "required",
        "name": "Authorization",
        "type": "string",
        "children": [],
        "description": "Contains the id parameter returned from the login step"
      },
      {
        "kind": "required",
        "name": "content-type",
        "type": "string",
        "children": [],
        "description": "Application/JSON"
      }
    ],
    "bodyDataParameters": [
      {
        "kind": "required",
        "name": "task",
        "type": "string",
        "description": "Task- Extracting Passport Data"
      },
      {
        "kind": "required",
        "name": "essentials",
        "type": "Object",
        "children": [
          {
            "kind": "optional",
            "name": "essentials.images",
            "type": "string",
            "description": "Front and back image url of passport"
          }
        ],
        "description": "Essential part of the request"
      }
    ],
    "formDataParameters": []
  },
  "results": {
    "languages": [
      {
        "id": "HwmUDfR6MGSUZ1hXJqF9C",
        "code": "{\n    \"essentials\": {\n        \"images\": [\n            \"front image url\",\n            \"back image url\"\n        ]\n    },\n    \"id\": \"\",\n    \"patronId\": \"\",\n    \"task\": \"extraction\",\n    \"result\": {\n        \"parentsGuardianName\": \"\",\n        \"issueDate\": \"\",\n        \"expiryDate\": \"\",\n        \"birthDate\": \"\",\n        \"name\": \"\",\n        \"country\": [\n            \"IN\",\n            \"IND\",\n            \"India\"\n        ],\n        \"nationality\": \"INDIAN\",\n        \"sex\": \"\",\n        \"address\": \"\",\n        \"pincode\": \"\",\n        \"passportNumber\": \"\",\n        \"fileNumber\": \"\",\n        \"placeOfBirth\": \"\",\n        \"placeOfIssue\": \"\",\n        \"splitAddress\": {\n            \"district\": [\n                \"\"\n            ],\n            \"state\": [\n                [\n                    \"\",\n                    \"\"\n                ]\n            ],\n            \"city\": [\n                \"\"\n            ],\n            \"pincode\": \"\",\n            \"country\": [\n                \"IN\",\n                \"IND\",\n                \"INDIA\"\n            ],\n            \"addressLine\": \"\"\n        },\n        \"summary\": {\n            \"number\": \"\",\n            \"name\": \"\",\n            \"dob\": \"\",\n            \"address\": \"\",\n            \"splitAddress\": {\n                \"district\": [\n                    \"\"\n                ],\n                \"state\": [\n                    [\n                        \"\",\n                        \"\"\n                    ]\n                ],\n                \"city\": [\n                    \"\"\n                ],\n                \"pincode\": \"\",\n                \"country\": [\n                    \"IN\",\n                    \"IND\",\n                    \"INDIA\"\n                ],\n                \"addressLine\": \"\"\n            },\n            \"gender\": \"\",\n            \"guardianName\": \"\",\n            \"issueDate\": \"\",\n            \"expiryDate\": \"\"\n        }\n    }\n}",
        "language": "200",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "HwmUDfR6MGSUZ1hXJqF9C"
  },
  "examples": {
    "languages": [
      {
        "id": "fd5w95wjhzpjajGys3uw0",
        "code": "curl --location --request POST 'https://preproduction.signzy.tech/api/v2/patrons/<patron ID>/passportV2' \\\n\n--header 'Authorization: <token>' \\\n--header 'content-type: application/json' \\\n--data-raw '{\n    \"task\": \"extraction\",\n    \"essentials\": {\n        \"images\": [\n            \".....upload front image....\",\n            \".....upload back image....\"\n        ]\n    }\n}'",
        "language": "curl",
        "customLabel": "Preproduction"
      },
      {
        "id": "DhIk9BpDW7AZoOrVysBVb",
        "code": "curl --location --request POST 'https://signzy.tech/api/v2/patrons/<patron ID>/passportV2' \\\r\n\r\n--header 'Authorization: <token>' \\\r\n--header 'content-type: application/json' \\\r\n--data-raw '{\r\n    \"task\": \"extraction\",\r\n    \"essentials\": {\r\n        \"images\": [\r\n            \".....upload front image....\",\r\n            \".....upload back image....\"\r\n        ]\r\n    }\r\n}'",
        "language": "curl",
        "customLabel": "Production"
      }
    ],
    "selectedLanguageId": "DhIk9BpDW7AZoOrVysBVb"
  },
  "description": "Extracting Passport Data",
  "currentNewParameter": {
    "label": "Body Parameter",
    "value": "bodyDataParameters"
  }
}
```
:::

### Response Parameter

| ***Parameter Name&#x20;***              | **Description**                                            |
| --------------------------------------- | ---------------------------------------------------------- |
| essentials                              | Essential part of the request                              |
| essentials.images                       | URL of images                                              |
| id                                      | Unique user ID                                             |
| patronId                                | Unique PatronID                                            |
| task                                    | The type of task performed - “extraction”                  |
| result                                  | It is the actual result of the API                         |
| result.parentsGuardianName              | Parents or guardian name of passport holder                |
| result.issueDate                        | Date of issue of passport                                  |
| result.expiryDate                       | Date of expiry of passport                                 |
| result.birthDate                        | Date of birth of the Passport holder                       |
| result.name                             | Name of the passport holder                                |
| result.country                          | Country to which passport holder belongs to                |
| result.nationality                      | Nationality of passport holder                             |
| result.sex                              | Gender of passport holder                                  |
| result.address                          | Address of passport holder                                 |
| result.pincode                          | Area pincode corresponding to passport holder<br />address |
| result.passportNumber                   | Passport number of the passport                            |
| result.fileNumber                       | File number corresponding to the passport issued           |
| result.placeOfBirth                     | Place of birth of Passport holder.                         |
| result.placeOfIssue                     | Place of issue of the passport                             |
| result.splitAddress                     | Address of passport holder                                 |
| result.splitAddress.district            | District in which the address mentioned lies.              |
| result.splitAddress.state               | State to which the mentioned address belongs.              |
| result.splitAddress.city                | City mentioned in address                                  |
| result.splitAddress.pincode             | Area pincode of address mentioned                          |
| result.splitAddress.country             | Country to which address belongs                           |
| result.splitAddress.addressLine         | Contains the first Line of  address                        |
| result.summary                          | Summary of OCR output for given input                      |
| result.summary.number                   | Passport Number                                            |
| result.summary.name                     | Name of passport holder                                    |
| result.summary.dob                      | Date of birth of passport holder                           |
| result.summary.address                  | Address of passport holder                                 |
| result.summary.splitAddress             | Address of passport holder                                 |
| result.summary.splitAddress.district    | District to which address belongs to                       |
| result.summary.splitAddress.state       | State to which address belongs                             |
| result.summary.splitAddress.city        | City mentioned in address                                  |
| result.summary.splitAddress.pincode     | Area pincode of address mentioned                          |
| result.summary.splitAddress.country     | Country to whicn address belongs                           |
| result.summary.splitAddress.addressLine | first line of address shown here                           |
| result.summary.gender                   | Gender of Passport holder                                  |
| result.summary.guardianName             | Guardian name of passport holder.                          |
| result.summary.issueDate                | Date of issue of passport holder                           |
| result.summary.expiryDate               | Date of expiry of passport                                 |

***

:::hint{type="info"}
### Getting help

Please feel free to contact us if you have any questions, require clarification, or have ideas for how to make the documents or any of our services better.


You can reach out to us at [help@signzy.com](mailto\:help@signzy.com).
:::

