食物热量-详情
<p>[TOC]</p>
<h3>接口描述</h3>
<ul>
<li>根据食物ID查询食物热量,卡路里和其他很多元素含量查询。</li>
</ul>
<h3>请求地址</h3>
<p><code>https://api.jumdata.com/food/heat/detail</code></p>
<h3>请求方式</h3>
<ul>
<li>POST</li>
</ul>
<h3>请求格式</h3>
<ul>
<li>x-www-form-urlencoded</li>
</ul>
<h3>请求参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必须</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>appId</td>
<td>String</td>
<td>是</td>
<td>服务商分配的唯一标识</td>
</tr>
<tr>
<td>timestamp</td>
<td>long</td>
<td>是</td>
<td>当前时间的毫秒数</td>
</tr>
<tr>
<td>sign</td>
<td>String</td>
<td>是</td>
<td>签名,详见签名算法说明</td>
</tr>
<tr>
<td>foodId</td>
<td>String</td>
<td>是</td>
<td>食物id</td>
</tr>
</tbody>
</table>
<h3>签名算法说明</h3>
<p><code>sign = sha256(appId + appSecret + timestamp)</code></p>
<p>用服务商分配的 appId、服务商分配的 appSecret,当前时间毫秒数 timestamp,按上述顺序拼接成字符串,再进行 sha256 哈希得到。如下:</p>
<pre><code class="language-java">String appId = &quot;xyzxy2121zxyz&quot;;
String timestamp = &quot;1555378976238&quot;;
String appSecret = &quot;efcefcef1121cefcefc1212121&quot;;
String str = appId + appSecret + timestamp;
String sign = sha256(str);</code></pre>
<h3>成功返回样例</h3>
<pre><code class="language-json">{
&quot;code&quot;: 200,//返回码,详见返回码说明
&quot;success&quot;: true,//返回码对应描述
&quot;taskNo&quot;: &quot;655975173185003644802221&quot;,//本次请求号
&quot;charge&quot;: true,//计费标志
&quot;data&quot;: {
&quot;seleniumUnit&quot;: &quot;微克&quot;,//硒值单位
&quot;cookBook&quot;: { //菜谱信息
&quot;ext&quot;: &quot;1. 西红柿洗净切片;\n2. 撒上白糖,放入冰箱冷藏2h以上即可。&quot;,//制作步骤
&quot;minorMaterialsData&quot;: [],//辅料
&quot;cookbookName&quot;: &quot;糖拌西红柿&quot;,//菜谱名称
&quot;majorMaterialsData&quot;: [ //主料
{
&quot;name&quot;: &quot;番茄&quot;,//名字
&quot;weight&quot;: 400,//重量
&quot;desc&quot;: &quot;&quot;
}
],
&quot;seasoningData&quot;: [ //配料
{
&quot;name&quot;: &quot;白砂糖&quot;,//名字
&quot;weight&quot;: 10,//重量
&quot;desc&quot;: &quot;&quot;
}
]
},
&quot;calciumUnit&quot;: &quot;毫克&quot;,//钙值单位
&quot;proteinUnit&quot;: &quot;克&quot;,//蛋白质单位
&quot;kalium&quot;: &quot;174.76&quot;,//钾值
&quot;vitaminKUnit&quot;: &quot;微克&quot;,//维生素K值单位
&quot;caloryUnit&quot;: &quot;千卡&quot;,//热量单位
&quot;carbohydrate&quot;: &quot;5.66&quot;,//碳水化合物值
&quot;fattyAcidUnit&quot;: &quot;克&quot;,//反式脂肪单位
&quot;cholineUnit&quot;: &quot;毫克&quot;,//胆碱值单位
&quot;healthSuggest&quot;: &quot;推荐食用&quot;,//健康建议
&quot;cover&quot;: &quot;https://test-img2.anqkj.cn/foot-heat/202506/01/5d031bee11fad96861d6aa012ca7c3056c4b1c99f2031f9c1eb91fad325da71f.jpg&quot;,//封面
&quot;calory&quot;: &quot;24.39&quot;,//热量值
&quot;kaliumUnit&quot;: &quot;毫克&quot;,//钾值单位
&quot;fluorineUnit&quot;: &quot;毫克&quot;,//氟值单位
&quot;protein&quot;: &quot;0.88&quot;,//蛋白质值
&quot;vitaminAUnit&quot;: &quot;微克RAE&quot;,//维生素A值单位
&quot;fat&quot;: &quot;0.2&quot;,//脂肪值
&quot;fattyAcid&quot;: &quot;&quot;,//反式脂肪值
&quot;thiamine&quot;: &quot;0.02&quot;,//维生素B1值
&quot;cholesterol&quot;: &quot;0.0&quot;,//胆固醇值
&quot;vitaminB12&quot;: &quot;0.0&quot;,//维生素B12值
&quot;zinc&quot;: &quot;0.12&quot;,//锌值
&quot;alcohol&quot;: &quot;0.0&quot;,//酒精度值
&quot;mufaUnit&quot;: &quot;克&quot;,//单不饱和脂肪值单位
&quot;caroteneUnit&quot;: &quot;微克&quot;,//胡萝卜素值单位
&quot;vitaminC&quot;: &quot;13.66&quot;,//维生素C值
&quot;copperUnit&quot;: &quot;毫克&quot;,//铜值单位
&quot;vitaminE&quot;: &quot;0.41&quot;,//维生素E值
&quot;vitaminD&quot;: &quot;0.0&quot;,//维生素D值
&quot;biotin&quot;: &quot;2.24&quot;,//生物素值
&quot;carotene&quot;: &quot;365.85&quot;,//胡萝卜素值
&quot;niacin&quot;: &quot;0.48&quot;,//烟酸值
&quot;healthTips&quot;: &quot;绿灯食物&quot;,//健康描述
&quot;lactoflavinUnit&quot;: &quot;毫克&quot;,//维生素B2值单位
&quot;vitaminB6Unit&quot;: &quot;毫克&quot;,//维生素B6值单位
&quot;magnesium&quot;: &quot;11.78&quot;,//镁值
&quot;vitaminK&quot;: &quot;0.0&quot;,//维生素K值
&quot;biotinUnit&quot;: &quot;微克&quot;,//生物素值单位
&quot;glycemicInfoData&quot;: {// gi gl数据信息
&quot;gi&quot;: { //gi信息
&quot;label&quot;: &quot;&quot;,//gi描述信息
&quot;value&quot;: &quot;&quot;//gi值
},
&quot;gl&quot;: {//gl信息
&quot;label&quot;: &quot;&quot;,//gl描述信息
&quot;value&quot;: &quot;&quot;//gl值
}
},
&quot;carbohydrateUnit&quot;: &quot;克&quot;,//碳水化合物值单位
&quot;thiamineUnit&quot;: &quot;毫克&quot;,//维生素B1值单位
&quot;pufa&quot;: &quot;0.0&quot;,//多不饱和脂肪值
&quot;name&quot;: &quot;糖拌西红柿&quot;,//食物名称
&quot;vitaminA&quot;: &quot;30.24&quot;,//维生素A值
&quot;folacinUnit&quot;: &quot;微克&quot;,//叶酸值单位
&quot;natrium&quot;: &quot;9.47&quot;,//钠值
&quot;sugar&quot;: &quot;1.7&quot;,//糖值
&quot;joule&quot;: &quot;100.42&quot;,//热量千焦值
&quot;phosphorUnit&quot;: &quot;毫克&quot;,//磷值单位
&quot;fiberDietaryUnit&quot;: &quot;克&quot;,//膳食纤维值单位
&quot;manganeseUnit&quot;: &quot;毫克&quot;,//锰值单位
&quot;zincUnit&quot;: &quot;毫克&quot;,//锌值单位
&quot;foodId&quot;: &quot;2ddb810b69d5ca7c&quot;,//食物id
&quot;phosphor&quot;: &quot;23.61&quot;,//磷值
&quot;natriumUnit&quot;: &quot;毫克&quot;,// 钠值单位
&quot;magnesiumUnit&quot;: &quot;毫克&quot;,//镁值单位
&quot;vitaminB12Unit&quot;: &quot;微克&quot;,//维生素B12值单位
&quot;manganese&quot;: &quot;0.06&quot;,//锰值
&quot;pantothenic&quot;: &quot;0.09&quot;,//泛酸值
&quot;folacin&quot;: &quot;8.1&quot;,//叶酸值
&quot;mufa&quot;: &quot;0.0&quot;,//单不饱和脂肪值
&quot;choline&quot;: &quot;0.0&quot;,//胆碱值
&quot;selenium&quot;: &quot;0.0&quot;,//硒值
&quot;vitaminB6&quot;: &quot;0.0&quot;,//维生素B6值
&quot;jouleUnit&quot;: &quot;千焦&quot;,//热量单位
&quot;copper&quot;: &quot;0.04&quot;,//铜值
&quot;iodine&quot;: &quot;2.44&quot;,//碘值
&quot;iodineUnit&quot;: &quot;微克&quot;,//碘值单位
&quot;fluorine&quot;: &quot;&quot;,//氟值
&quot;healthLight&quot;: 1,//健康等级
&quot;cholesterolUnit&quot;: &quot;毫克&quot;,//胆固醇值单位
&quot;calcium&quot;: &quot;4.39&quot;,//钙值
&quot;sugarUnit&quot;: &quot;克&quot;,//糖值单位
&quot;vitaminEUnit&quot;: &quot;毫克&quot;,//维生素E值单位
&quot;pufaUnit&quot;: &quot;克&quot;,//多不饱和脂肪值单位
&quot;pantothenicUnit&quot;: &quot;毫克&quot;,//泛酸值单位
&quot;ironUnit&quot;: &quot;毫克&quot;,//铁值单位
&quot;fatUnit&quot;: &quot;克&quot;,//脂肪单位
&quot;saturatedFat&quot;: &quot;0.0&quot;,//饱和脂肪值
&quot;vitaminCUnit&quot;: &quot;毫克&quot;,//维生素C值单位
&quot;saturatedFatUnit&quot;: &quot;克&quot;,//饱和脂肪值单位
&quot;vitaminDUnit&quot;: &quot;微克&quot;,//维生素D值单位
&quot;niacinUnit&quot;: &quot;毫克&quot;,//烟酸值单位
&quot;lactoflavin&quot;: &quot;0.01&quot;,//维生素B2值
&quot;iron&quot;: &quot;0.21&quot;,//铁值
&quot;fiberDietary&quot;: &quot;0.98&quot;,//膳食纤维值
&quot;alcoholUnit&quot;: &quot;度&quot; //酒精度值单位
}
}</code></pre>
<h3>失败返回样例</h3>
<pre><code class="language-json">{
&quot;msg&quot;: &quot;食物id不能为空&quot;,
&quot;code&quot;: 400
}</code></pre>
<h3>返回字段说明</h3>
<table>
<thead>
<tr>
<th>字段名</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>code</td>
<td>返回码,详见返回码说明</td>
</tr>
<tr>
<td>msg</td>
<td>code对应的描述</td>
</tr>
<tr>
<td>charge</td>
<td>计费标志</td>
</tr>
<tr>
<td>taskNo</td>
<td>本次请求号</td>
</tr>
<tr>
<td>data</td>
<td>返回具体结果,详见成功返回样例</td>
</tr>
</tbody>
</table>
<h4>code返回码说明</h4>
<table>
<thead>
<tr>
<th>code</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>200</td>
<td>成功 (计费)</td>
</tr>
<tr>
<td>201</td>
<td>查无数据</td>
</tr>
<tr>
<td>400</td>
<td>参数错误</td>
</tr>
<tr>
<td>404</td>
<td>接口地址不正确</td>
</tr>
<tr>
<td>500</td>
<td>系统维护,请稍候再试</td>
</tr>
<tr>
<td>601</td>
<td>接口未开通</td>
</tr>
<tr>
<td>602</td>
<td>账号停用</td>
</tr>
<tr>
<td>603</td>
<td>余额不足请充值</td>
</tr>
<tr>
<td>604</td>
<td>接口停用</td>
</tr>
<tr>
<td>606</td>
<td>调用超限,请稍候再试</td>
</tr>
<tr>
<td>607</td>
<td>ip不在白名单</td>
</tr>
<tr>
<td>609</td>
<td>请求过于频繁,请稍候再试</td>
</tr>
<tr>
<td>999</td>
<td>其他,以实际返回为准</td>
</tr>
</tbody>
</table>