PassportEye API response documentationΒΆ

Here’s an example response you can get from PasswordEye:

{
  "ela": {
    "max_diff": 6
  },
  "exif": {},
  "mrz": {
    "bounding_box": [
      [
        309.5091162700831,
        19.500000612510348
      ],
      [
        309.5091162700831,
        234.50171538138144
      ],
      [
        274.4909911642962,
        234.50171538138144
      ],
      [
        274.4909911642962,
        19.500000612510348
      ]
    ],
    "check_composite": "0",
    "check_date_of_birth": "2",
    "check_expiration_date": "4",
    "check_number": "6",
    "country": "LVA",
    "date_of_birth": "821212",
    "expiration_date": "170305",
    "method": "direct",
    "mrz_type": "TD1",
    "names": "ANDRIS",
    "nationality": "LVA",
    "number": "PA9992921",
    "optional1": "121282<88882<<<",
    "optional2": "<<<<<<<<<<<",
    "sex": "M",
    "surname": "PARAUDZINS",
    "type": "I<",
    "valid_composite": true,
    "valid_date_of_birth": true,
    "valid_expiration_date": true,
    "valid_number": true,
    "valid_score": 100
  }
}

The JSON schema is as follows:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "Image trust score and scoring data",
  "description": "This JSON contains trust score and trust scoring data that was derived from an image passed to PassportEye",
  "type": "object",
  "properties": {
    "ela": {
        "type": "object",
        "description": "Error Level Analysis score data",
        "properties": {
            "max_diff": {
                "type": "integer",
                "description": "Error Level Analysis score. Currently, returns the biggest peak from all ELA peaks encountered."
            }
        }
    },
    "exif": {
        "type": "object",
        "description": "EXIF data from the submitted image as key-value pairs. The data is taken directly from the photo, so the contained keys can be different, depending on what EXIF information is present.",
        "properties": {}
    },
    "mrz": {
        "type": "object",
        "description": "Decoded Machine Readable Zone data",
        "properties": {
            "bounding_box": {
                "description": "Coordinates for bounding box for MRZ",
                "type": "array",
                "items": [
                    [
                      {
                        "type": "array",
                        "description": "X and Y coordinates for top right corner of bounding box",
                        "items": {
                          "type": "number"
                        }
                      },
                      {
                        "type": "array",
                        "description": "X and Y coordinates for bottom right corner of bounding box",
                        "items": {
                          "type": "number"
                        }
                      },
                      {
                        "type": "array",
                        "description": "X and Y coordinates for bottom left corner of bounding box",
                        "items": {
                          "type": "number"
                        }
                      },
                      {
                        "type": "array",
                        "description": "X and Y coordinates for top left corner of bounding box",
                        "items": {
                          "type": "number"
                        }
                      }
                    ]
                ]
            },
            "check_composite": {
                "description": "Composite MRZ checksum as parsed from MRZ",
                "type": "string"
            },
            "check_date_of_birth": {
                "description": "Date of birth checksum as parsed from MRZ",
                "type": "string"
            },
            "check_expiration_date": {
                "description": "Expiration date checksum as parsed from MRZ",
                "type": "string"
            },
            "check_number": {
                "description": "Personal number checksum as parsed from MRZ",
                "type": "string"
            },
            "country": {
                "description": "Country code",
                "type": "string"
            },
            "date_of_birth": {
                "description": "Date of birth in DDMMYY format",
                "type": "string"
            },
            "expiration_date": {
                "description": "Expiration date in DDMMYY format",
                "type": "string"
            },
            "method": {
                "description": "",
                "type": "string"
            },
            "mrz_type": {
                "description": "MRZ type",
                "type": "string",
                "enum": ["TD1", "TD2", "TD3", "MRVA", "MRVB"]
            },
            "names": {
                "description": "First name",
                "type": "string"
            },
            "nationality": {
                "description": "",
                "type": "string"
            },
            "number": {
                "description": "",
                "type": "string"
            },
            "optional1": {
                "description": "Optional MRZ field that may or may not contain useful information",
                "type": "string"
            },
            "optional2": {
                "description": "Optional MRZ field that may or may not contain useful information",
                "type": "string"
            },
            "sex": {
                "description": "Sex",
                "type": "string"
            },
            "surname": {
                "description": "Last name",
                "type": "string"
            },
            "type": {
                "description": "MRZ document type field contents",
                "type": "string"
            },
            "valid_composite": {
                "description": "Composite checksum alidity",
                "type": "boolean"
            },
            "valid_date_of_birth": {
                "description": "Date of birth checksum validity",
                "type": "boolean"
            },
            "valid_expiration_date": {
                "description": "Expiration date checksum validity",
                "type": "boolean"
            },
            "valid_number": {
                "description": "Personal number validity score calculated ",
                "type": "boolean"
            },
            "valid_score": {
                "description": "The MRZ trust score calculated. Is calculated based on valid_* fields, ",
                "type": "integer"
            }
        }
    }
  }
}