Skip to content

在线试用

normal

{>...0}

接口文档

调用示例

sh
POST https://open.apihub.net/api/text-2-pinyin/{{action}}
apihub-token: {{ apihub_token }}

{
    "text": ".。你好啊abc123"
}
sh
curl -X POST \
  "https://open.apihub.net/api/text-2-pinyin/{{action}}" \
  -H "apihub-token: {{ apihub_token }}" \
  -H "Content-Type: application/json" \
  -d '{
    "text": ".。你好啊abc123"
  }'

参数说明

参数位置类型必传说明
actionPathstr枚举:
- normal:不带声调。如: 中国 -> zhong guo
- tone:声调在韵母第一个字母上。如: 中国 -> zhōng guó
- tone2:声调在各个韵母之后,用数字 [1-4] 进行表示。如: 中国 -> zho1ng guo2
- tone3:声调在各个拼音之后,用数字 [1-4] 进行表示。如: 中国 -> zhong1 guo2
textJsonBodystr需要获取拼音的汉字字符串,其中非汉字字符将原样输出。

返回值说明


{>...3
    "success": true,

    "trace": "400bbd761d1211f0abf0b2e39fc569eb",

    "result": [>...5
        
".。",

        
"ni",

        
"hao",

        
"a",

        
"abc123"

    
]

}