Tencent Cloud ID Card Recognition: Invoking IDCardOCR in Agent to Extract Second-Generation ID Card Fields

Introduction

In processes such as real-name authentication, account opening, and government form submissions, it is often necessary to enter fields like the name, ID number, and address from an ID card photo into a system. Manual transcription is prone to errors, and integrating OCR yourself requires handling image encoding, front/back field mapping, and interface authentication. If you are already using Agents that support Skills, such as Cursor or Claude Code, you can delegate the “Recognition of Second-Generation ID Cards” to the enterprise skill @tencent-adm/tencentcloud-ocr-idcard on SkillHub. The Agent will then call the Tencent Cloud ID Card OCR (IDCardOCR) interface according to the skill instructions.

What is this

Tencent Cloud ID Card OCR is a skill package located at the SkillHub coordinate @tencent-adm/tencentcloud-ocr-idcard. The current version is 1.0.5, the source is enterprise, published by the Tencent Cloud OCR Team, and categorized under dev-programming. The skill encapsulates Tencent Cloud’s IDCardOCR capabilities: extracting structured information from images of the front and back of Second-Generation ID Cards for mainland Chinese residents. It supports both Base64 and URL image input methods and includes capabilities for ID photo cropping and various warning functions (subject to the instructions within the skill).

The SkillHub page indicates requires_api_key=true. You need to prepare the relevant Tencent Cloud OCR API keys and complete the configuration according to the skill documentation before use.

Core Features

The following capabilities are derived from SkillHub and the official skill page summary, and can be understood in correspondence with Tencent Cloud IDCardOCR product capabilities:

  1. Front and Back Field Extraction: Name, gender, ethnicity, date of birth, address, and ID number; the back includes issuing authority, validity period, etc.
  2. Two Image Input Methods: Supports passing images via Base64 and URL in recognition requests.
  3. Image and Quality Capabilities: Supports cropping of ID card photos; possesses various warning functions (specific warning items are subject to the skill’s internal documentation and Tencent Cloud interface returns).

Installation and Activation

The official skill page specifies: For installation, please refer to SkillHub Installation and Priority Source Configuration, and install the coordinate @tencent-adm/tencentcloud-ocr-idcard.

1. Install SkillHub CLI (if not already installed)

First, check if skillhub is already on your machine:

command -v skillhub && skillhub --version

If not installed, you can execute the full installation (CLI + default Skill) according to the installation documentation:

curl -fsSL https://skillhub-1388575217.cos.ap-guangzhou.myqcloud.com/install/install.sh | bash

If only the CLI is needed:

curl -fsSL https://skillhub-1388575217.cos.ap-guangzhou.myqcloud.com/install/install.sh | bash -s -- --cli-only

2. Install the skill to the current Agent’s skills directory

The installation documentation requires: During installation, you must use --dir to point to the skills directory currently used by the Agent. Otherwise, it will be installed to ./skills/ by default, and the Agent may not be able to load it.

skillhub install @tencent-adm/tencentcloud-ocr-idcard --dir <your skills directory>

Common client skills paths (excerpted from the installation documentation, choose one based on your actual environment):

Client skills Directory
Cursor ~/.cursor/skills/
Claude Code ~/.claude/skills/
Codex ~/.codex/skills/ or .agents/skills/ under the project
Windsurf ~/.codeium/windsurf/skills/ or .windsurf/skills/

After installation, restart or refresh the Agent as required by the client being used to enable the skill.

3. API Keys

The skill is tagged with requires_api_key=true. Specific environment variable names and configuration file paths are subject to the SKILL.md within the skill package and the Tencent Cloud console instructions; do not write SecretId and SecretKey into repositories or conversation logs.

Typical Usage

The skill is designed to allow the Agent to select this skill and call IDCardOCR when a user needs to recognize information from the front or back of a Second-Generation ID card image.

The reproducible operation path is as follows (without fabricating unpublished interface parameter names):

  1. In the conversation, specify whether you want to recognize the front or back, and provide the image: either a local file (which the Agent converts to Base64 according to skill requirements) or a publicly accessible image URL.
  2. Confirm that the Agent has loaded @tencent-adm/tencentcloud-ocr-idcard and that you have configured the Tencent Cloud API keys according to the skill documentation.
  3. Ask the Agent to return structured fields (Name, Gender, Ethnicity, Date of Birth, Address, ID Number, Issuing Authority, Validity Period, etc.), and perform manual spot checks against the original image.

If you need to verify field meanings or correspondence with warning codes, please refer to the documentation within the skill package and the Tencent Cloud IDCardOCR official API documentation. This article does not expand on request examples not appearing in the SkillHub summary.

Use Cases and Notes

Who is it for

  • Developers already processing ID photos in Agent workflows who need to quickly extract fields from Second-Generation ID cards.
  • Scenarios where you wish to reuse enterprise skills maintained by the Tencent Cloud OCR Team rather than writing OCR calling scripts from scratch.

Limitations and Notes

  • The recognition targets are the front and back of Mainland China Resident Second-Generation ID Cards; Hong Kong, Macao, Taiwan, or other document types are not within the scope of this skill summary.
  • Depends on a Tencent Cloud account and API keys; any call costs and compliance obligations incurred must be assessed by yourself.
  • SkillHub Statistics (based on crawled data): Rating 100000, Downloads 2687, Installs 131; data changes over time, subject to the SkillHub page.
  • Images containing personal identity information and recognition results should comply with requirements such as minimum necessity, encrypted storage, and access control.

Conclusion

@tencent-adm/tencentcloud-ocr-idcard encapsulates Tencent Cloud IDCardOCR into an Agent Skill: when structured fields from a Second-Generation ID card are needed, provide the image via Base64 or URL, and let the skill guide the recognition and field organization. For installation and priority source configuration, see skillhub.md; for skill details and versions, see SkillHub: https://www.skillhub.cn/skills/tencent-adm/tencentcloud-ocr-idcard, API Entry: https://api.skillhub.cn/tencent-adm/tencentcloud-ocr-idcard.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye