文本统计分析(本地版)
对文本进行全面统计分析,包括字数、词频、标点符号、段落、句子等维度,支持中英文混合文本
接口地址
GET, POST https://api.tinyaii.cn/v1/text/analyze
请求参数
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
text | string | 是 | 待分析的文本内容 |
返回字段
| 字段名 | 类型 | 说明 |
|---|---|---|
characters.total | int | 总字符数 |
characters.bytes | int | 总字节数 |
characters.chinese | int | 中文字符数 |
characters.english | int | 英文字母数 |
characters.digits | int | 数字个数 |
characters.spaces | int | 空格数 |
words.total | int | 总词数(中文按字+英文按词) |
sentences.count | int | 句子数 |
sentences.avg_length | int | 平均句长 |
sentences.longest | string | 最长句子 |
sentences.shortest | string | 最短句子 |
paragraphs.count | int | 段落数 |
paragraphs.lines | int | 总行数 |
punctuation.total | int | 标点符号总数 |
punctuation.chinese | int | 中文标点数 |
punctuation.english | int | 英文标点数 |
punctuation.top | array | 高频标点Top15 |
reading.estimated_minutes | int | 预计阅读时间(分钟) |
top_words | array | 高频词语Top10 |
返回示例
{
"code": 200,
"message": "success",
"data": {
"characters": {
"total": 88,
"bytes": 238,
"chinese": 64,
"english": 10,
"digits": 3,
"spaces": 0,
"other": 0
},
"words": {
"total": 66,
"chinese_words": 64,
"english_words": 2
},
"sentences": {
"count": 6,
"avg_length": 11,
"longest": "TinyAPI提供免费的API接口服务,已经运行了200多天。",
"shortest": "外面的阳光很好。"
},
"paragraphs": {
"count": 1,
"lines": 1,
"blank_lines": 0
},
"punctuation": {
"total": 11,
"chinese": 11,
"english": 0,
"top": [
{
"punctuation": ",",
"count": 4
},
{
"punctuation": "。",
"count": 4
},
{
"punctuation": "!",
"count": 2
},
{
"punctuation": ":",
"count": 1
}
]
},
"reading": {
"estimated_minutes": 1
},
"top_words": [
{
"word": "天",
"count": 3
},
{
"word": "走",
"count": 2
},
{
"word": "接口",
"count": 1
},
{
"word": "运行",
"count": 1
},
{
"word": "免费",
"count": 1
}
]
}
}
调用示例
curl "https://api.tinyaii.cn/v1/text/analyze?apikey=YOUR_KEY&text=今天天气不错,我们出去走走吧!"
相关接口(实用工具)
- 文本翻译 — 支持多语言文本翻译
- 敏感词检测 — 敏感词/违禁词检测,基于测罗API在线检测(涉政/涉黄/暴恐/广告违禁/极限词等
- AI 智能翻译 — AI 智能翻译,支持 33 种语言互译,自动检测源语言
- AI 翻译配置 — 查询 AI 翻译接口支持的语言列表和功能说明
- 缩写查询 — 查询英文缩写的全称和含义,收录80+常见缩写
- 对联生成 — 随机返回一副经典对联,包含上联、下联和横批,共214副经典对联
本站收录 353 个可免费调用的 API 接口,查看完整开发文档 或
注册获取 API Key。