{
    "openapi": "3.0.0",
    "info": {
        "title": "抽取关键词 - API文档",
        "version": "1.0.0",
        "description": "num参数为可选，默认返回10个词语，999为不限数量。大文本关键词抽取时，请使用POST方式请求接口，字符数最多不超过1000。当指定wordtag参数为1时，返回一个包含词性的列表，词性代码释义请参考<a href=\"https:\/\/www.tianapi.com\/article\/150\" target=\"_blank\">中文智能分词接口词性代码释义<\/a>。"
    },
    "servers": [
        {
            "url": "https:\/\/apis.tianapi.com"
        }
    ],
    "paths": {
        "\/cnwords\/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": true,
                        "schema": {
                            "type": "int",
                            "example": 10,
                            "description": "返回数量"
                        }
                    },
                    {
                        "name": "content",
                        "in": "query",
                        "description": "文本内容",
                        "required": true,
                        "schema": {
                            "type": "text",
                            "example": "今天小天去上海外滩和南京东路玩",
                            "description": "文本内容"
                        }
                    },
                    {
                        "name": "wordtag",
                        "in": "query",
                        "description": "返回词性",
                        "required": false,
                        "schema": {
                            "type": "int",
                            "example": 0,
                            "description": "返回词性"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "成功响应",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "word": {
                                            "type": "string",
                                            "example": "上海",
                                            "description": "词语（返回词性）"
                                        },
                                        "index": {
                                            "type": "int",
                                            "example": 3,
                                            "description": "词组排序"
                                        },
                                        "newslist": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            },
                                            "example": "[\"小天\",\"外滩\",\"南京东路\",\"上海\"]",
                                            "description": "分词数组（不返回词性）"
                                        },
                                        "word_tag": {
                                            "type": "int",
                                            "example": 63,
                                            "description": "词性代码"
                                        }
                                    }
                                },
                                "example": {
                                    "msg": "success",
                                    "code": 200,
                                    "result": {
                                        "list": [
                                            "小天",
                                            "外滩",
                                            "南京东路",
                                            "上海"
                                        ]
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "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": "返回数量"
                                    },
                                    "content": {
                                        "type": "text",
                                        "example": "今天小天去上海外滩和南京东路玩",
                                        "description": "文本内容"
                                    },
                                    "wordtag": {
                                        "type": "int",
                                        "example": 0,
                                        "description": "返回词性"
                                    }
                                },
                                "required": [
                                    "key",
                                    "num",
                                    "content"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "成功响应",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "word": {
                                            "type": "string",
                                            "example": "上海",
                                            "description": "词语（返回词性）"
                                        },
                                        "index": {
                                            "type": "int",
                                            "example": 3,
                                            "description": "词组排序"
                                        },
                                        "newslist": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            },
                                            "example": "[\"小天\",\"外滩\",\"南京东路\",\"上海\"]",
                                            "description": "分词数组（不返回词性）"
                                        },
                                        "word_tag": {
                                            "type": "int",
                                            "example": 63,
                                            "description": "词性代码"
                                        }
                                    }
                                },
                                "example": {
                                    "msg": "success",
                                    "code": 200,
                                    "result": {
                                        "list": [
                                            "小天",
                                            "外滩",
                                            "南京东路",
                                            "上海"
                                        ]
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}