Xpersona
T

TencentCloud IDCard OCR

CLAWHUB · Unverified

腾讯云身份证识别(IDCardOCR)接口调用技能。当用户需要识别身份证图片中中国大陆居民二代身份证正反面信息(姓名、性别、民族、出生日期、住址、身份证号、签发机关、有效期限等)时,应使用此技能。支持图片Base64和URL两种输入方式,同时支持身份证图片照片裁剪和多种告警功能。 Skill: TencentCloud IDCard OCR Owner: zt1314p-design Summary: 腾讯云身份证识别(IDCardOCR)接口调用技能。当用户需要识别身份证图片中中国大陆居民二代身份证正反面信息(姓名、性别、民族、出生日期、住址、身份证号、签发机关、有效期限等)时,应使用此技能。支持图片Base64和URL两种输入方式,同时支持身份证图片照片裁剪和多种告警功能。 Tags: latest:1.0.4 Version history: v1.0.4 | 2026-04-01T06:21:32.671Z | user - 清理并简化了调用示例和参数表,使调用方式更加统一。 v1.0.3 | 2026-03-11T10:53:04.740Z | user - No changes detected in this version. v1.0.2 | 2026-03-10T03:04:56.211

62
Rank
84
Safety
1.2k
Downloads

About

What it does, and when to use it.

Capability contract not published. No trust telemetry is available yet. 1.2K downloads reported by the source. Last updated 10/11/2026.

Avoid when

  • Contract metadata is missing or unavailable for deterministic execution.

Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing

Install and run

Setup complexity: low.

clawhub skill install s171696cz5y91nef8xanxra4sh83gdb0:tencentcloud-ocr-idcard
  1. Setup complexity is LOW. This package is likely designed for quick installation with minimal external side-effects.
  2. Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data.

Contract: missing

curl -s "https://www.xpersona.co/api/v1/agents/clawhub-zt1314p-design-tencentcloud-ocr-idcard/snapshot"

Run-check

$0.02 USD

1 measured facts are behind this paywall: success rate and latency, uptime and estimated cost, when not to use it, how to call it, benchmark scores.

Agents pay $0.02 in USDC. A card payment is $0.50, the smallest a card allows.

Documentation

CLAWHUB

20,469 characters of source documentation, loaded on request.

Extracted files

3 files captured from the source.

SKILL.md

---
name: tencentcloud-ocr-idcard
description: 腾讯云身份证识别(IDCardOCR)接口调用技能。当用户需要识别身份证图片中中国大陆居民二代身份证正反面信息(姓名、性别、民族、出生日期、住址、身份证号、签发机关、有效期限等)时,应使用此技能。支持图片Base64和URL两种输入方式,同时支持身份证图片照片裁剪和多种告警功能。
---

# 腾讯云身份证识别 (IDCardOCR)

## 用途

调用腾讯云OCR身份证识别接口,支持中国大陆居民二代身份证正反面所有字段的识别,识别准确度达99%以上。

核心能力:
- **人像面(FRONT)**:识别姓名、性别、民族、出生日期、住址、公民身份证号
- **国徽面(BACK)**:识别签发机关、证件有效期
- **附加功能**:身份证照片/人像照片裁剪、7种告警检测(复印件、翻拍、PS、临时身份证等)

官方文档:https://cloud.tencent.com/document/api/866/33524

## 使用时机

当用户提出以下需求时触发此技能:
- 需要从身份证图片中提取文字信息
- 需要验证身份证真伪(复印件/翻拍/PS检测)
- 需要裁剪身份证照片或人像照片
- 涉及身份证OCR识别的任何场景

## 环境要求

- Python 3.6+
- 依赖:`tencentcloud-sdk-python`(通过 `pip install tencentcloud-sdk-python` 安装)
- 环境变量:
  - `TENCENTCLOUD_SECRET_ID`:腾讯云API密钥ID
  - `TENCENTCLOUD_SECRET_KEY`:腾讯云API密钥Key

## 使用方式

运行 `scripts/main.py` 脚本完成身份证识别。

### 请求参数

| 参数 | 类型 | 必填 | 说明 |
|------|------|------|------|
| ImageBase64 | str | 否(二选一) | 图片Base64值,不超过10MB |
| ImageUrl | str | 否(二选一) | 图片URL地址,优先使用 |
| CardSide | str | 否 | `FRONT`(人像面) / `BACK`(国徽面),不填则自动判断 |
| Config | str | 否 | JSON字符串,可选开关见下方说明 |
| EnableRecognitionRectify | bool | 否 | 默认true,开启身份证号/出生日期/性别的矫正补齐 |
| EnableReflectDetail | bool | 否 | 默认false,需配合ReflectWarn使用 |
| CardWarnType | str | 否 | `Basic`(默认) / `Advanced`(进阶PS告警) |
| **UserAgent** | **str** | **否** | **请求来源标识(可选),用于追踪调用来源,统一固定为`Skills`** |

