接口地址:https://www.mxnzp.com/api/convert/dictionary |
---|
返回格式:json |
请求方式:get |
请求示例:https://www.mxnzp.com/api/convert/dictionary?content=穆&app_id=your&app_secret=your |
名称 | 类型 | 必填 | 说明 |
---|---|---|---|
app_id | string | 必填 | app_id 扫码关注公众号 |
app_secret | string | 必填 | app_secret 扫码关注公众号 |
content | string | 必填 | 被查询的汉字内容 |
名称 | 类型 | 说明 |
---|---|---|
word | string | 原内容 |
traditional | string | 繁体 |
pinyin | string | 拼音 |
radicals | string | 偏旁部首 |
explanation | string | 汉字释义 |
strokes | string | 汉字笔画数 |
{
"code": 1,
"msg": "数据返回成功!",
"data": [{
"word": "穆",
"traditional": "穆",
"pinyin": "mù",
"radicals": "禾",
"explanation": "穆 \n\n (形声。本义禾名)\n\n 同本义 \n\n 穆,禾也。--《说文》。段玉裁注盖禾有名穆者也。”\n\n 古时宗庙制度,父居左为昭,子居右为穆。参见昭穆” \n\n 辩庙祧之昭穆。--《周礼·小宗伯》。注父曰昭,子曰穆。”\n\n 代指右边 \n\n 只见贾府人分了昭穆,排班立定。--《红楼梦》\n\n 又如昭穆(左边和右边)\n\n 姓\n\n 穆 \n\n 恭敬 \n\n 于穆清庙。--《诗·周颂·清庙》\n\n 穆穆皇皇。--《诗·大雅·假乐》\n\n 我其为王穆卜。--《书·金滕》。传\n\n 穆mù\n\n ⒈和畅,美好~如清风。\n\n ⒉和睦不~。\n\n ⒊恭敬,严肃静~。肃~。~ ~皇皇(皇皇美好的样子)。",
"strokes": 16
}]
}
错误码 | 说明 |
---|---|
0 | app_id或者app_secret不合法 |
<?php
/**
* Created by PhpStorm.
* User: FZS
* Time: 2022/10/08 08:56
*/
class freeApi
{
private $apiUrl;
public function __construct()
{
$this->apiUrl = 'https://www.mxnzp.com/api/convert/dictionary?content=穆&app_id=your&app_secret=your';
}
/**
* 获取结果
* @return array
*/
public function getResult()
{
return file_get_contents($this->apiUrl);
}
}
package main
import (
"fmt"
"io/ioutil"
"log"
"net/http"
)
const (
APIURL = "https://www.mxnzp.com/api/convert/dictionary?content=穆&app_id=your&app_secret=your"
)
func main() {
queryUrl := fmt.Sprintf("%s",APIURL)
resp, err := http.Get(queryUrl)
if err != nil {
log.Println(err)
return
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}