cURL
curl "https://api.ruseo.cn/api/chengyu?words=%E5%A4%A9%E9%A9%AC%E8%A1%8C%E7%A9%BA"
查询成语详细信息,包括拼音、解释、出处、同义词、反义词、例句等,优先使用本地缓存。
https://api.ruseo.cn/api/chengyu
接口调用前需要确认的核心配置。
/api/chengyuchengyu必填参数必须传入,示例值可直接用于联调。
免费API不强制要求API Key,但如果您希望统计个人调用次数,请在请求时附加参数 key=您的API_KEY。
注册账号后即可获得API Key。
| 参数名 | 必填 | 类型 | 说明 | 示例值 |
|---|---|---|---|---|
key |
否 | string | 可选参数:携带此参数可统计您的个人调用次数。请注册账号获取API Key。 | YOUR_API_KEY |
words |
是 | string | 要查询的成语 | 天马行空 |
优先使用示例地址测试请求参数是否正确。
https://api.ruseo.cn/api/chengyu?words=%E5%A4%A9%E9%A9%AC%E8%A1%8C%E7%A9%BA
curl "https://api.ruseo.cn/api/chengyu?words=%E5%A4%A9%E9%A9%AC%E8%A1%8C%E7%A9%BA"
$url = 'https://api.ruseo.cn/api/chengyu?words=%E5%A4%A9%E9%A9%AC%E8%A1%8C%E7%A9%BA';
$response = file_get_contents($url);
$data = json_decode($response, true);
fetch('https://api.ruseo.cn/api/chengyu?words=%E5%A4%A9%E9%A9%AC%E8%A1%8C%E7%A9%BA')
.then(res => res.json())
.then(data => console.log(data));
实际返回内容以接口脚本处理结果为准。
{
"code": 0,
"msg": "success",
"data": {
"route": "chengyu",
"example": true
}
}
| 参数名 | 类型 | 说明 | 示例值 |
|---|---|---|---|
code |
integer | 状态码,200成功,400错误 | 200 |
msg |
string | 信息提示 | success |
words |
string | 成语名称 | 焕然一新 |
bushou |
string | 成语首字部首 | 火 |
shouzi |
string | 成语首字 | 焕 |
pingyin |
string | 成语拼音 | huàn rán yī xīn |
jieshi |
string | 成语解释 | 焕然:鲜明光亮的样子。改变旧面貌,出现崭新的气象。 |
chuchu |
string | 成语出处 | 唐·张彦远《历代名画记》 |
tongyi |
string | 成语同义词 | 面目一新,耳目一新 |
fanyi |
string | 成语反义词 | 依然如故,依然故我 |
liju |
string | 成语例句 | 依中国法度,造作旗帜大纛,焕然一新。 |
yinzheng |
string | 成语印证 | 本作"焕然如新"... |
yufa |
string | 成语语法 | 偏正式;作谓语、宾语;含褒义 |
en |
string | 英文翻译 | take on an entirely new look |
点击左侧“发送请求”查看结果...