cURL
curl "https://api.ruseo.cn/api/baidu_image?words=%E5%BC%A0%E5%90%AB%E9%9F%B5&page=1&limit=10&type=1"
搜索百度图片,支持关键词搜索和分页。
https://api.ruseo.cn/api/baidu_image
接口调用前需要确认的核心配置。
/api/baidu_imagebaidu_image必填参数必须传入,示例值可直接用于联调。
免费API不强制要求API Key,但如果您希望统计个人调用次数,请在请求时附加参数 key=您的API_KEY。
注册账号后即可获得API Key。
| 参数名 | 必填 | 类型 | 说明 | 示例值 |
|---|---|---|---|---|
key |
否 | string | 可选参数:携带此参数可统计您的个人调用次数。请注册账号获取API Key。 | YOUR_API_KEY |
words |
否 | string | 搜索关键词,长度不超过100个汉字 | 张含韵 |
page |
否 | integer | 页码,默认1 | 1 |
limit |
否 | integer | 结果数量,不超过100,默认1 | 10 |
type |
否 | integer | 返回源:1=百度预览图,2=源地址,默认1 | 1 |
优先使用示例地址测试请求参数是否正确。
https://api.ruseo.cn/api/baidu_image?words=%E5%BC%A0%E5%90%AB%E9%9F%B5&page=1&limit=10&type=1
curl "https://api.ruseo.cn/api/baidu_image?words=%E5%BC%A0%E5%90%AB%E9%9F%B5&page=1&limit=10&type=1"
$url = 'https://api.ruseo.cn/api/baidu_image?words=%E5%BC%A0%E5%90%AB%E9%9F%B5&page=1&limit=10&type=1';
$response = file_get_contents($url);
$data = json_decode($response, true);
fetch('https://api.ruseo.cn/api/baidu_image?words=%E5%BC%A0%E5%90%AB%E9%9F%B5&page=1&limit=10&type=1')
.then(res => res.json())
.then(data => console.log(data));
实际返回内容以接口脚本处理结果为准。
{
"code": 0,
"msg": "success",
"data": {
"route": "baidu_image",
"example": true
}
}
| 参数名 | 类型 | 说明 | 示例值 |
|---|---|---|---|
code |
integer | 状态码,200成功,400错误 | 200 |
msg |
string | 信息提示 | success |
page |
string | 当前页码 | 1 |
maxpage |
string | 最大页码 | 87 |
count |
string | 结果总数量 | 1725 |
res |
array | 图片地址结果集 | ["https://img1.baidu.com/xxx"] |
点击左侧“发送请求”查看结果...