cURL
curl "https://api.ruseo.cn/api/herb?words=%E9%A3%8E%E5%AF%92&page=1"
按草药名称、别名、症状、功效等关键词搜索中草药详细信息,包含出处、功效、性味归经、用法禁忌等
https://api.ruseo.cn/api/herb
接口调用前需要确认的核心配置。
/api/herbherb必填参数必须传入,示例值可直接用于联调。
免费API不强制要求API Key,但如果您希望统计个人调用次数,请在请求时附加参数 key=您的API_KEY。
注册账号后即可获得API Key。
| 参数名 | 必填 | 类型 | 说明 | 示例值 |
|---|---|---|---|---|
key |
否 | string | 可选参数:携带此参数可统计您的个人调用次数。请注册账号获取API Key。 | YOUR_API_KEY |
words |
否 | string | 草药名称、别名、症状、功效等关键词,不传则随机返回1条 | 风寒 |
page |
否 | integer | 查询页码,默认第1页,最大100页,每页5条 | 1 |
优先使用示例地址测试请求参数是否正确。
https://api.ruseo.cn/api/herb?words=%E9%A3%8E%E5%AF%92&page=1
curl "https://api.ruseo.cn/api/herb?words=%E9%A3%8E%E5%AF%92&page=1"
$url = 'https://api.ruseo.cn/api/herb?words=%E9%A3%8E%E5%AF%92&page=1';
$response = file_get_contents($url);
$data = json_decode($response, true);
fetch('https://api.ruseo.cn/api/herb?words=%E9%A3%8E%E5%AF%92&page=1')
.then(res => res.json())
.then(data => console.log(data));
实际返回内容以接口脚本处理结果为准。
{
"code": 0,
"msg": "success",
"data": {
"route": "herb",
"example": true
}
}
| 参数名 | 类型 | 说明 | 示例值 |
|---|---|---|---|
code |
integer | 状态码,200成功,400失败 | 200 |
msg |
string | 返回提示信息 | success |
page |
integer | 当前页码 | 1 |
datas |
array | 草药数据集 | [{...}] |
datas.name |
string | 草药名称 | 萝卜参 |
datas.name2 |
string | 草药别名 | 都拉参、都拉... |
datas.chuchu |
string | 出处 | 《四川中药志》 |
datas.gongxiao |
string | 功效 | 止血、壮阳... |
datas.wei |
string | 味道 | 辛、甘、苦 |
datas.juli |
string | 举例(用法示例) | ①治气虚带下... |
datas.guijing |
string | 归经 | 肺、脾 |
datas.xing |
string | 药性 | 毒、平、温 |
datas.xingzhuang |
string | 性状 | 干燥的根... |
datas.laiyuan |
string | 来源 | 《中药大辞典》 |
datas.zhuyi |
string | 注意/禁忌 | 外感风寒忌服... |
datas.zhizuo |
string | 制作 | 酒仙茅:净仙茅... |
datas.yongfa |
string | 用法 | 内服:煎汤... |
点击左侧“发送请求”查看结果...