AI舌诊高级版接口通过上传舌头图片进行识别,返回十种舌象出现的概率值,以及可能的体质、证型与对应的调理建议。
https://www.bjbayes.com/admin/api/tongue_analysis_advance| 字段 | 类型 | 必传 | 说明 |
|---|---|---|---|
| appid | String | 是 | 开放平台创建的 appid |
| imgpath | String | 是 | 待识别舌图的网络地址 |
| timestamp | String | 是 | 请求时间,格式 yyyyMMddHHmmss |
| version | String | 是 | API 版本,默认 1.0 |
| sign | String | 是 | 签名:sign = UPPER(MD5( MD5(timestamp) + appKey )) |
| 字段 | 类型 | 说明 |
|---|---|---|
| msg | String | 响应信息,成功为 ok,错误为对应错误信息 |
| code | Int | 200 成功;201 次数不足;400 参数缺失或错误;500 异常 |
| data | JSON | 识别结果数据(含裁剪图、体质概率、调理建议等) |
{
"msg": "成功",
"code": 200,
"data": {
"cutTongue": "http://tonguecut.oss-cn-beijing.aliyuncs.com/xxx.jpg",
"tizhi": { "yangxu": 0.50, "tanshi": 0.48, "qixu": 0.62, ... },
"tiaoli": { "tizhi_name": "气虚体质", "changjianbiaoxian": "...", "sijiyangsheng": "...", ... },
"char": [ { "type": "薄苔", "probability": "0.9984" }, { "type": "有齿痕", "probability": "0.5031" } ]
}
}
以上结构与字段说明参考官方文档(见上方链接)。
// Java (示例)
Map<String, String> body = new HashMap<>();
String ts = new SimpleDateFormat("yyyyMMddHHmmss").format(new Date());
body.put("timestamp", ts);
body.put("appid", "你的APPID");
body.put("version", "1.0");
body.put("imgpath", "https://example.com/tongue.jpg");
body.put("sign", md5(md5(ts) + "你的APPKEY").toUpperCase());
// POST 到 https://www.bjbayes.com/admin/api/tongue_analysis_advance
# Python (示例)
import hashlib, time, requests
def MD5(s): return hashlib.md5(s.encode('utf-8')).hexdigest().upper()
ts = time.strftime('%Y%m%d%H%M%S')
params = {
'timestamp': ts,
'appid': '你的APPID',
'version': '1.0',
'imgpath': 'https://example.com/tongue.jpg',
'sign': MD5(MD5(ts) + '你的APPKEY')
}
r = requests.post('https://www.bjbayes.com/admin/api/tongue_analysis_advance', params=params)
print(r.text)
// JavaScript (示例)
$.ajax({
type: 'POST',
url: 'https://www.bjbayes.com/admin/api/tongue_analysis_advance',
data: {
timestamp: ts,
appid: '你的APPID',
version: '1.0',
imgpath: 'https://example.com/tongue.jpg',
sign: MD5(MD5(ts) + '你的APPKEY')
},
success: function (msg) { console.log(msg); }
});
如需获取接口试用、报价或技术支持,请填写下方信息或直接联系
北京市朝阳区曙光西里甲6号院时间国际7号楼5层
186-0086-8129(黄先生)
contact@benzuai.com
微信扫码添加,获取接口资料与报价