实名校验与文本工具 · util.text.sanitize

文本敏感个人信息(PII)一键脱敏清洗

自动识别并遮蔽文本中的手机号、身份证号、银行卡、邮箱及微信号,输出清理统计。

请求地址(支持 GET / POST)
POST https://www.xntou.cn/api/open/v1/util/text-sanitize
单次计费
¥0.01 / 1 点
沙箱体验
免费 20 次/日

⚡ 在线调试台(Sandbox Debugger)

实时返回结果
{
  "error_code": 0,
  "reason": "Success",
  "api_code": "util.text.sanitize",
  "result": {
    "totalRedacted": 2
  }
}

请求参数与返回字段说明

1. 请求参数

参数名类型必填示例默认值说明
text string 必填 联系人张三 13800138000,微信: zhangsan_88,身份证 32058319900101001X。 待脱敏原始文本

2. 核心返回字段(result)

字段路径类型说明
result.sanitizedText string 脱敏后安全文本
result.redactions object 各类敏感信息命中次数
result.totalRedacted number 累计脱敏项数

多语言接入代码示例

curl -s -X POST "https://www.xntou.cn/api/open/v1/util/text-sanitize" \
  -H "Content-Type: application/json" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -d '{"text":"联系人张三 13800138000,微信: zhangsan_88。"}'
import requests
resp = requests.post("https://www.xntou.cn/api/open/v1/util/text-sanitize", headers={"X-Api-Key": "YOUR_APP_KEY"}, json={
  "text": "联系人张三 13800138000,微信: zhangsan_88。"
})
print(resp.json())
const res = await fetch("https://www.xntou.cn/api/open/v1/util/text-sanitize", {
  method: "POST",
  headers: { "Content-Type": "application/json", "X-Api-Key": "YOUR_APP_KEY" },
  body: JSON.stringify({
  "text": "联系人张三 13800138000,微信: zhangsan_88。"
})
});
console.log(await res.json());
<?php
$ch = curl_init("https://www.xntou.cn/api/open/v1/util/text-sanitize");
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"text":"联系人张三 13800138000,微信: zhangsan_88。"}');
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json', 'X-Api-Key: YOUR_APP_KEY']);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
echo curl_exec($ch);