{
    "openapi": "3.0.0",
    "info": {
        "title": "数字识别 - API文档",
        "version": "1.0.0",
        "description": "识别图片中的数字内容和对应位置，并过滤其他非数字内容。"
    },
    "servers": [
        {
            "url": "https:\/\/apis.tianapi.com"
        }
    ],
    "paths": {
        "\/ocrnum\/index": {
            "get": {
                "summary": "数字识别",
                "tags": [
                    "数字识别"
                ],
                "description": "OCR数字识别，学习计算类场景应用",
                "parameters": [
                    {
                        "name": "img",
                        "in": "query",
                        "description": "图片base64编码（与imgurl参数二选一）",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "base64",
                            "description": "图片base64编码（与imgurl参数二选一）"
                        }
                    },
                    {
                        "name": "key",
                        "in": "query",
                        "description": "API密钥",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "description": "API密钥"
                        }
                    },
                    {
                        "name": "imgurl",
                        "in": "query",
                        "description": "图片URL（支持jpg\/png\/bmp\/gif格式）",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "https:\/\/www.tianapi.com\/static\/img\/ocr\/number.jpg",
                            "description": "图片URL（支持jpg\/png\/bmp\/gif格式）"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "成功响应",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "+top": {
                                            "type": "int",
                                            "example": 31,
                                            "description": "左上顶点的垂直坐标"
                                        },
                                        "+left": {
                                            "type": "int",
                                            "example": 440,
                                            "description": "左上顶点的水平坐标"
                                        },
                                        "words": {
                                            "type": "string",
                                            "example": "20230523",
                                            "description": "数字内容"
                                        },
                                        "+width": {
                                            "type": "int",
                                            "example": 125,
                                            "description": "数字位置的宽度"
                                        },
                                        "+height": {
                                            "type": "int",
                                            "example": 23,
                                            "description": "数字位置的高度"
                                        },
                                        "location": {
                                            "type": "object",
                                            "description": "数字位置"
                                        }
                                    }
                                },
                                "example": {
                                    "msg": "success",
                                    "code": 200,
                                    "result": {
                                        "list": [
                                            {
                                                "words": "20230523",
                                                "location": {
                                                    "top": 31,
                                                    "left": 440,
                                                    "width": 125,
                                                    "height": 23
                                                }
                                            },
                                            {
                                                "words": "601715200932",
                                                "location": {
                                                    "top": 345,
                                                    "left": 31,
                                                    "width": 188,
                                                    "height": 30
                                                }
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "summary": "数字识别",
                "tags": [
                    "数字识别"
                ],
                "description": "OCR数字识别，学习计算类场景应用",
                "requestBody": {
                    "content": {
                        "application\/x-www-form-urlencoded": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "img": {
                                        "type": "string",
                                        "example": "base64",
                                        "description": "图片base64编码（与imgurl参数二选一）"
                                    },
                                    "key": {
                                        "type": "string",
                                        "description": "API密钥"
                                    },
                                    "imgurl": {
                                        "type": "string",
                                        "example": "https:\/\/www.tianapi.com\/static\/img\/ocr\/number.jpg",
                                        "description": "图片URL（支持jpg\/png\/bmp\/gif格式）"
                                    }
                                },
                                "required": [
                                    "img",
                                    "key"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "成功响应",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "+top": {
                                            "type": "int",
                                            "example": 31,
                                            "description": "左上顶点的垂直坐标"
                                        },
                                        "+left": {
                                            "type": "int",
                                            "example": 440,
                                            "description": "左上顶点的水平坐标"
                                        },
                                        "words": {
                                            "type": "string",
                                            "example": "20230523",
                                            "description": "数字内容"
                                        },
                                        "+width": {
                                            "type": "int",
                                            "example": 125,
                                            "description": "数字位置的宽度"
                                        },
                                        "+height": {
                                            "type": "int",
                                            "example": 23,
                                            "description": "数字位置的高度"
                                        },
                                        "location": {
                                            "type": "object",
                                            "description": "数字位置"
                                        }
                                    }
                                },
                                "example": {
                                    "msg": "success",
                                    "code": 200,
                                    "result": {
                                        "list": [
                                            {
                                                "words": "20230523",
                                                "location": {
                                                    "top": 31,
                                                    "left": 440,
                                                    "width": 125,
                                                    "height": 23
                                                }
                                            },
                                            {
                                                "words": "601715200932",
                                                "location": {
                                                    "top": 345,
                                                    "left": 31,
                                                    "width": 188,
                                                    "height": 30
                                                }
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}