**Config JSON 可选开关**:`CropIdCard`、`CropPortrait`、`CopyWarn`、`BorderCheckWarn`、`ReshootWarn`、`DetectPsWarn`、`TempIdWarn`、`InvalidDateWarn`、`Quality`、`MultiCardDetect`、`ReflectWarn`

### ⚠️ UserAgent参数使用指南

**`--user-agent`参数是可选参数**,统一固定为`Skills`,无需手动传递。用于标识API调用来源,便于追踪和统计:

| 调用框架 | --user-agent 参数值 | 说明 |
|---------|--------------|------|
| 所有框架 | `Skills` | 统一固定值,不传递时也默认为此值 |

**实现说明**:
- 通过`--user-agent`命令行参数传递,SDK 会将其拼接为 `SDK_PYTHON_x.x.x; Skills` 注入到请求中
- 统一固定为`Skills`,未传递时也默认为此值
- 该标识会记录在ES日志的 `ReqBody.RequestClient` 字段中,可用于追踪来源

### 输出格式

识别成功后返回 JSON 格式结果:

**人像面(FRONT)**:
```json
{
  "Name": "张三",
  "Sex": "男",
  "Nation": "汉",
  "Birth": "1990/01/01",
  "Address": "XX省XX市XX区XX路XX号",
  "IdNum": "110101199001011234",
  "AdvancedInfo": "{\"WarnInfos\":[]}",
  "RequestId": "xxx"
}
```

**国徽面(BACK)**:
```json
{
  "Authority": "XX市公安局",
  "ValidDate": "2020.01.01-2040.01.01",
  "AdvancedInfo": "{\"WarnInfos\":[]}",
  "RequestId": "xxx"
}
```

### 告警码说明

| 告警码 | 含义 |
|--------|------|
| -9100 | 有效日期不合法 |
| -9101 | 边框不完整 |
| -9102 | 复印件 |
| -9103 | 翻拍 |
| -9104 | 临时身份证 |
| -9105 | 框内遮挡 |
| -9106 | PS痕迹 |
| -9107 | 反光 |
| -9108 | 复印件(仅黑白) |
| -9110 | 电子身份证 |

### 调用示例

```bash
# 基础调用示例(--user-agent 默认为 Skills,可不传)
python scripts/main.py --image-url "https://example.com/idcard.jpg" --card-side FRONT

# 使用 Base64 文件调用
python scripts/main.py --image-base64 "/path/to/base64.txt"

# 开启告警检测和照片裁剪
python scripts/main.py --image-url "https://example.com/idcard.jpg" \
  --config '{"CropIdCard":true,"CopyWarn":true,"ReshootWarn":true}'

# 使用进阶PS告警
python scripts/main.py --image-url "https://example.com/idcard.jpg" \
  --card-warn-type Advanced
```

_meta.json

{
  "ownerId": "kn71qd8mtdsrf1bsagg94kx5tn82dqt6",
  "slug": "tencentcloud-ocr-idcard",
  "version": "1.0.4",
  "publishedAt": 1775024492671
}

skill-card.md

## Description:

Calls Tencent Cloud IDCardOCR to extract fields from images of mainland China resident ID cards, with support for Base64 or URL image input, card-side detection, photo cropping, and warning signals.

This skill is ready for commercial/non-commercial use.

## Publisher:

[zt1314p-design](https://clawhub.ai/user/zt1314p-design)

### License/Terms of Use:

MIT-0

## Use Case:

Developers and agents use this skill to submit authorized ID-card images to Tencent Cloud OCR and receive structured identity fields and warning details. It is intended for workflows that need machine-readable OCR output for the front or back side of a mainland China resident ID card.

### Deployment Geography for Use:

Global

## Known Risks and Mitigations:

Risk: The skill processes highly sensitive ID-card images and OCR results through Tencent Cloud.

Mitigation: Use it only with images the operator is authorized to process, and confirm the data-handling requirements for Tencent Cloud before submitting images.

Risk: Tencent Cloud credentials are required for API access.

Mitigation: Store TENCENTCLOUD_SECRET_ID and TENCENTCLOUD_SECRET_KEY in a protected secret store and avoid writing them into prompts, scripts, logs, or shell history.

Risk: A readable local path passed as Base64 input may cause a non-image file to be uploaded.

Mitigation: Pass only intended image files, avoid arbitrary local paths, and run the skill in a restricted environment until file-type validation is added.

## Reference(s):

- [Tencent Cloud IDCardOCR API Documentation](https://cloud.tencent.com/document/api/866/33524)
- [ClawHub Skill Page](https://clawhub.ai/zt1314p-design/skills/tencentcloud-ocr-idcard)

## Skill Output:

**Output Type(s):** [API Calls, JSON, Shell commands, Configuration]

**Output Format:** [JSON emitted by a Python command-line script]

**Output Parameters:** [1D]

**Other Properties Related to Output:** [Includes recognized ID-card fields, request ID, AdvancedInfo, and parsed warning codes when returned by Tencent Cloud.]

## Skill Version(s):

1.0.4 (source: ClawHub release evidence)

## Ethical Considerations:

Users should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.

Sponsored

Ads related to TencentCloud IDCard OCR and adjacent AI workflows.