GET /api/sensitive-check 是一个开放的敏感词检测接口,通过 ?text= 查询参数传入待检测文本。无需登录或 API Key,按 IP 限流(60次/分钟)。
词库来源:Sensitive-lexicon,包含 51,326 个敏感词,覆盖广告、色情、政治、暴恐、贪腐等分类。
GET https://wwcai.cn/api/sensitive-check?text=要检测的文本| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| text | string | 是 | 待检测文本,最长 10000 字符 |
{
"contains": true,
"count": 2,
"categories": ["广告", "色情"],
"matches": [
{"word": "敏感词A", "categories": ["广告"]},
{"word": "敏感词B", "categories": ["色情"]}
]
}| 字段 | 类型 | 说明 |
|---|---|---|
| contains | boolean | 是否包含敏感词 |
| count | integer | 匹配数量 |
| categories | array | 涉及的分类列表 |
| matches | array | 匹配详情 |
curl "https://wwcai.cn/api/sensitive-check?text=免费领取优惠券"import requests
resp = requests.get("https://wwcai.cn/api/sensitive-check", params={"text": "要检测的文本"})
data = resp.json()
print(f"包含: {data['contains']}, 数量: {data['count']}")const resp = await fetch("https://wwcai.cn/api/sensitive-check?text=" + encodeURIComponent("要检测的文本"));
const data = await resp.json();
console.log(data.contains, data.count);| 状态码 | 说明 |
|---|---|
| 200 | 检测成功 |
| 400 | text 为空 |
| 413 | text 超过 10000 字符 |
| 429 | IP 请求过于频繁 |
| 503 | 敏感词引擎未就绪 |
直接 GET 不带 text 参数即可查看词库状态(51,326 词,已就绪)。
登录后发表评论。
暂无评论。来发表第一条吧。