字典查询
<p>[TOC]</p>
<h3>1 接口调用说明</h3>
<p>是一款便捷的汉字查询工具,它能够帮助你快速找到汉字的拼音、部首、笔划、注解以及出处。用户不仅可以通过输入准确的汉字进行检索,还可以根据笔划数或部首来查找相应的汉字。非常适合学生、教师、研究人员以及对汉字学习感兴趣的人士使用。</p>
<h4>1.1 请求方式</h4>
<p>如接口没有单独说明,所有接口均为:<strong>POST</strong></p>
<h4>1.2 请求格式</h4>
<p>如接口没有单独说明,所有接口均为:<strong>application/x-www-form-urlencoded</strong></p>
<h4>1.3 请求参数</h4>
<p>请求参数包括公共参数和业务参数(业务参数见具体接口说明)
调用接口时,需要把<strong>公共参数</strong>和<strong>业务参数</strong>一并放在<strong>请求参数</strong>中提交</p>
<h5>1.3.1 公共请求参数</h5>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必须</th>
<th><div style="width:420px;">说明</div></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>签名,详见<a href="#签名算法">签名算法说明</a></td>
</tr>
</tbody>
</table>
<p><a name="签名算法"></a></p>
<h5>1.3.2 签名算法说明</h5>
<pre><code>sign = sha256(appId + appSecret + timestamp)</code></pre>
<p>用服务商分配的 <strong>appId</strong>、服务商分配的 <strong>appSecret</strong>,当前时间戳(毫秒) <strong>timestamp</strong>,按上述顺序拼接成字符串,再进行 <strong>sha256</strong> 哈希得到。如下:</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>
<h4>1.4 返回说明</h4>
<h5>1.4.1 公共返回字段说明</h5>
<p>所有接口均返回以下公共字段:</p>
<table>
<thead>
<tr>
<th>字段名</th>
<th><div style="width:420px">说明</div></th>
</tr>
</thead>
<tbody>
<tr>
<td>code</td>
<td>返回码,详见:code返回码说明</td>
</tr>
<tr>
<td>msg</td>
<td>code对应的描述</td>
</tr>
<tr>
<td>charge</td>
<td>计费标志 true为计费,false为不计费</td>
</tr>
<tr>
<td>taskNo</td>
<td>本次请求号</td>
</tr>
<tr>
<td>data</td>
<td>返回具体结果,object类型,详见data返回字段描述</td>
</tr>
</tbody>
</table>
<p><a name="code返回码说明"></a></p>
<h5>1.4.2 code返回码说明</h5>
<table>
<thead>
<tr>
<th>code</th>
<th><div style="width:420px;">说明</div></th>
</tr>
</thead>
<tbody>
<tr>
<td>200</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>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>610</td>
<td>请求超时</td>
</tr>
<tr>
<td>999</td>
<td>其他,以实际返回为准</td>
</tr>
</tbody>
</table>
<hr />
<h3>2 字典查询-拼音列表</h3>
<h4>2.1 接口描述</h4>
<ul>
<li>查询所有拼音的列表。</li>
</ul>
<h4>2.2 请求地址</h4>
<p><code>https://api.jumdata.com/dictionary/pinyin/list</code></p>
<h4>2.3 业务参数</h4>
<p>无</p>
<h4>2.4 成功返回样例</h4>
<pre><code class="language-json">{
&quot;code&quot;: 200,// 返回码,详见返回码说明
&quot;msg&quot;: &quot;成功&quot;,// 返回码对应描述
&quot;taskNo&quot;: &quot;723749872167947237115637&quot;,// 本次请求号
&quot;charge&quot;: true,// 计费标志
&quot;data&quot;: {
&quot;items&quot;: [
{
&quot;pinyin&quot;: &quot;a&quot;,//拼音
&quot;py_initial&quot;: &quot;A&quot; //拼音首字母
},
......
{
&quot;pinyin&quot;: &quot;zuo&quot;,
&quot;py_initial&quot;: &quot;Z&quot;
}
]
}
}</code></pre>
<hr />
<h3>3 字典查询-部首列表</h3>
<h4>3.1 接口描述</h4>
<ul>
<li>查询所有部首列表。</li>
</ul>
<h4>3.2 请求地址</h4>
<p><code>https://api.jumdata.com/dictionary/radical/list</code></p>
<h4>3.3 业务参数</h4>
<p>无</p>
<h4>3.4 成功返回样例</h4>
<pre><code class="language-json">{
&quot;code&quot;: 200,// 返回码,详见返回码说明
&quot;msg&quot;: &quot;成功&quot;,// 返回码对应描述
&quot;taskNo&quot;: &quot;640817345176240490515749&quot;,// 本次请求号
&quot;charge&quot;: true,// 计费标志
&quot;data&quot;: {
&quot;items&quot;: [
{
&quot;bihua&quot;: &quot;笔画一&quot;,//笔画
&quot;bushou&quot;: &quot;丨&quot;//部首
},
.....
{
&quot;bihua&quot;: &quot;笔画十五&quot;,
&quot;bushou&quot;: &quot;龍&quot;
},
{
&quot;bihua&quot;: &quot;笔画十五&quot;,
&quot;bushou&quot;: &quot;龠&quot;
}
]
}
}</code></pre>
<hr />
<h3>4 字典查询-拼音查询汉字</h3>
<h4>4.1 接口描述</h4>
<ul>
<li>根据拼音查询返回该拼音下汉字的列表。</li>
</ul>
<h4>4.2 请求地址</h4>
<p><code>https://api.jumdata.com/dictionary/pinyin/query-chinese/list</code></p>
<h4>4.3 业务参数</h4>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必须</th>
<th><div style="width:420px;">说明</div></th>
</tr>
</thead>
<tbody>
<tr>
<td>pinyin</td>
<td>String</td>
<td>是</td>
<td>拼音</td>
</tr>
</tbody>
</table>
<h4>4.4 成功返回样例</h4>
<pre><code class="language-json">{
&quot;code&quot;: 200,// 返回码,详见返回码说明
&quot;msg&quot;: &quot;成功&quot;,// 返回码对应描述
&quot;taskNo&quot;: &quot;574181804182904045116513&quot;,// 本次请求号
&quot;charge&quot;: true,// 计费标志
&quot;data&quot;: {
&quot;items&quot;: [
{
&quot;hanzi&quot;: &quot;仴&quot;,//汉字
&quot;pinyin&quot;: &quot;wo&quot;,//拼音
&quot;bihua&quot;: &quot;6&quot;,//汉字笔画
&quot;py_tone&quot;: &quot;wò,&quot;
},
......
{
&quot;hanzi&quot;: &quot;我&quot;,
&quot;pinyin&quot;: &quot;wo&quot;,
&quot;bihua&quot;: &quot;7&quot;,
&quot;py_tone&quot;: &quot;wǒ,&quot;
}
]
}
}</code></pre>
<h4>4.5 失败返回样例</h4>
<pre><code class="language-json">{
&quot;msg&quot;: &quot;拼音不能为空&quot;,
&quot;code&quot;: 400
}</code></pre>
<hr />
<h3>5 字典查询-部首查询汉字</h3>
<h4>5.1 接口描述</h4>
<ul>
<li>根据部首查询该部首下汉字的列表。</li>
</ul>
<h4>5.2 请求地址</h4>
<p><code>https://api.jumdata.com/dictionary/radical/query-chinese/list</code></p>
<h4>5.3 业务参数</h4>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必须</th>
<th><div style="width:420px;">说明</div></th>
</tr>
</thead>
<tbody>
<tr>
<td>radical</td>
<td>String</td>
<td>是</td>
<td>部首</td>
</tr>
</tbody>
</table>
<h4>5.4 成功返回样例</h4>
<pre><code class="language-json">{
&quot;code&quot;: 200,// 返回码,详见返回码说明
&quot;msg&quot;: &quot;成功&quot;,// 返回码对应描述
&quot;taskNo&quot;: &quot;865074777153814744844679&quot;,// 本次请求号
&quot;charge&quot;: true,//计费标志
&quot;data&quot;: {
&quot;items&quot;: [
{
&quot;hanzi&quot;: &quot;力&quot;,//汉字
&quot;pinyin&quot;: &quot;lì&quot;,//拼音
&quot;bihua&quot;: &quot;2&quot;,//笔画
&quot;bushou&quot;: &quot;力&quot;//汉字首部
}
]
}
}</code></pre>
<h4>5.5 失败返回样例</h4>
<pre><code class="language-json">{
&quot;msg&quot;: &quot;部首不能为空&quot;,
&quot;code&quot;: 400
}</code></pre>
<hr />
<h3>6 字典查询-汉字详细信息</h3>
<h4>6.1 接口描述</h4>
<ul>
<li>根据汉字查询该汉字的详细信息。</li>
</ul>
<h4>6.2 请求地址</h4>
<p><code>https://api.jumdata.com/dictionary/chinese/detail</code></p>
<h4>6.3 业务参数</h4>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必须</th>
<th><div style="width:420px;">说明</div></th>
</tr>
</thead>
<tbody>
<tr>
<td>chinese</td>
<td>String</td>
<td>是</td>
<td>汉字</td>
</tr>
</tbody>
</table>
<h4>6.4 成功返回样例</h4>
<pre><code class="language-json">{
&quot;code&quot;: 200,// 返回码,详见返回码说明
&quot;msg&quot;: &quot;成功&quot;,// 返回码对应描述
&quot;taskNo&quot;: &quot;894812619150840968931577&quot;,// 本次请求号
&quot;charge&quot;: true,//计费标志
&quot;data&quot;: {
&quot;wubi&quot;: &quot;&quot;,//五笔
&quot;hanzi&quot;: &quot;好&quot;,//汉字
&quot;pinyin&quot;: &quot;hào hǎo&quot;,//拼音
&quot;basic_explain&quot;: [//基本解释
&quot;好&quot;,
&quot;hǎo&quot;,
&quot;优点多或使人满意的,与“坏”相对:好人。好汉。好歹。好事多磨。&quot;,
&quot;身体康健,疾病消失,生活幸福:您好。安好。&quot;
&quot;笔画数:6&quot;,
&quot;部首:女&quot;,
&quot;笔顺编号:531521&quot;
],
&quot;words&quot;: &quot;好艾 好了疮疤忘了痛 好心办坏事 好办 好力宝 &quot;,//组词
&quot;detail_explain&quot;: [ //详细解释
&quot;详细字义&quot;,
&quot;好 hǎo&quot;,
&quot;〈形〉&quot;,
&quot;(1) (会意。从女,从子。本义:美,貌美)&quot;,
&quot;(2) 指女子貌美 [beautiful]&quot;,
&quot;好,美也。——《说文》&quot;,
&quot;凡美色或谓之好。——《方言二》&quot;,
&quot;不可谓好。——《国语·晋语》。注:“美也。”&quot;,
&quot;是女子不好。——《史记·滑稽列传》&quot;,
&quot;鬼侯有子而好。——《战国策·赵策》&quot;,
&quot;秦氏有好女。——《乐府诗集·陌上桑》&quot;,
&quot;(3) 又如:好皮囊(好看的外貌);好鸟(美丽的鸟);好不丑(反语。即好不俊,俊得很);好美(美貌);好闲(容貌美丽,举止闲雅);好妇(美貌的妇女)&quot;
],
&quot;bushou&quot;: &quot;&quot;,//部首
&quot;bihua&quot;: &quot;6&quot; //笔画
}
}</code></pre>
<h4>6.5 失败返回样例</h4>
<pre><code class="language-json">{
&quot;msg&quot;: &quot;汉字不能为空&quot;,
&quot;code&quot;: 400
}</code></pre>
<h3>7 字典查询-词语或成语解释</h3>
<h4>7.1 接口描述</h4>
<ul>
<li>根据词语或成语查询该词语或成语的解释。</li>
</ul>
<h4>7.2 请求地址</h4>
<p><code>https://api.jumdata.com/dictionary/idiom/explain</code></p>
<h4>7.3 业务参数</h4>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必须</th>
<th><div style="width:420px;">说明</div></th>
</tr>
</thead>
<tbody>
<tr>
<td>idiom</td>
<td>String</td>
<td>是</td>
<td>词语或成语</td>
</tr>
</tbody>
</table>
<h4>7.4 成功返回样例</h4>
<pre><code class="language-json">{
&quot;code&quot;: 200,// 返回码,详见返回码说明
&quot;msg&quot;: &quot;成功&quot;,// 返回码对应描述
&quot;taskNo&quot;: &quot;673828036172939428121036&quot;,// 本次请求号
&quot;charge&quot;: true,//计费标志
&quot;data&quot;: {
&quot;pinyin&quot;: &quot;zhēn biān shí bì&quot;,//拼音
&quot;cidian_explain&quot;: &quot;(1)像医病一样,指出时代和社会问题,又针又砭,求得改正向善。&quot;,//词典对词语或成语的解释
&quot;allusion_explain&quot;: &quot;&quot;,//成语字典对成语的解释
&quot;ciyu&quot;: &quot;针砭时弊&quot;//词语或成语
}
}</code></pre>
<h4>7.5 失败返回样例</h4>
<pre><code class="language-json">{
&quot;msg&quot;: &quot;词语或成语不能为空&quot;,
&quot;code&quot;: 400
}</code></pre>