汉字转拼音
最后更新于:2022-04-02 08:17:49
## 汉字转拼音
>[danger]### 会员接口,仅限会员使用,购买[API会员](https://market.topthink.com/product/210)

> 汉字转拼音,支持返回全拼和简拼。
## 接口调用([调用须知](https://docs.topthink.com/think-api/1835086))
### 请求地址
```
GET https://api.topthink.com/xinhua/convert_py
```
### 请求参数
| 名称 | 必填 | 类型 | 说明 |
| --- | --- | --- | --- |
| appCode| 是 |string| 用户授权码,参考[API调用](https://docs.topthink.com/think-api/1835086) |
| text| 是 | string | 文本内容 |
### 返回`data`参数
| 名称 | 类型 | 示例值 | 说明 |
| --- | --- | --- | --- |
| pinyin | string | tian xing shu ju shi yi ge wang luo jie kou ping tai | 拼音 |
| jianxie | string | txsjsygwljkpt | 拼音缩写 |
## SDK调用
```
$client = new Client("YourAppCode");
$result = $client->xinhuaConvertPy()
->withText('开源框架')
->request();
```
返回示例:
~~~
{
"code":0,
"message": "成功的返回",
"data": {
"pinyin": "kai yuan kuang jia",
"jianxie": "kykj"
}
}
~~~
';