Passport
    • PDF

    Passport

    • PDF

    Article summary

    Available in Classic and VPC

    Recognize and extract key-value input information from passports (Korean) using a specialized model engine.

    Request

    This section describes the request format. The method and URI are as follows:

    MethodURI
    POST/id-card

    Request headers

    For information about the headers common to all CLOVA OCR APIs, see CLOVA OCR request headers.

    Request body

    You can include the following data in the body of your request:

    If Content-Type: application/json

    You can include the following data in the body of your request if the request header's Content-Type is application/json:

    FieldTypeRequiredDescription
    versionString-Version information
    • Only use V2
    requestIdStringRequiredRandom API call UUID
    timestampIntegerRequiredRandom API call time (timestamp)
    imagesArrayRequiredimages details

    If Content-Type: multipart/form-data

    You can include the following data in the body of your request if the request header's Content-Type is multipart/form-data:

    FieldTypeRequiredDescription
    messageObjectRequiredRequest data information
    message.versionStringRequiredVersion information
    • Only use V2
    message.requestIdStringRequiredRandom API call UUID
    message.timestampIntegerRequiredRandom API call time (timestamp)
    message.imagesArrayRequiredimages details
    fileFileRequiredOCR recognition image file

    images

    The following describes images.

    FieldTypeRequiredDescription
    formatStringRequiredImage format
    • jpg | jpeg | png | pdf | tif | tiff
      • Image: jpg, jpeg, png
      • Single page: pdf, tif, tiff
    • Select and enter one of the image formats
    nameStringRequiredRandom image name
    • Use to identify images and check response results
    dataStringRequiredBase64-encoded image data
    • Can be entered if Content-Type: application/json

    Request example

    The request example is as follows:

    If Content-Type: application/json

    The request example if the request header's Content-Type is application/json is as follows:

    curl --location --request POST 'https://cbgrx5natw.apigw.ntruss.com/custom/v1/{DomainId}/{InvokeKey}/document/id-card' \
    --header 'Content-Type: application/json' \
    --header 'X-OCR-SECRET: {Secret key issued when registering the app}' \
    --data '{
        "version": "V2",
        "requestId": "string",
        "timestamp": 0,
        "images": [
            { 
                "format": "png", 
                "name": "passport_test", 
                "data":"{Base64-encoded image data}"
            }
        ]
     }'
    

    If Content-Type: multipart/form-data

    The request example if the request header's Content-Type is multipart/form-data is as follows:

    curl --location --request POST 'https://cbgrx5natw.apigw.ntruss.com/custom/v1/{DomainId}/{InvokeKey}/document/id-card' \
    --header 'Content-Type: application/json' \
    --header 'X-OCR-SECRET: {Secret key issued when registering the app}' \
    --form 'message="{\"version\": \"V2\", \"requestId\": \"1234\", \"timestamp\": 0, \"images\": [{\"format\": \"png\", \"name\": \"passport_test\"}]}"' \
    --form 'file=@"{file}"'
    

    Response

    This section describes the response format.

    Response body

    The response body includes the following data:

    FieldTypeRequiredDescription
    versionString-Version information
    • Only use V2
    requestIdString-Random API call UUID
    timestampInteger-API call time (timestamp)
    imagesArray-images details

    images

    The following describes images.

    FieldTypeRequiredDescription
    uidString-Passport image UID
    • Use for API validity checks
    nameString-Passport image name
    • Use to identify images and check response results
    inferResultString-Passport image recognition result
    • SUCCESS | FAILURE | ERROR
      • SUCCESS: recognition successful
      • FAILURE: recognition failure
      • ERROR: recognition processing exception
    messageString-Result message
    validationResultObject-Validity check result information
    validationResult.resultString-Validity check result code
    • NO_REQUESTED | UNCHECKED | ERROR | VALID | INVALID
      • NO_REQUESTED: no validation action requested (validity check failed)
      • UNCHECKED: unable to verify validation
      • ERROR: error on validation (validity check failed)
      • VALID: validation result valid (validity check succeeded)
      • INVALID: failed to pass validation
    validationResult.messageString-Validity check result details message
    • This value is not always returned
    convertedImageInfoObject-Converted image information
    • If format is pdf or tiff
    • Coordinate values are set relative to the called image file
    convertedImageInfo.widthInteger-Converted image width
    convertedImageInfo.heightInteger-Converted image height
    convertedImageInfo.pageIndexInteger-Converted image page index
    idCardObject-ID card details
    idCard.metaObject-Meta information
    idCard.meta.estimatedLanguageString-OCR estimated language
    • ko | en | ja
      • ko:Korean
      • en: English
      • ja: Japanese
    idCard.resultObject-ID card OCR recognition result

    result

    The following describes result.

    FieldTypeRequiredDescription
    isConfidentBoolean-Whether it has details for each type
    • true | false
      • true: has
      • false: doesn't have
    ppObject-Passport information
    pp.typeArray-Passport type details
    pp.issueCountryArray-Passport issuance country details
    pp.numArray-Passport number details
    pp.surNameArray-Last name details
    pp.givenNameArray-Name details
    pp.nationalityArray-Nationality details
    pp.birthDateArray-Date of birth details
    pp.sexArray-Gender details
    pp.issueDateArray-Issuance date details
    pp.expireDateArray-Expiration date details
    pp.authorityArray-Issuing authority details
    pp.fullNameKorArray-Full name details
    pp.mrz1Array-Machine readable zone 1 details
    pp.mrz2Array-Machine readable zone 2 details
    roisArray-Object border position information
    idTypeString-ID card type
    • Passport

    type

    The following describes pp.type.

    FieldTypeRequiredDescription
    textString-Recognized type text
    formattedObject-Recognized type text information
    formatted.valueString-Recognized type text value
    keyTextString-Key value of recognized type text
    confidenceScoreFloat-Confidence of recognized type text
    • 0 - 1
    • The higher the confidence value, the more accurate the text is
    boundingPolysArray-boundingPoly details
    maskingPolysArray-maskingPoly details

    issueCountry

    The following describes pp.issueCountry.

    FieldTypeRequiredDescription
    textString-Recognized issuing country text
    keyTextString-Key value of recognized issuing country text
    confidenceScoreFloat-Confidence of recognized issuing country text
    • 0 - 1
    • The higher the confidence value, the more accurate the text is
    boundingPolysArray-boundingPoly details

    num

    The following describes pp.num.

    FieldTypeRequiredDescription
    textString-Recognized number text
    formattedObject-Recognized number text information
    formatted.valueString-Recognized number text value
    keyTextString-Key value of recognized number text
    confidenceScoreFloat-Confidence of recognized number text
    • 0 - 1
    • The higher the confidence value, the more accurate the text is
    boundingPolysArray-boundingPoly details
    maskingPolysArray-maskingPoly details

    name

    The following describes pp.surName and pp.GivenName.

    FieldTypeRequiredDescription
    textString-Recognized name text
    formattedObject-Recognized name text information
    formatted.valueString-Recognized name text value
    keyTextString-Key value of recognized name text
    confidenceScoreFloat-Confidence of recognized name text
    • 0 - 1
    • The higher the confidence value, the more accurate the text is
    boundingPolysArray-boundingPoly details
    maskingPolysArray-maskingPoly details

    nationality

    The following describes pp.nationality.

    FieldTypeRequiredDescription
    textString-Recognized nationality text
    formattedObject-Recognized nationality text information
    formatted.valueString-Recognized nationality text value
    keyTextString-Key value of recognized nationality text
    confidenceScoreFloat-Confidence of recognized nationality text
    • 0 - 1
    • The higher the confidence value, the more accurate the text is
    boundingPolysArray-boundingPoly details
    maskingPolysArray-maskingPoly details

    Date object information

    The following describes the date object.

    FieldTypeRequiredDescription
    textString-Recognized date text
    formattedObject-Recognized date text information
    formatted.yearString-Year (yyyy) of recognized date
    formatted.monthString-Month (MM) of recognized date
    formatted.dayString-Day (dd) of recognized date
    keyTextString-Key value of recognized date text
    confidenceScoreFloat-Confidence of recognized date text
    • 0 - 1
    • The higher the confidence value, the more accurate the text is
    boundingPolysArray-boundingPoly details
    maskingPolysArray-maskingPoly details

    condition

    The following describes pp.condition.

    FieldTypeRequiredDescription
    textString-Recognized condition text
    keyTextString-Key value of recognized condition text
    confidenceScoreFloat-Confidence of recognized condition text
    • 0 - 1
    • The higher the confidence value, the more accurate the text is
    boundingPolysArray-boundingPoly details
    maskingPolysArray-maskingPoly details

    sex

    The following describes pp.sex.

    FieldTypeRequiredDescription
    textString-Recognized gender text
    formattedObject-Recognized gender text information
    formatted.valueString-Recognized gender text value
    keyTextString-Key value of recognized gender text
    confidenceScoreFloat-Confidence of recognized gender text
    • 0 - 1
    • The higher the confidence value, the more accurate the text is
    boundingPolysArray-boundingPoly details
    maskingPolysArray-maskingPoly details

    organDonation

    The following describes pp.organDonation.

    FieldTypeRequiredDescription
    textString-Recognized organ and tissue donation text
    keyTextString-Key value of recognized organ and tissue donation text
    confidenceScoreFloat-Confidence of recognized organ and tissue donation text
    • 0 - 1
    • The higher the confidence value, the more accurate the text is
    boundingPolysArray-boundingPoly details
    maskingPolysArray-maskingPoly details

    authority

    The following describes pp.authority.

    FieldTypeRequiredDescription
    textString-Recognized issuing authority text
    keyTextString-Key value of recognized issuing authority text
    confidenceScoreFloat-Confidence of recognized issuing authority text
    • 0 - 1
    • The higher the confidence value, the more accurate the text is
    boundingPolysArray-boundingPoly details

    fullNameKor

    The following describes pp.fullNameKor.

    FieldTypeRequiredDescription
    textString-Recognized full name text
    formattedObject-Recognized full name text information
    formatted.valueString-Recognized full name text value
    keyTextString-Key value of recognized full name text
    confidenceScoreFloat-Confidence of recognized full name text
    • 0 - 1
    • The higher the confidence value, the more accurate the text is
    boundingPolysArray-boundingPoly details
    maskingPolysArray-maskingPoly details

    mrz

    The following describes mrz.

    FieldTypeRequiredDescription
    textString-Recognized MRZ text
    formattedObject-Recognized MRZ text information
    formatted.valueString-Recognized MRZ text value
    keyTextString-Key value of recognized MRZ text
    confidenceScoreFloat-Confidence of recognized MRZ text
    • 0 - 1
    • The higher the confidence value, the more accurate the text is
    boundingPolysArray-boundingPoly details
    maskingPolysArray-maskingPoly details

    rois

    The following describes rois.

    FieldTypeRequiredDescription
    FieldTypeRequiredDescription
    ------------
    xFloat-Object border position X-axis coordinate value
    yFloat-Object border position Y-axis coordinate value

    boundingPolys

    The following describes boundingPolys.

    FieldTypeRequiredDescription
    verticesArray-vertices details

    maskingPolys

    The following describes maskingPolys.

    FieldTypeRequiredDescription
    verticesArray-vertices details

    boundingPolyVertices

    The following describes boundingPolyVertices.

    FieldTypeRequiredDescription
    xFloat-X-axis coordinate value
    yFloat-Y-axis coordinate value

    Response status codes

    For response status codes common to all CLOVA OCR APIs, see Common CLOVA OCR response status codes.

    Response example

    The response example is as follows:

    Success

    The following is a sample response upon a successful call.

    {
        "version": "V2",
        "requestId": "1234",
        "timestamp": 1725412120101,
        "images": [
            {
                "uid": "{uid}",
                "name": "passport_test",
                "inferResult": "SUCCESS",
                "message": "SUCCESS",
                "validationResult": {
                    "result": "NO_REQUESTED"
                },
                "idCard": {
                    "meta": {
                        "estimatedLanguage": "ko"
                    },
                    "result": {
                        "isConfident": true,
                        "pp": {
                            "type": [
                                {
                                    "text": "PM",
                                    "formatted": {
                                        "value": "PM"
                                    },
                                    "keyText": "",
                                    "confidenceScore": 0.0,
                                    "boundingPolys": [
                                        {
                                            "vertices": [
                                                {
                                                    "x": 187.23215,
                                                    "y": 428.7616
                                                },
                                                {
                                                    "x": 206.57947,
                                                    "y": 428.7616
                                                },
                                                {
                                                    "x": 206.57947,
                                                    "y": 439.99554
                                                },
                                                {
                                                    "x": 187.23215,
                                                    "y": 439.99554
                                                }
                                            ]
                                        }
                                    ],
                                    "maskingPolys": []
                                }
                            ],
                            "issueCountry": [
                                {
                                    "text": "KOR",
                                    "keyText": "",
                                    "confidenceScore": 0.0,
                                    "boundingPolys": [
                                        {
                                            "vertices": [
                                                {
                                                    "x": 234.04018,
                                                    "y": 428.7616
                                                },
                                                {
                                                    "x": 260.8768,
                                                    "y": 428.7616
                                                },
                                                {
                                                    "x": 260.8768,
                                                    "y": 439.99554
                                                },
                                                {
                                                    "x": 234.04018,
                                                    "y": 439.99554
                                                }
                                            ]
                                        }
                                    ]
                                }
                            ],
                            "num": [
                                {
                                    "text": "M123A****",
                                    "formatted": {
                                        "value": "M123A****"
                                    },
                                    "keyText": "",
                                    "confidenceScore": 0.0,
                                    "boundingPolys": [
                                        {
                                            "vertices": [
                                                {
                                                    "x": 327.65625,
                                                    "y": 428.7616
                                                },
                                                {
                                                    "x": 395.68393,
                                                    "y": 428.7616
                                                },
                                                {
                                                    "x": 395.68393,
                                                    "y": 439.99554
                                                },
                                                {
                                                    "x": 327.65625,
                                                    "y": 439.99554
                                                }
                                            ]
                                        }
                                    ],
                                    "maskingPolys": [
                                        {
                                            "vertices": [
                                                {
                                                    "x": 326.53287,
                                                    "y": 427.6382
                                                },
                                                {
                                                    "x": 396.8073,
                                                    "y": 427.6382
                                                },
                                                {
                                                    "x": 396.8073,
                                                    "y": 441.11893
                                                },
                                                {
                                                    "x": 326.53287,
                                                    "y": 441.11893
                                                }
                                            ]
                                        }
                                    ]
                                }
                            ],
                            "surName": [
                                {
                                    "text": "HONG",
                                    "formatted": {
                                        "value": "HONG"
                                    },
                                    "keyText": "",
                                    "confidenceScore": 0.0,
                                    "boundingPolys": [
                                        {
                                            "vertices": [
                                                {
                                                    "x": 187.23215,
                                                    "y": 454.97412
                                                },
                                                {
                                                    "x": 224.05446,
                                                    "y": 454.97412
                                                },
                                                {
                                                    "x": 224.05446,
                                                    "y": 466.83215
                                                },
                                                {
                                                    "x": 187.23215,
                                                    "y": 466.83215
                                                }
                                            ]
                                        }
                                    ],
                                    "maskingPolys": []
                                }
                            ],
                            "givenName": [
                                {
                                    "text": "GIL****",
                                    "formatted": {
                                        "value": "GIL****"
                                    },
                                    "keyText": "",
                                    "confidenceScore": 0.0,
                                    "boundingPolys": [
                                        {
                                            "vertices": [
                                                {
                                                    "x": 187.23215,
                                                    "y": 481.8107
                                                },
                                                {
                                                    "x": 241.52946,
                                                    "y": 481.8107
                                                },
                                                {
                                                    "x": 241.52946,
                                                    "y": 493.66876
                                                },
                                                {
                                                    "x": 187.23215,
                                                    "y": 493.66876
                                                }
                                            ]
                                        }
                                    ],
                                    "maskingPolys": []
                                }
                            ],
                            "nationality": [
                                {
                                    "text": "REPUBLIC OF KOREA",
                                    "formatted": {
                                        "value": "REPUBLIC OF KOREA"
                                    },
                                    "keyText": "",
                                    "confidenceScore": 0.0,
                                    "boundingPolys": [
                                        {
                                            "vertices": [
                                                {
                                                    "x": 187.74973,
                                                    "y": 569.2035
                                                },
                                                {
                                                    "x": 244.59932,
                                                    "y": 568.4555
                                                },
                                                {
                                                    "x": 244.73523,
                                                    "y": 578.78436
                                                },
                                                {
                                                    "x": 187.88564,
                                                    "y": 579.53235
                                                }
                                            ]
                                        }
                                    ],
                                    "maskingPolys": []
                                }
                            ],
                            "birthDate": [
                                {
                                    "text": "February 1, 1987",
                                    "formatted": {
                                        "year": "1987",
                                        "month": "02",
                                        "day": "01"
                                    },
                                    "keyText": "",
                                    "confidenceScore": 0.0,
                                    "boundingPolys": [
                                        {
                                            "vertices": [
                                                {
                                                    "x": 186.60803,
                                                    "y": 534.8598
                                                },
                                                {
                                                    "x": 204.70714,
                                                    "y": 534.8598
                                                },
                                                {
                                                    "x": 204.70714,
                                                    "y": 547.96606
                                                },
                                                {
                                                    "x": 186.60803,
                                                    "y": 547.96606
                                                }
                                            ]
                                        }
                                    ],
                                    "maskingPolys": []
                                }
                            ],
                            "sex": [
                                {
                                    "text": "F んだ",
                                    "formatted": {
                                        "value": "F"
                                    },
                                    "keyText": "",
                                    "confidenceScore": 0.0,
                                    "boundingPolys": [
                                        {
                                            "vertices": [
                                                {
                                                    "x": 187.23215,
                                                    "y": 558.57587
                                                },
                                                {
                                                    "x": 204.08304,
                                                    "y": 558.57587
                                                },
                                                {
                                                    "x": 204.08304,
                                                    "y": 565.4411
                                                },
                                                {
                                                    "x": 187.23215,
                                                    "y": 565.4411
                                                }
                                            ]
                                        }
                                    ],
                                    "maskingPolys": []
                                }
                            ],
                            "issueDate": [
                                {
                                    "text": "August 15, 2020",
                                    "formatted": {
                                        "year": "2020",
                                        "month": "08",
                                        "day": "15"
                                    },
                                    "keyText": "",
                                    "confidenceScore": 0.0,
                                    "boundingPolys": [
                                        {
                                            "vertices": [
                                                {
                                                    "x": 187.23215,
                                                    "y": 594.7741
                                                },
                                                {
                                                    "x": 202.83482,
                                                    "y": 594.7741
                                                },
                                                {
                                                    "x": 202.83482,
                                                    "y": 605.3839
                                                },
                                                {
                                                    "x": 187.23215,
                                                    "y": 605.3839
                                                }
                                            ]
                                        }
                                    ],
                                    "maskingPolys": []
                                }
                            ],
                            "expireDate": [
                                {
                                    "text": "August 15, 2030",
                                    "formatted": {
                                        "year": "2030",
                                        "month": "08",
                                        "day": "15"
                                    },
                                    "keyText": "",
                                    "confidenceScore": 0.0,
                                    "boundingPolys": [
                                        {
                                            "vertices": [
                                                {
                                                    "x": 328.28036,
                                                    "y": 594.15
                                                },
                                                {
                                                    "x": 343.25894,
                                                    "y": 594.15
                                                },
                                                {
                                                    "x": 343.25894,
                                                    "y": 605.3839
                                                },
                                                {
                                                    "x": 328.28036,
                                                    "y": 605.3839
                                                }
                                            ]
                                        }
                                    ],
                                    "maskingPolys": []
                                }
                            ],
                            "authority": [
                                {
                                    "text": "MINISTRY OF FOREIGN AFFAIRS",
                                    "keyText": "",
                                    "confidenceScore": 0.0,
                                    "boundingPolys": [
                                        {
                                            "vertices": [
                                                {
                                                    "x": 328.28036,
                                                    "y": 569.8098
                                                },
                                                {
                                                    "x": 373.84018,
                                                    "y": 569.8098
                                                },
                                                {
                                                    "x": 373.84018,
                                                    "y": 577.9232
                                                },
                                                {
                                                    "x": 328.28036,
                                                    "y": 577.9232
                                                }
                                            ]
                                        }
                                    ]
                                }
                            ],
                            "fullNameKor": [
                                {
                                    "text": "Hong**",
                                    "formatted": {
                                        "value": "Hong**"
                                    },
                                    "keyText": "",
                                    "confidenceScore": 0.0,
                                    "boundingPolys": [
                                        {
                                            "vertices": [
                                                {
                                                    "x": 186.60803,
                                                    "y": 506.775
                                                },
                                                {
                                                    "x": 223.43036,
                                                    "y": 506.775
                                                },
                                                {
                                                    "x": 223.43036,
                                                    "y": 522.3777
                                                },
                                                {
                                                    "x": 186.60803,
                                                    "y": 522.3777
                                                }
                                            ]
                                        }
                                    ],
                                    "maskingPolys": []
                                }
                            ],
                            "mrz1": [
                                {
                                    "text": "PMKORHONG<<GIL****<<<<<<<<<<<<<<<<<<<<<<<<<<<<",
                                    "formatted": {
                                        "value": "PMKORHONG<<GIL****<<<<<<<<<<<<<<<<<<<<<<<<<<"
                                    },
                                    "keyText": "",
                                    "confidenceScore": 0.0,
                                    "boundingPolys": [
                                        {
                                            "vertices": [
                                                {
                                                    "x": 32.45357,
                                                    "y": 638.4616
                                                },
                                                {
                                                    "x": 484.93124,
                                                    "y": 638.4616
                                                },
                                                {
                                                    "x": 484.93124,
                                                    "y": 650.9437
                                                },
                                                {
                                                    "x": 32.45357,
                                                    "y": 650.9437
                                                }
                                            ]
                                        }
                                    ],
                                    "maskingPolys": [
                                        {
                                            "vertices": [
                                                {
                                                    "x": 31.20536,
                                                    "y": 637.2134
                                                },
                                                {
                                                    "x": 486.17944,
                                                    "y": 637.2134
                                                },
                                                {
                                                    "x": 486.17944,
                                                    "y": 652.19196
                                                },
                                                {
                                                    "x": 31.20536,
                                                    "y": 652.19196
                                                }
                                            ]
                                        }
                                    ]
                                }
                            ],
                            "mrz2": [
                                {
                                    "text": "M123A45670K0R*****0000000000000000",
                                    "formatted": {
                                        "value": "M123A45670K0R*****00000000000000"
                                    },
                                    "keyText": "",
                                    "confidenceScore": 0.0,
                                    "boundingPolys": [
                                        {
                                            "vertices": [
                                                {
                                                    "x": 31.829464,
                                                    "y": 663.42584
                                                },
                                                {
                                                    "x": 486.17938,
                                                    "y": 663.42584
                                                },
                                                {
                                                    "x": 486.17938,
                                                    "y": 677.7803
                                                },
                                                {
                                                    "x": 31.829464,
                                                    "y": 677.7803
                                                }
                                            ]
                                        }
                                    ],
                                    "maskingPolys": [
                                        {
                                            "vertices": [
                                                {
                                                    "x": 30.39402,
                                                    "y": 661.9904
                                                },
                                                {
                                                    "x": 487.61484,
                                                    "y": 661.9904
                                                },
                                                {
                                                    "x": 487.61484,
                                                    "y": 679.2157
                                                },
                                                {
                                                    "x": 30.39402,
                                                    "y": 679.2157
                                                }
                                            ]
                                        }
                                    ]
                                }
                            ]
                        },
                        "rois": [
                            {
                                "vertices": [
                                    {
                                        "x": 10.000834,
                                        "y": 364.93756
                                    },
                                    {
                                        "x": 500.2946,
                                        "y": 364.6102
                                    },
                                    {
                                        "x": 501.1391,
                                        "y": 692.69543
                                    },
                                    {
                                        "x": 6.990344,
                                        "y": 694.3484
                                    }
                                ]
                            }
                        ],
                        "idtype": "Passport"
                    }
                }
            }
        ]
    }
    

    Failure

    The following is a sample response upon a failed call.

    {
        "version": "V2",
        "requestId": "1234",
        "timestamp": 1725235840459,
        "images": [
            {
                "uid": "{uid}",
                "name": "passport_test",
                "inferResult": "ERROR",
                "message": "Read page:0 error.",
                "validationResult": {
                    "result": "NO_REQUESTED"
                }
            }
        ]
    }
    

    Was this article helpful?

    Changing your password will log you out immediately. Use the new password to log back in.
    First name must have atleast 2 characters. Numbers and special characters are not allowed.
    Last name must have atleast 1 characters. Numbers and special characters are not allowed.
    Enter a valid email
    Enter a valid password
    Your profile has been successfully updated.