---
title: Global Passport Extraction
slug: us-apis/global-passport-extraction
createdAt: 2024-06-14T09:48:25.341Z
---

# Overview

The Global Passport Extraction API is designed to provide comprehensive passport data extraction from images. This service is aimed at businesses and organizations that require quick and reliable identification and verification processes. The API extracts details such as name, passport number, date of birth, expiry date, and more, along with facial image extraction from the passport photos.

## Usecases

This API is particularly useful for:

- Identity verification processes in banking, finance, and telecommunication sectors.
- Automated check-ins in the travel and hospitality industry.
- Any system that needs to authenticate identity documents and manage client onboarding or verification remotely.

# Sample cURL

Input

:::CodeblockTabs
Pre-Production

```bash
curl --location 'https://api-preproduction.signzy.app/api/v3/global/global-passport-extraction' \
--header 'Authorization: <kong_auth_token>' \
--header 'Content-Type: application/json' \
--data '{
    "frontUrl": "URL to the front image of the passport",
    "backUrl": "URL to the back image of the passport",
    "performIdExtraction": true,
    "performFaceExtraction": true,
    "imageQualityThreshold": 0.5
    "performImageQualityAnalysis":true
}'
```

Production

```json
curl --location 'https://api.signzy.app/api/v3/global/global-passport-extraction' \
--header 'Authorization: <kong_auth_token>' \
--header 'Content-Type: application/json' \
--data '{
    "frontUrl": "URL to the front image of the passport",
    "backUrl": "URL to the back image of the passport",
    "performIdExtraction": true,
    "performFaceExtraction": true,
    "imageQualityThreshold": 0.5
    "performImageQualityAnalysis":true
}'
```
:::

## Input Mapping

| Input                         | Required                                          | Data Type | Description                                                                                                                                                                |
| ----------------------------- | ------------------------------------------------- | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `frontUrl`                    | Optional. Either front or back image is required  | string    | URL to the front image of the passport                                                                                                                                     |
| `backUrl`                     | Optional.  Either front or back image is required | string    | URL to the back image of the passport                                                                                                                                      |
| `performIdExtraction`         | Yes                                               | boolean   | Whether to perform ID extraction. All the fields part of "extractedFields" and "additionalData" comes when `performIdExtraction` is set to true                            |
| `performFaceExtraction`       | Yes                                               | boolean   | Whether to perform face extraction. "faceUrl" field will be available if set to true.                                                                                      |
| `imageQualityThreshold`       | Yes                                               | float     | Minimum quality threshold for image processing (0.0 to 1.0)<br />imageQualityFront & imageQualityBack have value related to image quality.                                 |
| `performImageQualityAnalysis` | Optional                                          | boolean   | Whether to perform image quality analysis on the given ID or not. If set to true user would be able to set `imageQualityThreshold` which they would want their ID to pass. |

## Output

:::CodeblockTabs
Output Response

```json
{
    "results": {
        "predictedIdTypeFront": "Passport",
        "predictedIdTypeBack": "Passport Side B",
        "idExpired": false,
        "extractedFields": {
            "firstName": "SHIVAM",
            "lastName": "",
            "names": "SHIVAM",
            "address": "",
            "number": "N939159",
            "DOB": "24/01/1998",
            "issuingState": "India",
            "expiryDate": "07/07/2025",
            "nationality": "IND",
            "gender": "M",
            "additionalData":  // this object changes based on the id given
            {
                "documentName": "India - Passport (2013)",
                "dateOfExpiryCheckdigit": "5",
                "remainderterm": "12",
                "age": "26",
                "finalCheckdigit": "8",
                "mrzStrings": "P<IND<<SHIVAM<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<^N0939159<1IND9801244M2507075<<<<<<<<<<<<<<<8",
                "dateOfBirthCheckdigit": "4",
                "nationalityCode": "IND",
                "documentNumberCheckdigit": "1",
                "documentClassCode": "P",
                "optionalData": "",
                "optionalDataCheckdigit": "",
                "mrzType": "ID-3",
                "nationality": "INDIAN",
                "dateOfIssue": "08/07/2015",
                "yearsSinceIssue": "8"
            }
        },
        "faceUrl": "URL to the extracted face image",
        "imageQualityFront": {
            "qualityScores": {
                "textQuality": {
                    "valid": "yes",
                    "score": "1.0"
                },
                "brightness": {
                    "valid": "yes",
                    "score": "1.0"
                },
                "sharpness": {
                    "valid": "yes",
                    "score": "1.0"
                },
                "compressionQuality": {
                    "valid": "yes",
                    "score": "0.67"
                }
            },
            "score": "0.67",
            "summary": "accept",
            "msg": "done",
            "status": "200",
            "imageQuality": "high"
        },
        "imageQualityBack": {
            "qualityScores": {
                "textQuality": {
                    "valid": "yes",
                    "score": "1.0"
                },
                "brightness": {
                    "valid": "yes",
                    "score": "1.0"
                },
                "sharpness": {
                    "valid": "yes",
                    "score": "1.0"
                },
                "compressionQuality": {
                    "valid": "yes",
                    "score": "0.64"
                }
            },
            "score": "0.64",
            "summary": "accept",
            "msg": "done",
            "status": "200",
            "imageQuality": "high"
        }
    }
}
```
:::

