{
    "openapi": "3.0.0",
    "info": {
        "title": "标准电码查询 - API文档",
        "version": "1.0.0",
        "description": "标准中文电码查询接口，同时支持简体和繁体查询。type参数为空或0时汉字转电码，为1时电码转汉字。str参数为空或0时返回单个汉字数组形式的对照电码，为1时返回字符串形式的电码。每次查询最多500个字符（含中文标点符号），字符之间不分隔或以空格及半角逗号分隔均可。注意：标准中文电码查询汉字转电码只允许汉字和中文常用标点符号，如果包含不支持的字符会跳码。"
    },
    "servers": [
        {
            "url": "https:\/\/apis.tianapi.com"
        }
    ],
    "paths": {
        "\/telecode\/index": {
            "get": {
                "summary": "查询标准电码信息",
                "tags": [
                    "标准电码查询"
                ],
                "description": "根据电码查询对应的汉字",
                "parameters": [
                    {
                        "name": "key",
                        "in": "query",
                        "description": "API密钥",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "description": "API密钥"
                        }
                    },
                    {
                        "name": "str",
                        "in": "query",
                        "description": "返回类型，数组0[默认]、字符串1",
                        "required": false,
                        "schema": {
                            "type": "int",
                            "example": 0,
                            "description": "返回类型，数组0[默认]、字符串1"
                        }
                    },
                    {
                        "name": "text",
                        "in": "query",
                        "description": "中文汉字\/标准电码",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "天行数据",
                            "description": "中文汉字\/标准电码"
                        }
                    },
                    {
                        "name": "type",
                        "in": "query",
                        "description": "转换类型，字转电码0[默认]、电码转字1",
                        "required": false,
                        "schema": {
                            "type": "int",
                            "example": 0,
                            "description": "转换类型，字转电码0[默认]、电码转字1"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "成功响应",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "code": {
                                            "type": "string",
                                            "example": "1131",
                                            "description": "对应电码"
                                        },
                                        "text": {
                                            "type": "string",
                                            "example": "天",
                                            "description": "中文汉字"
                                        }
                                    }
                                },
                                "example": {
                                    "msg": "success",
                                    "code": 200,
                                    "result": {
                                        "list": [
                                            {
                                                "code": "1131",
                                                "text": "天"
                                            },
                                            {
                                                "code": "5887",
                                                "text": "行"
                                            },
                                            {
                                                "code": "2422",
                                                "text": "数"
                                            },
                                            {
                                                "code": "2207",
                                                "text": "据"
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "summary": "查询标准电码信息",
                "tags": [
                    "标准电码查询"
                ],
                "description": "根据电码查询对应的汉字",
                "requestBody": {
                    "content": {
                        "application\/x-www-form-urlencoded": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "key": {
                                        "type": "string",
                                        "description": "API密钥"
                                    },
                                    "str": {
                                        "type": "int",
                                        "example": 0,
                                        "description": "返回类型，数组0[默认]、字符串1"
                                    },
                                    "text": {
                                        "type": "string",
                                        "example": "天行数据",
                                        "description": "中文汉字\/标准电码"
                                    },
                                    "type": {
                                        "type": "int",
                                        "example": 0,
                                        "description": "转换类型，字转电码0[默认]、电码转字1"
                                    }
                                },
                                "required": [
                                    "key",
                                    "text"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "成功响应",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "code": {
                                            "type": "string",
                                            "example": "1131",
                                            "description": "对应电码"
                                        },
                                        "text": {
                                            "type": "string",
                                            "example": "天",
                                            "description": "中文汉字"
                                        }
                                    }
                                },
                                "example": {
                                    "msg": "success",
                                    "code": 200,
                                    "result": {
                                        "list": [
                                            {
                                                "code": "1131",
                                                "text": "天"
                                            },
                                            {
                                                "code": "5887",
                                                "text": "行"
                                            },
                                            {
                                                "code": "2422",
                                                "text": "数"
                                            },
                                            {
                                                "code": "2207",
                                                "text": "据"
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}