tencent cloud

All product documents
RecognizeThaiPinkCard
Last updated: 2025-03-19 19:38:06
RecognizeThaiPinkCard
Last updated: 2025-03-19 19:38:06

1. API Description

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

This API is used to recognize the fields on a Thai identity card, including name in Thai, name in English, address, date of birth, identification number, date of issue, and date of expiry.
Currently, this API is not generally available. For more information, please contact your sales rep.

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

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: RecognizeThaiPinkCard.
Version Yes String Common Params. The value used for this API: 2018-11-19.
Region No String Common Params. This parameter is not required.
ImageBase64 No String The Base64-encoded value of an image. The image cannot exceed 7 MB after being Base64-encoded. A resolution above 500 x 800 is recommended. PNG, JPG, JPEG, and BMP formats are supported. It is recommended that the card part occupy more than 2/3 area of the image.
Either ImageUrl or ImageBase64 of the image must be provided. If both are provided, ImageUrl is used.
ImageUrl No String The URL of the image. The image cannot exceed 7 MB after being Base64-encoded. A resolution above 500 x 800 is recommended. PNG, JPG, JPEG, and BMP formats are supported. It is recommended that the card part occupy more than 2/3 area of the image.
We recommend that you store the image in Tencent Cloud for higher download speed and stability.
CropPortrait No Boolean Whether to crop the profile photo. The default value is false, meaning not to return the Base64-encoded value of the profile photo on the Thai identity card.
When this parameter is set to true, the Base64-encoded value of the profile photo on the Thai identity card after rotation correction is returned.

3. Output Parameters

Parameter Name Type Description
Country String Country
IDNumber String ID number
ThaiName String Name in Thai
EnName String Name in English
ThaiSurName String Surname in Thai
ThaiDOB String Date of birth in Thai
EnDOB String Date of birth in English
PhotoNumber String Photo number
ThaiAddress String Address in Thai
ThaiDateOfIssue String Date of issue in Thai
DateOfIssue String Date of issue in English
ThaiDateOfExpiry String Expiration date in Thai
DateOfExpiry String Expiration date in English
IssuingAgency String Issuing agency
RefNumber String Ref number
AdvancedInfo String Field confidence:
{ "ID": { "Confidence": 0.9999 }, "ThaiName": { "Confidence": 0.9996 } }
PortraitImage String Identity photo
WarnCardInfos Array of Integer Card Warning Information

-9101 Alarm for covered certificate,
-9102 Alarm for photocopied certificate,
-9103 Alarm for photographed certificate,
-9107 Alarm for reflective certificate,
-9108 Alarm for blurry image,
-9109 This capability is not enabled.
RequestId String The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.

4. Example

Example1 RecognizeThaiPinkCard Example

Input Example

    
POST / HTTP/1.1
Host: ocr.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: RecognizeThaiPinkCard

{
    "ImageUrl": "https://ocr-demo-1254418846.cos.ap-guangzhou.myqcloud.com/***/fakeurl.jpg"
}

Output Example

{
    "Response": {
        "AdvancedInfo": "{\"DateOfExpiry\":0.6956542730331421,\"EnDOB\":0.69610595703125,\"RefNumber\":0.6244140863418579,\"Country\":0.803863525390625,\"PhotoNumber\":0.7247558832168579,\"ThaiAddress\":0.9462376236915588,\"ThaiName\":0.7324594259262085,\"IssuingAgency\":0.839324951171875,\"ThaiDateOfIssue\":0.7035577893257141,\"DateOfIssue\":0.688977062702179,\"IDNumber\":0.6976562738418579,\"EnName\":0.6729980707168579,\"ThaiDOB\":0.7289484143257141,\"ThaiDateOfExpiry\":0.71337890625}",
        "Country": "",
        "DateOfExpiry": "9 Aug. 2032",
        "DateOfIssue": "10 Aug. 2022",
        "EnDOB": "14 Feb. 1986",
        "EnName": "Mr. *** Tun",
        "IDNumber": "00 8401 155063 9",
        "IssuingAgency": "",
        "PhotoNumber": "8401-0223290",
        "PortraitImage": "",
        "RefNumber": "(CI) CC744457",
        "RequestId": "4706ff76-2e7a-43d1-a697-6db531e33492",
        "ThaiAddress": "",
        "ThaiDOB": "",
        "ThaiDateOfExpiry": "",
        "ThaiDateOfIssue": "",
        "ThaiName": ""
    }
}

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.EmptyImageError The image is empty.
FailedOperation.ImageDecodeFailed Image decoding failed.
FailedOperation.ImageNoSpecifiedCard The card in the image is not of the specified type.
FailedOperation.OcrFailed OCR failed. This error may be caused by unstable network connections,service anomalies or other issues.
FailedOperation.UnOpenError The service is not activated.
InvalidParameterValue.InvalidParameterValueLimit Incorrect parameter value.
LimitExceeded.TooLargeFileError The file is too large.
ResourcesSoldOut.ChargeStatusException Exceptional billing status.
UnknownParameter Unrecognized argument.
Was this page helpful?
You can also Contact Sales or Submit a Ticket for help.
Yes
No

Feedback

Contact Us

Contact our sales team or business advisors to help your business.

Technical Support

Open a ticket if you're looking for further assistance. Our Ticket is 7x24 available.

7x24 Phone Support
Hong Kong, China
+852 800 906 020 (Toll Free)
United States
+1 844 606 0804 (Toll Free)
United Kingdom
+44 808 196 4551 (Toll Free)
Canada
+1 888 605 7930 (Toll Free)
Australia
+61 1300 986 386 (Toll Free)
EdgeOne hotline
+852 300 80699
More local hotlines coming soon