简繁转换
简体中文与繁体中文互相转换,支持3878个汉字映射,纯本地实现零延迟
GET
https://api.tinyaii.cn/v1/convert
请求参数
| 参数名 | 类型 | 必填 | 说明 | 示例 |
|---|---|---|---|---|
| text | string | 必填 | 待转换文本 | 中华人民共和国 |
| type | string | 可选 | 转换方向:s2t(简体→繁体,默认)、t2s(繁体→简体) | s2t |
返回字段
| 字段 | 类型 | 说明 |
|---|---|---|
| text | string | 原始文本 |
| result | string | 转换结果 |
| type | string | 转换方向:s2t 或 t2s |
| type_name | string | 转换方向中文名 |
| length | int | 结果文本字符数 |
返回示例
{
"code": 200,
"message": "success",
"data": {
"text": "中华人民共和国",
"result": "中華人民共和國",
"type": "s2t",
"type_name": "简体→繁体",
"length": 7
}
}
调用示例
curl "https://api.tinyaii.cn/v1/convert?text=中华人民共和国" \
-H "Authorization: Bearer YOUR_API_KEY"const res = await fetch("https://api.tinyaii.cn/v1/convert?text=中华人民共和国", {
headers: { "Authorization": "Bearer YOUR_API_KEY" },
});
console.log(await res.json());import requests
resp = requests.get(
"https://api.tinyaii.cn/v1/convert",
params={"text": "中华人民共和国"},
headers={"Authorization": "Bearer YOUR_API_KEY"},
timeout=10,
)
print(resp.json())把 YOUR_API_KEY 换成你的密钥即可直接运行。密钥只保存在你自己的设备上。