## Ouput Mapping

| Output                 | Data Type | Description                                          |
| ---------------------- | --------- | ---------------------------------------------------- |
| `predictedIdTypeFront` | `string`  | Predicted type of the ID document front side         |
| `predictedIdTypeBack`  | `string`  | Predicted type of the ID document back side          |
| `idExpired`            | `boolean` | Indicates if the ID document is expired              |
| `faceUrl`              | `string`  | URL to the extracted face image from the ID document |

### `extractedFields` Object

| Output         | Data Type | Description                                                       |
| -------------- | --------- | ----------------------------------------------------------------- |
| `firstName`    | `string`  | First name extracted from the ID document                         |
| `lastName`     | `string`  | Last name extracted from the ID document                          |
| `names`        | `string`  | Full name extracted from the ID document                          |
| `address`      | `string`  | Address extracted from the ID document                            |
| `number`       | `string`  | Document number extracted from the ID document                    |
| `DOB`          | `string`  | Date of Birth extracted from the ID document (format: DD/MM/YYYY) |
| `issuingState` | `string`  | Issuing state or country of the ID document                       |
| `expiryDate`   | `string`  | Expiry date of the ID document (format: DD/MM/YYYY)               |
| `nationality`  | `string`  | Nationality of the person as per the ID document                  |
| `gender`       | `string`  | Gender of the person as per the ID document                       |

### `imageQualityFront` Object

| Output                    | Data Type | Description                                                                    |
| ------------------------- | --------- | ------------------------------------------------------------------------------ |
| `textQualityValid`        | `string`  | Validity of text quality (yes/no) for the front side of the ID document        |
| `textQualityScore`        | `string`  | Score of text quality for the front side of the ID document                    |
| `brightnessValid`         | `string`  | Validity of brightness (yes/no) for the front side of the ID document          |
| `brightnessScore`         | `string`  | Score of brightness for the front side of the ID document                      |
| `sharpnessValid`          | `string`  | Validity of sharpness (yes/no) for the front side of the ID document           |
| `sharpnessScore`          | `string`  | Score of sharpness for the front side of the ID document                       |
| `compressionQualityValid` | `string`  | Validity of compression quality (yes/no) for the front side of the ID document |
| `compressionQualityScore` | `string`  | Score of compression quality for the front side of the ID document             |
| `qualityScore`            | `string`  | Overall quality score for the front side of the ID document                    |
| `summary`                 | `string`  | Summary of the quality assessment for the front side of the ID document        |
| `msg`                     | `string`  | Message regarding the quality assessment for the front side of the ID document |
| `status`                  | `string`  | Status code for the quality assessment of the front side of the ID document    |
| `imageQuality`            | `string`  | Overall image quality for the front side of the ID document (e.g., high)       |

### `imageQualityBack` Object

| Output                    | Data Type | Description                                                                   |
| ------------------------- | --------- | ----------------------------------------------------------------------------- |
| `textQualityValid`        | `string`  | Validity of text quality (yes/no) for the back side of the ID document        |
| `textQualityScore`        | `string`  | Score of text quality for the back side of the ID document                    |
| `brightnessValid`         | `string`  | Validity of brightness (yes/no) for the back side of the ID document          |
| `brightnessScore`         | `string`  | Score of brightness for the back side of the ID document                      |
| `sharpnessValid`          | `string`  | Validity of sharpness (yes/no) for the back side of the ID document           |
| `sharpnessScore`          | `string`  | Score of sharpness for the back side of the ID document                       |
| `compressionQualityValid` | `string`  | Validity of compression quality (yes/no) for the back side of the ID document |
| `compressionQualityScore` | `string`  | Score of compression quality for the back side of the ID document             |
| `qualityScore`            | `string`  | Overall quality score for the back side of the ID document                    |
| `summary`                 | `string`  | Summary of the quality assessment for the back side of the ID document        |
| `msg`                     | `string`  | Message regarding the quality assessment for the back side of the ID document |
| `status`                  | `string`  | Status code for the quality assessment of the back side of the ID document    |
| `imageQuality`            | `string`  | Overall image quality for the back side of the ID document (e.g., high)       |

