Query the details of a sample image

Updated at:

Call this operation to query the details of a sample image in a specified image library.

Usage notes

Operation: /green/similarity/image/get

You can call this operation to query the details of a sample image in a specified image library.For more information about how to structure an HTTP request, see Request structure. You can also use a pre-built HTTP request. For more information, see SDK overview.

QPS limit

The queries per second (QPS) limit for this API is 20 per user. Exceeding this limit triggers throttling, which can impact your business. Plan your calls accordingly.

Request parameters

For more information about common request parameters, see Common parameters.

The request body is a JSON object. The following table describes the fields in the object.

NameTypeRequiredExampleDescription
libraryStringNoxxxxThe name of the image library to query. If you do not specify this parameter, the default image library is queried. The name of the default image library is default.
dataIdStringNoaaaThe ID of the sample image to query.
Note Specify either the dataId or url parameter.
urlStringNohttp://example.com/x.jpgThe URL of the sample image to query.
Note Specify either the dataId or url parameter.

Response data

For more information about response parameters, see Response parameters.

The data field in the response body is a JSON array. Each element contains the following fields:

NameTypeExampleDescription
codeInteger200

The error code. It is the same as the HTTP status code.

For more information, see Common error codes.

msgStringOKThe message returned for the request.
dataIdStringaaaThe unique ID of the image.
urlStringhttp://example.com/x.jpgThe URL of the image.
createTimeIntegerxxxThe timestamp when the sample image was created in the image library.
tagsStringxxxThe tags of the sample image.
requestIdString33921869-CF8A-4E62-8C31-44F37341FFC1The ID of the request.

Examples

Request example

http(s)://[Endpoint]/green/similarity/image/get
&<Common request parameters>
{
  "library": "xxxx",
  "dataId": "aaa"
}

Response example

{
  "msg": "OK", 
  "code": 200, 
  "requestId": "33921869-CF8A-4E62-8C31-44F37341FFC1",
  "data":{
    "dataId": "aaa",
    "createTime":,
    "url" :"http:/example.com/x.jpg"
  }

}