跳到主要内容

图片搜索

POST
/api/search/imageSearch

根据关键词搜索图片,返回图片 URL 及来源页面链接。适用于图片素材检索、内容配图等场景。


请求参数

字段类型必填默认值说明
keywordsString-搜索关键词
numInteger10返回结果数量

请求示例

curl -X POST https://platform.iflow.cn/api/search/imageSearch \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"keywords": "小猫",
"num": 2
}'

响应示例

{
"success": true,
"code": "200",
"message": "操作成功",
"exception": null,
"data": [
{
"url": "https://pica.zhimg.com/v2-22cf461858198227392b899b96d8e9cb_720w.jpg?source=172ae18b",
"title": "小猫",
"refUrl": "https://zhuanlan.zhihu.com/p/146833924"
},
{
"url": "https://thumbs.dreamstime.com/b/none-271717193.jpg",
"title": "小猫",
"refUrl": "https://cn.dreamstime.com/..."
}
],
"extra": null
}

响应字段说明

字段类型说明
urlString图片 URL
refUrlString图片来源页面 URL
titleString图片标题(可能为空)