返回 | 接口 / 文本工具 / 中文转拼音
GET 文本工具

中文转拼音

中文转换拼音,严格模式,不可包含非中文

累计调用 12 今日调用 0

更新于 2026-10-16

调用地址

GET
https://itapi.top/api/Pinyin

请求参数

参数名类型必填说明示例
text string 必填 中文,且仅为中文 暂无
format int 可选 1为携带音标,默认不携带 暂无
type string 可选 返回格式 暂无

返回字段

字段名类型说明
code number 状态码
message string 返回内容
data array 返回数据
data.result.* array 纯拼音内容
data.res.* array 包含内容与拼音

响应示例

200 OK
{
    "code": 1,
    "message": "nǐ,hǎo",
    "data": {
        "result": [
            "nǐ",
            "hǎo"
        ],
        "res": {
            "你": "nǐ",
            "好": "hǎo"
        }
    },
    "timestamp": 1791344785423,
    "req_timestamp": 1791344785380
}

在线测试

代码示例

cURL · GET
curl "https://itapi.top/api/Pinyin?text=%E6%9A%82%E6%97%A0&format=%E6%9A%82%E6%97%A0&type=%E6%9A%82%E6%97%A0"
PHP
<?php
$res  = file_get_contents("https://itapi.top/api/Pinyin?text=%E6%9A%82%E6%97%A0&format=%E6%9A%82%E6%97%A0&type=%E6%9A%82%E6%97%A0");
$json = json_decode($res, true);
print_r($json);
JavaScript
const res  = await fetch("https://itapi.top/api/Pinyin?text=%E6%9A%82%E6%97%A0&format=%E6%9A%82%E6%97%A0&type=%E6%9A%82%E6%97%A0");
const json = await res.json();
console.log(json);
Python
import requests

r = requests.get("https://itapi.top/api/Pinyin?text=%E6%9A%82%E6%97%A0&format=%E6%9A%82%E6%97%A0&type=%E6%9A%82%E6%97%A0", timeout=10)
print(r.json())
返回接口列表