{
    "openapi": "3.0.0",
    "info": {
        "title": "新华字典 - API文档",
        "version": "1.0.0",
        "description": "新华汉语词典查询，支持按汉字、拼音、部首和笔画数查询。"
    },
    "servers": [
        {
            "url": "https:\/\/apis.tianapi.com"
        }
    ],
    "paths": {
        "\/xhzd\/index": {
            "get": {
                "summary": "新华字典查询",
                "tags": [
                    "新华字典"
                ],
                "description": "",
                "parameters": [
                    {
                        "name": "key",
                        "in": "query",
                        "description": "API密钥",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "description": "API密钥"
                        }
                    },
                    {
                        "name": "num",
                        "in": "query",
                        "description": "每页返回数量",
                        "required": false,
                        "schema": {
                            "type": "int",
                            "example": 10,
                            "description": "每页返回数量"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "description": "翻页",
                        "required": false,
                        "schema": {
                            "type": "int",
                            "example": 1,
                            "description": "翻页"
                        }
                    },
                    {
                        "name": "type",
                        "in": "query",
                        "description": "查询类型：0汉字[默认]、1拼音、2部首",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": 1,
                            "description": "查询类型：0汉字[默认]、1拼音、2部首"
                        }
                    },
                    {
                        "name": "word",
                        "in": "query",
                        "description": "需要查询的汉字、拼音、部首",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "天",
                            "description": "需要查询的汉字、拼音、部首"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "成功响应",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "py": {
                                            "type": "string",
                                            "example": "tian",
                                            "description": "拼音（无音标）"
                                        },
                                        "pyyb": {
                                            "type": "string",
                                            "example": "tiān",
                                            "description": "拼音（带音标）"
                                        },
                                        "wubi": {
                                            "type": "string",
                                            "example": "gdi",
                                            "description": "五笔"
                                        },
                                        "bihua": {
                                            "type": "int",
                                            "example": 4,
                                            "description": "笔画"
                                        },
                                        "hanzi": {
                                            "type": "string",
                                            "example": "天",
                                            "description": "汉字"
                                        },
                                        "bishun": {
                                            "type": "string",
                                            "example": "1134",
                                            "description": "笔顺"
                                        },
                                        "bushou": {
                                            "type": "string",
                                            "example": "大",
                                            "description": "部首"
                                        },
                                        "content": {
                                            "type": "string",
                                            "example": "天tiān在地面以上的高空：天空......",
                                            "description": "内容"
                                        },
                                        "explain": {
                                            "type": "string",
                                            "example": "天tiān【名】会意。甲骨文字形......",
                                            "description": "详细解释"
                                        }
                                    }
                                },
                                "example": {
                                    "msg": "success",
                                    "code": 200,
                                    "result": {
                                        "py": "tian",
                                        "name": "天",
                                        "pyyb": "tiān",
                                        "wubi": "gdi",
                                        "bihua": 4,
                                        "bishun": "1134",
                                        "bushou": "大",
                                        "content": "天tiān在地面以上的高空：天空。天际。天罡（北斗星）。天渊（上天和深渊，喻差别大）。天马行空（喻气势豪放，不受拘束）......",
                                        "explain": "天tiān【名】会意。甲骨文字形......"
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "summary": "新华字典查询",
                "tags": [
                    "新华字典"
                ],
                "description": "",
                "requestBody": {
                    "content": {
                        "application\/x-www-form-urlencoded": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "key": {
                                        "type": "string",
                                        "description": "API密钥"
                                    },
                                    "num": {
                                        "type": "int",
                                        "example": 10,
                                        "description": "每页返回数量"
                                    },
                                    "page": {
                                        "type": "int",
                                        "example": 1,
                                        "description": "翻页"
                                    },
                                    "type": {
                                        "type": "string",
                                        "example": 1,
                                        "description": "查询类型：0汉字[默认]、1拼音、2部首"
                                    },
                                    "word": {
                                        "type": "string",
                                        "example": "天",
                                        "description": "需要查询的汉字、拼音、部首"
                                    }
                                },
                                "required": [
                                    "key",
                                    "word"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "成功响应",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "py": {
                                            "type": "string",
                                            "example": "tian",
                                            "description": "拼音（无音标）"
                                        },
                                        "pyyb": {
                                            "type": "string",
                                            "example": "tiān",
                                            "description": "拼音（带音标）"
                                        },
                                        "wubi": {
                                            "type": "string",
                                            "example": "gdi",
                                            "description": "五笔"
                                        },
                                        "bihua": {
                                            "type": "int",
                                            "example": 4,
                                            "description": "笔画"
                                        },
                                        "hanzi": {
                                            "type": "string",
                                            "example": "天",
                                            "description": "汉字"
                                        },
                                        "bishun": {
                                            "type": "string",
                                            "example": "1134",
                                            "description": "笔顺"
                                        },
                                        "bushou": {
                                            "type": "string",
                                            "example": "大",
                                            "description": "部首"
                                        },
                                        "content": {
                                            "type": "string",
                                            "example": "天tiān在地面以上的高空：天空......",
                                            "description": "内容"
                                        },
                                        "explain": {
                                            "type": "string",
                                            "example": "天tiān【名】会意。甲骨文字形......",
                                            "description": "详细解释"
                                        }
                                    }
                                },
                                "example": {
                                    "msg": "success",
                                    "code": 200,
                                    "result": {
                                        "py": "tian",
                                        "name": "天",
                                        "pyyb": "tiān",
                                        "wubi": "gdi",
                                        "bihua": 4,
                                        "bishun": "1134",
                                        "bushou": "大",
                                        "content": "天tiān在地面以上的高空：天空。天际。天罡（北斗星）。天渊（上天和深渊，喻差别大）。天马行空（喻气势豪放，不受拘束）......",
                                        "explain": "天tiān【名】会意。甲骨文字形......"
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}