cURL
curl "https://api.ruseo.cn/api/caipu?word=%E8%BE%A3%E6%A4%92&page=1&num=10"
根据食材或菜名查询菜谱,返回做法、调料、原料等详细信息。
https://api.ruseo.cn/api/caipu
接口调用前需要确认的核心配置。
/api/caipucaipu必填参数必须传入,示例值可直接用于联调。
免费API不强制要求API Key,但如果您希望统计个人调用次数,请在请求时附加参数 key=您的API_KEY。
注册账号后即可获得API Key。
| 参数名 | 必填 | 类型 | 说明 | 示例值 |
|---|---|---|---|---|
key |
否 | string | 可选参数:携带此参数可统计您的个人调用次数。请注册账号获取API Key。 | YOUR_API_KEY |
word |
是 | string | 食材或菜名 | 辣椒 |
page |
否 | integer | 页码,默认第1页 | 1 |
num |
否 | integer | 返回数量 | 10 |
优先使用示例地址测试请求参数是否正确。
https://api.ruseo.cn/api/caipu?word=%E8%BE%A3%E6%A4%92&page=1&num=10
curl "https://api.ruseo.cn/api/caipu?word=%E8%BE%A3%E6%A4%92&page=1&num=10"
$url = 'https://api.ruseo.cn/api/caipu?word=%E8%BE%A3%E6%A4%92&page=1&num=10';
$response = file_get_contents($url);
$data = json_decode($response, true);
fetch('https://api.ruseo.cn/api/caipu?word=%E8%BE%A3%E6%A4%92&page=1&num=10')
.then(res => res.json())
.then(data => console.log(data));
实际返回内容以接口脚本处理结果为准。
{
"code": 0,
"msg": "success",
"data": {
"route": "caipu",
"example": true
}
}
| 参数名 | 类型 | 说明 | 示例值 |
|---|---|---|---|
curpage |
integer | 当前页码 | 1 |
allnum |
integer | 总数量 | 10 |
list |
array | 菜谱列表 | [] |
source |
string | 数据来源 | qqsuu |
点击左侧“发送请求”查看结果...