tencent cloud

文档反馈

PhilippinesVoteIDOCR

最后更新时间:2023-09-05 15:20:43

    1. API Description

    Domain name for API request: ocr.tencentcloudapi.com.

    This API is used to recognize a Philippine voters ID card. It can recognize fields such as first name, family name, date of birth, civil status, citizenship, address, precinct, and voter's identification number (VIN).

    The API request rate is limited to 20 requests/sec by default.

    A maximum of 20 requests can be initiated per second for this API.

    We recommend you to use API Explorer
    Try it
    API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

    2. Input Parameters

    The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.

    Parameter Name Required Type Description
    Action Yes String Common Params. The value used for this API: RecognizePhilippinesVoteIDOCR.
    Version Yes String Common Params. The value used for this API: 2018-11-19.
    Region No String Common Params. This parameter is not required for this API.
    ReturnHeadImage Yes Boolean Whether to return the identity photo.
    ImageBase64 No String The Base64-encoded value of an image.
    Supported image formats: PNG, JPG, and JPEG. GIF is currently not supported.
    Supported image size: The downloaded image after Base64 encoding can be up to 7 MB. The download time of the image cannot exceed 3s.
    Either the ImageUrl or ImageBase64 of the image must be provided. If both are provided, only ImageUrl will be used.
    ImageUrl No String The URL of the image.
    Supported image formats: PNG, JPG, and JPEG. GIF is currently not supported.
    Supported image size: The downloaded image after Base64 encoding can be up to 7 MB. The download time of the image cannot exceed 3s.
    We recommend that you store the image in Tencent Cloud for higher download speed and stability.
    For a non-Tencent Cloud URL, the download speed and stability may be affected.

    3. Output Parameters

    Parameter Name Type Description
    HeadPortrait TextDetectionResult The Base64-encoded identity photo.
    VIN TextDetectionResult The voter's identification number (VIN).
    FirstName TextDetectionResult The first name.
    LastName TextDetectionResult The last name.
    Birthday TextDetectionResult The date of birth.
    CivilStatus TextDetectionResult The civil status.
    Citizenship TextDetectionResult The citizenship.
    Address TextDetectionResult The address.
    PrecinctNo TextDetectionResult The precinct.
    RequestId String The unique request ID, which is returned for each request. RequestId is required for locating a problem.

    4. Example

    Example1 Recognizing a Philippine voters ID card

    This example shows you how to recognize a Philippine voters ID card.

    Input Example

    POST / HTTP/1.1
    Host: ocr.tencentcloudapi.com
    Content-Type: application/json
    X-TC-Action: RecognizePhilippinesVoteIDOCR
    <Common request parameters>
    
    {
        "ReturnHeadImage": "false",
        "ImageUrl": "https://xx/a.jpg"
    }
    

    Output Example

    {
        "Response": {
            "Address": {
                "Polygon": [
                    {
                        "X": "276",
                        "Y": "337"
                    },
                    {
                        "X": "351",
                        "Y": "337"
                    },
                    {
                        "X": "351",
                        "Y": "357"
                    },
                    {
                        "X": "276",
                        "Y": "357"
                    }
                ],
                "Value": " IPIL,ZAMBOANGA CITY"
            },
            "Birthday": {
                "Polygon": [
                    {
                        "X": "406",
                        "Y": "257"
                    },
                    {
                        "X": "552",
                        "Y": "257"
                    },
                    {
                        "X": "552",
                        "Y": "279"
                    },
                    {
                        "X": "406",
                        "Y": "279"
                    }
                ],
                "Value": "March 13,1985"
            },
            "Citizenship": {
                "Polygon": [
                    {
                        "X": "405",
                        "Y": "311"
                    },
                    {
                        "X": "492",
                        "Y": "311"
                    },
                    {
                        "X": "492",
                        "Y": "331"
                    },
                    {
                        "X": "404",
                        "Y": "331"
                    }
                ],
                "Value": "Filipino"
            },
            "CivilStatus": {
                "Polygon": [
                    {
                        "X": "407",
                        "Y": "285"
                    },
                    {
                        "X": "485",
                        "Y": "285"
                    },
                    {
                        "X": "485",
                        "Y": "304"
                    },
                    {
                        "X": "407",
                        "Y": "304"
                    }
                ],
                "Value": "Single"
            },
            "FirstName": {
                "Polygon": [
                    {
                        "X": "276",
                        "Y": "173"
                    },
                    {
                        "X": "344",
                        "Y": "173"
                    },
                    {
                        "X": "344",
                        "Y": "195"
                    },
                    {
                        "X": "276",
                        "Y": "195"
                    }
                ],
                "Value": "ROYO"
            },
            "HeadPortrait": {
                "Polygon": [],
                "Value": ""
            },
            "LastName": {
                "Polygon": [
                    {
                        "X": "276",
                        "Y": "214"
                    },
                    {
                        "X": "376",
                        "Y": "213"
                    },
                    {
                        "X": "376",
                        "Y": "238"
                    },
                    {
                        "X": "276",
                        "Y": "239"
                    }
                ],
                "Value": "TUDTUD"
            },
            "PrecinctNo": {
                "Polygon": [
                    {
                        "X": "459",
                        "Y": "415"
                    },
                    {
                        "X": "520",
                        "Y": "415"
                    },
                    {
                        "X": "520",
                        "Y": "434"
                    },
                    {
                        "X": "459",
                        "Y": "434"
                    }
                ],
                "Value": "0398B"
            },
            "RequestId": "1234-1234-1234-1234",
            "VIN": {
                "Polygon": [
                    {
                        "X": "253",
                        "Y": "128"
                    },
                    {
                        "X": "652",
                        "Y": "128"
                    },
                    {
                        "X": "652",
                        "Y": "153"
                    },
                    {
                        "X": "253",
                        "Y": "153"
                    }
                ],
                "Value": "7502-0398B-G0987ANT10000"
            }
        }
    }
    

    5. Developer Resources

    SDK

    TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

    Command Line Interface

    6. Error Code

    The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

    Error Code Description
    FailedOperation.DownLoadError File download failed.
    FailedOperation.ImageDecodeFailed Image decoding failed.
    FailedOperation.OcrFailed OCR failed.
    FailedOperation.UnKnowError Unknown error.
    FailedOperation.UnOpenError The service is not activated.
    InvalidParameter.EngineImageDecodeFailed Image decoding failed.
    InvalidParameterValue.InvalidParameterValueLimit Incorrect parameter value.
    LimitExceeded.TooLargeFileError The file is too large.
    ResourcesSoldOut.ChargeStatusException Exceptional billing status.
    联系我们

    联系我们,为您的业务提供专属服务。

    技术支持

    如果你想寻求进一步的帮助,通过工单与我们进行联络。我们提供7x24的工单服务。

    7x24 电话支持