SearchImage_图像搜索_API文档

插件下载了解更多
VS Code 插件
安装插件之前,确保已安装 VS Code安装插件之前,确保已安装 VS Code
Alibaba Cloud Developer Toolkit is a collection of extensions that can help access Alibaba Cloud services in Visual Studio Code.
JetBrains 插件
安装插件之前,确保已安装 JetBrains IDE安装插件之前,确保已安装 JetBrains IDE
The Alibaba Cloud Developer Toolkit for JetBrains makes it easier to access Alibaba Cloud services.

接口说明

QPS 限制

查询操作默认的最大访问频率可在控制台中查看,为您购买时所选择的访问频次(QPS),当前支持 1QPS、5QPS、10QPS。

SDK 版本说明

图像 SDK 版本升级到 V3.1.1,可使用“多主体识别”、“相似性分数”功能。请参见Java SDK

流控信息

当前云产品API请求速率暂未透出。

授权信息

如下是此API对应的授权信息,用于RAM权限策略语句的Action元素中,为RAM用户或RAM角色授予调用此API的权限。请通过 RAM 访问控制设置,使用方法可参考访问控制帮助文档

具体说明如下:展开详情

操作访问级别资源类型条件关键字关联操作
imagesearch:SearchImage
Get
全部资源
*

请求语法

POST /v2/image/search HTTP/1.1

请求参数

字段名称字段详情
CategoryIdinteger<int32>

商品类目。具体请参见类目参考展开详情

示例值:88888888
InstanceNamestring

图搜实例名称。最多支持 20 个字符。展开详情

示例值:phimagesearch
ProductIdstring

商品 ID,最多支持 512 个字符。展开详情

示例值:pro-goods-25376
PicNamestring

图片名称,最多支持 512 个字符。展开详情

示例值:goods-23312-1
PicContentstring

图片内容,Base64 编码。展开详情

示例值:iVBORw0KGgoAAAANSUhEUgAAAV8AAADwAQMAAACdRvVNAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAADUExURQAAAKd6PdoAAAABdFJOUyR85Ty3AAAAIUlEQVRo3u3BAQ0AAADCoPdPbQ8HFAAAAAAAAAAAAADPBiowAAGR02EbAAAAAElFTkSuQmCC
Cropboolean

是否需要进行主体识别。默认 true。展开详情

示例值:true
Regionstring

图片的主体区域,格式为x1,x2,y1,y2, 其中x1,y1 是左上角的点,x2,y2是右下角的点。展开详情

示例值:32,282,43,256
Numinteger<int32>

返回结果的数目。取值范围:1~100。默认值为 10。

示例值:10
Startinteger<int32>

返回结果的起始位置。取值范围:0~499。默认值为 0。

示例值:0
Typestring

搜索类型。包括:展开详情

示例值:SearchByPic
Filterstring

过滤条件。int_attr 支持的操作符有大于号(>)、大于等于号(>=)、小于号(<)、小于等于号(<=)、等于号(=)。str_attr 支持的操作符有等于号(=)和不等号(!=),多个条件之支持 AND 和 OR 进行连接。展开详情

示例值:(int_attr >= 100000000 AND int_attr < 200000000 AND int_attr=100000252 AND str_attr=\"87\")

返回参数

字段名称字段详情
Msgstring

错误信息。

示例值:success
Headobject

搜索结果概述信息。

RequestIdstring

请求 ID。

示例值:3033A0A7-36DA-5AC9-9973-953C38EBDFA9
Auctionsarray<object>

所有返回的商品描述信息。

Codeinteger<int32>

错误码。展开详情

示例值:0
PicInfoobject

类目预测、主体识别结果等信息。

Successboolean

请求是否成功。

示例值:true

返回示例

错误码

全局错误码
HTTP 状态码错误码错误信息操作
400
BadRequest
The request has invalid parameters.诊断
400
TimeoutForTransferImage
Timeout after 5 seconds waiting for images transfer to complete.诊断
400
InvalidInstance
The specified instance name is invalid.诊断
400
NoCaretSeperator
The body content is missing the ^ separator.诊断
400
EmptyMeta
The body content has an empty meta field.诊断
400
InvalidMetaItem
The meta field is invalid.诊断
400
NoPicList
The body content is missing the pic_list parameter.诊断
400
InvalidPicList
The specified pic_list parameter is invalid.诊断
400
NoSpecifiedPic
he content of an image is not specified in the HTTP POST body.诊断
400
NoSpecifiedSearchPic
The search image is not specified.诊断
400
InvalidCategory
The specified category is invalid.诊断
400
OverflowMaxResultNum
The specified number of total results exceeds the maximum of 500.诊断
400
OverflowMaxReturnNum
The specified number of results for each request exceeds the maximum of 100.诊断
400
InvalidStartParameter
The specified parameter start is inavlid.诊断
400
InvalidNumParameter
The specified parameter num is invalid.诊断
400
NoSpecifiedAddPic
The image to insert is not specified.诊断
400
NoSpecifiedItemId
The item_id parameter is not specified.诊断
400
InvalidIntAttr
The specified int_attr field is invalid.诊断
400
UnsupportedPicFormat
The specified image format is invalid.诊断
400
InvalidFilterClause
The specified filtering condition is invalid.诊断
400
InstanceOverQuota
The number of items exceeds the limit.诊断
400
IncorrectOrientation
The image contains incorrect rotation flags in the meta data.诊断
400
UnsupportedPicPixels
The specified pixels is not supported.诊断
400
SearchTimeout
The request is timed out.诊断
400
PicNotExist
The search picture does not exist.诊断
400
NoSpecifiedProductId
The parameter ProductId no specified.诊断
400
NoSpecifiedPicName
The parameter PicName no specified.诊断
400
NoSpecifiedPicContent
The parameter PicContent no specified.诊断
400
InvalidType
The specified parameter Type is not valid.诊断
400
InvalidProductId
The specified parameter ProductId is not valid.诊断
400
InvalidPicName
The specified parameter PicName is not valid.诊断
400
InvalidStrAttr
The specified parameter StrAttr is not valid.诊断
400
InvalidCustomContent
The specified parameter CustomContent is not valid.诊断
400
InvalidPicContent
The specified parameter PicContent length greater than 4 * 1024 * 1024.诊断
403
NoPermission
You are not authorized to perform this operation.诊断
403
DeniedRequest
Your request was denied due to instance flow control.诊断
409
InstanceStatusError
Your instance is unavailable.诊断
500
UnknownException
An internal server error occurred.诊断
500
NetworkException
A network error occurred.诊断
500
RequestTimeout
​The request is timeout.诊断
500
UnsupportedInstanceType
The instance type is not supported.诊断
500
UnsupportedOperationType
The specified action is not supported.诊断
500
ExtractFeatureTimeout
The request was timed out while extracting features.诊断
500
AccessEngineFailed
An error occurred while accessing the search engine.诊断
500
InternalOssError
An internal OAS error occurred.诊断
500
InternalSwiftError
An internal SWIFT error occurred.诊断
500
InternalTableStoreError
An internal Table Store error occurred.诊断

变更历史

变更时间变更内容概要操作
2023-06-05
变更返回参数
2021-11-22
变更错误码500

相关示例