### Status Codes

:::CodeblockTabs
200 (Valid Passport ID)

```json
{
    "results": {
        "predictedIdTypeFront": "Passport",
        "predictedIdTypeBack": "Passport Side B",
        "idExpired": false,
        "extractedFields": {
            "firstName": "SHIVAM",
            "lastName": "",
            "names": "SHIVAM",
            "address": "",
            "number": "N939159",
            "DOB": "24/01/1998",
            "issuingState": "India",
            "expiryDate": "07/07/2025",
            "nationality": "IND",
            "gender": "M",
            "additionalData": {  // this object changes based on the id given
                "documentName": "India - Passport (2013)",
                "dateOfExpiryCheckdigit": "5",
                "remainderterm": "12",
                "age": "26",
                "finalCheckdigit": "8",
                "mrzStrings": "P<IND<<SHIVAM<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<^N0939159<1IND9801244M2507075<<<<<<<<<<<<<<<8",
                "dateOfBirthCheckdigit": "4",
                "nationalityCode": "IND",
                "documentNumberCheckdigit": "1",
                "documentClassCode": "P",
                "optionalData": "",
                "optionalDataCheckdigit": "",
                "mrzType": "ID-3",
                "nationality": "INDIAN",
                "dateOfIssue": "08/07/2015",
                "yearsSinceIssue": "8"
            }
        },
        "faceUrl": "URL to the extracted face image",
        "imageQualityFront": {
            "qualityScores": {
                "textQuality": {
                    "valid": "yes",
                    "score": "1.0"
                },
                "brightness": {
                    "valid": "yes",
                    "score": "1.0"
                },
                "sharpness": {
                    "valid": "yes",
                    "score": "1.0"
                },
                "compressionQuality": {
                    "valid": "yes",
                    "score": "0.67"
                }
            },
            "score": "0.67",
            "summary": "accept",
            "msg": "done",
            "status": "200",
            "imageQuality": "high"
        },
        "imageQualityBack": {
            "qualityScores": {
                "textQuality": {
                    "valid": "yes",
                    "score": "1.0"
                },
                "brightness": {
                    "valid": "yes",
                    "score": "1.0"
                },
                "sharpness": {
                    "valid": "yes",
                    "score": "1.0"
                },
                "compressionQuality": {
                    "valid": "yes",
                    "score": "0.64"
                }
            },
            "score": "0.64",
            "summary": "accept",
            "msg": "done",
            "status": "200",
            "imageQuality": "high"
        }
    }
}
```

200 (Invalid Passport ID)

```json
{
    "error": {
        "name": "error",
        "message": "ID type is not a valid Passport",
        "status": 200,
        "reason": "ERROR",
        "type": "OK",
        "statusCode": 200
    }
}
```

400

```azcli

//if any of the required fields is missing
{
    "error": {
        "name": "error",
        "message": "Input Validation Error",
        "status": 400,
        "reason": "ERROR",
        "type": "Bad Request",
        "statusCode": 400
    }
}

//when input image quality threshold is higher than the output image quality

{
    "error": {
        "name": "error",
        "message": "Image quality threshold not met",
        "status": 400,
        "reason": "ERROR",
        "type": "Bad Request",
        "statusCode": 400
    }
}

//when the image link is not accessible (either expired or not a valid image URL) 

{
    "error": {
        "name": "error",
        "message": "Unprocessable Image. Please try again with a different one",
        "status": 400,
        "reason": "ERROR",
        "type": "Bad Request",
        "statusCode": 400
    }
}
```

409

```json
//Error in service from upstream
{
    "error": {
        "reason": "Error From Upstream",
        "status": 409,
        "message": "Unable to get response from upstream",
        "type": "Conflict",
        "statusCode": 409,
        "name": "error"
    }
}
```

500

```json
{
    "error": {
        "name": "error",
        "status": 500,
        "message": "ERROR",
        "reason": "ERROR",
        "type": "Internal Server Error",
        "statusCode": 500
    }
}
```

401

```json
// Auth Token is invalid
{
    "message": "Invalid authentication credentials"
}
```
:::

:::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](#). 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!
:::

