{
    "openapi": "3.0.0",
    "info": {
        "title": "食物营养识别 - API文档",
        "version": "1.0.0",
        "description": "通过输入图像资源，识别近两千种常见食物的详细营养成分及100克下的营养元素含量、热量(大卡)等近三十多项参数。返回参数type为未知结果时，表示图像识别成功但图像内容非有机物或无法查询营养成分。文章底部可查看营养元素成分列表：<a href=\"https:\/\/www.tianapi.com\/article\/110\" target=\"_blank\">营养成分名称表<\/a>"
    },
    "servers": [
        {
            "url": "https:\/\/apis.tianapi.com"
        }
    ],
    "paths": {
        "\/imgnutrient\/index": {
            "post": {
                "summary": "食物营养识别",
                "tags": [
                    "食物营养识别"
                ],
                "description": "事物原材料营养成分含量查询，健康生活现在开始",
                "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\/kc.jpg",
                                        "description": "图片URL地址（支持jpg\/png\/bmp格式）"
                                    }
                                },
                                "required": [
                                    "img",
                                    "key"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "成功响应",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "la": {
                                            "type": "float",
                                            "example": 585.2,
                                            "description": "钠"
                                        },
                                        "lb": {
                                            "type": "float",
                                            "example": 2.7,
                                            "description": " 胡罗卜素"
                                        },
                                        "rl": {
                                            "type": "float",
                                            "example": 386,
                                            "description": "热量(大卡)"
                                        },
                                        "su": {
                                            "type": "float",
                                            "example": 0.07,
                                            "description": "核黄素"
                                        },
                                        "xi": {
                                            "type": "float",
                                            "example": 8.6,
                                            "description": "硒"
                                        },
                                        "ys": {
                                            "type": "float",
                                            "example": 0.7,
                                            "description": "烟酸"
                                        },
                                        "zf": {
                                            "type": "float",
                                            "example": 17.6,
                                            "description": "脂肪"
                                        },
                                        "dbz": {
                                            "type": "float",
                                            "example": 6.9,
                                            "description": "蛋白质"
                                        },
                                        "dgc": {
                                            "type": "float",
                                            "example": 0,
                                            "description": "胆固醇"
                                        },
                                        "gai": {
                                            "type": "float",
                                            "example": 6,
                                            "description": "钙(毫克)"
                                        },
                                        "jia": {
                                            "type": "float",
                                            "example": 227,
                                            "description": "钾"
                                        },
                                        "las": {
                                            "type": "float",
                                            "example": 0.01,
                                            "description": "硫胺素"
                                        },
                                        "mei": {
                                            "type": "float",
                                            "example": 19,
                                            "description": "镁"
                                        },
                                        "shc": {
                                            "type": "float",
                                            "example": 21.8,
                                            "description": "视黄醇当量"
                                        },
                                        "tei": {
                                            "type": "float",
                                            "example": 1,
                                            "description": "铁"
                                        },
                                        "xin": {
                                            "type": "float",
                                            "example": 0.75,
                                            "description": "锌"
                                        },
                                        "ling": {
                                            "type": "float",
                                            "example": 77,
                                            "description": "磷"
                                        },
                                        "meng": {
                                            "type": "float",
                                            "example": 0.52,
                                            "description": "锰"
                                        },
                                        "name": {
                                            "type": "string",
                                            "example": "油条",
                                            "description": "食品名称"
                                        },
                                        "shhf": {
                                            "type": "float",
                                            "example": 50.1,
                                            "description": "碳水化合物"
                                        },
                                        "ssxw": {
                                            "type": "float",
                                            "example": 0.9,
                                            "description": "膳食纤维"
                                        },
                                        "tong": {
                                            "type": "float",
                                            "example": 0.19,
                                            "description": "铜"
                                        },
                                        "type": {
                                            "type": "string",
                                            "example": "谷类",
                                            "description": "食品种类，返回未知结果时无成分参数"
                                        },
                                        "wsfc": {
                                            "type": "float",
                                            "example": 0,
                                            "description": "维生素C"
                                        },
                                        "wssa": {
                                            "type": "float",
                                            "example": 0,
                                            "description": "维生素A"
                                        },
                                        "wsse": {
                                            "type": "float",
                                            "example": 3.19,
                                            "description": "维生素E"
                                        },
                                        "trust": {
                                            "type": "float",
                                            "example": 0.85,
                                            "description": "食品置信度"
                                        }
                                    }
                                },
                                "example": {
                                    "msg": "success",
                                    "code": 200,
                                    "result": {
                                        "list": [
                                            {
                                                "la": 796.3,
                                                "lb": 3.2,
                                                "rl": 234,
                                                "su": 0.32,
                                                "xi": 6.73,
                                                "ys": 5.8,
                                                "zf": 11.6,
                                                "dbz": 26.4,
                                                "dgc": 93,
                                                "gai": 52,
                                                "jia": 430,
                                                "las": 0.03,
                                                "mei": 54,
                                                "shc": 52.8,
                                                "tei": 6.7,
                                                "xin": 4.94,
                                                "ling": 230,
                                                "meng": 0.3,
                                                "name": "羊肉串",
                                                "shhf": 6,
                                                "ssxw": 0,
                                                "tong": 0.16,
                                                "type": "畜肉类",
                                                "wsfc": 0,
                                                "wssa": 42,
                                                "wsse": 1.8,
                                                "trust": 0.849583
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}