AI舌诊高级版 API 文档

接口简介

AI舌诊高级版接口通过上传舌头图片进行识别,返回十种舌象出现的概率值,以及可能的体质、证型与对应的调理建议。

接口地址

  • 访问地址:https://www.bjbayes.com/admin/api/tongue_analysis_advance
  • 请求方式:POST
  • 请求格式:application/x-www-form-urlencoded
  • 编码说明:所有请求与响应为 UTF-8,URL 参数需进行 URL 编码

请求参数

字段 类型 必传 说明
appidString开放平台创建的 appid
imgpathString待识别舌图的网络地址
timestampString请求时间,格式 yyyyMMddHHmmss
versionStringAPI 版本,默认 1.0
signString签名:sign = UPPER(MD5( MD5(timestamp) + appKey ))

响应参数

字段 类型 说明
msgString响应信息,成功为 ok,错误为对应错误信息
codeInt200 成功;201 次数不足;400 参数缺失或错误;500 异常
dataJSON识别结果数据(含裁剪图、体质概率、调理建议等)

返回示例

{
  "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

扫码咨询二维码

扫码咨询

微信扫码添加,获取接口资料与报价

发送咨询