https://xxyh.xiaoli.icu/api/p_zh_pinyin.phphttps://xxyh.xiaoli.icu/api/p_zh_pinyin.php?text=%E4%B8%AD%E6%96%87%E6%B5%8B%E8%AF%95&mode=plain&sep=%20&upper=0内置 GB2312 常用汉字 6763 字的拼音表,支持三种模式:plain 无声调(zhong wen)、tone 带调(zhong1 wen2)、initial 首字母(z w)。
可自定义分隔符 sep,upper=1 输出大写,返回逐字明细 chars(字、拼音、声调、首字母),非汉字原样保留。
多音字取最常用读音(如「银行」的「行」读 xing),需要按词消歧请自行按词处理;纯本地查表,不联网。
| 参数名 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
text |
string | 必填 | 中文测试 | 中文文本,上限 500 字 |
mode |
string | 选填 | plain | plain 无声调 / tone 带调 / initial 首字母 |
sep |
string | 选填 | 音节分隔符,默认空格 | |
upper |
int | 选填 | 0 | 传 1 输出大写 |
https://xxyh.xiaoli.icu/api/p_zh_pinyin.php
此处将显示接口返回结果…
{
"code": 200,
"msg": "ok",
"data": {
"text": "中文测试",
"pinyin": "zhong wen ce shi",
"initial": "z w c s",
"tone": "zhong1 wen2 ce4 shi4",
"chars": [
{ "char": "中", "pinyin": "zhong", "tone": "zhong1", "initial": "z" }
]
}
}
—