Query a list of sample images

Updated at:

You can call this operation to perform a paged query for all sample images in a specified image library.

Usage notes

API operation: /green/similarity/image/list

You can call this operation to query all sample images in a specified image library. For more information about how to construct an HTTP request, see Request structure. You can also use a software development kit (SDK). For more information, see SDKs.

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 its fields.

NameTypeRequiredExampleDescription
pageSizeIntegerYes5The number of entries per page. Valid values: 1 to 50.
currentPageIntegerYes1The page number. Valid values: 1 to 50.
libraryStringNoxxxThe 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 library is default.

Response data

For more information about the response parameters, see Return results.

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 in response to the request.
dataJSONArrayA list of samples in the image library. For the structure of each element, see data.
totalCountInteger1The number of sample images in the library.
pageSizeInteger5Page size
currentPageInteger1The page number.
requestIdString33921869-CF8A-4E62-8C31-44F37341FFC1The ID of the request.
Table 1. data
NameTypeExampleDescription
dataIdStringxxxThe unique ID of the image.
urlStringhttp://example.com/x.jpgThe URL of the image.
createTimeIntegerxxxThe UNIX timestamp when the sample image was created in the library.
tagsStringxxxThe tags of the sample image.

Examples

Sample request

http(s)://[Endpoint]green/similarity/image/list
&<Common request parameters>
{
  "pageSize":5,
  "currentPage":1,
  "library":"xxx"
}

Sample response

{
  "msg": "OK", 
  "code": 200, 
  "requestId": "33921869-CF8A-4E62-8C31-44F37341FFC1",
  "data":[
     {
        "dataId": "xxx",
        "createTime":,
        "url":"http://example.com/x.jpg"
     }
  ],
  "totalCount":1,
  "pageSize":5,
  "currentPage":1 
}