Query a list of sample images
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.
| Name | Type | Required | Example | Description |
| pageSize | Integer | Yes | 5 | The number of entries per page. Valid values: 1 to 50. |
| currentPage | Integer | Yes | 1 | The page number. Valid values: 1 to 50. |
| library | String | No | xxx | The 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:
| Name | Type | Example | Description |
| code | Integer | 200 | The error code. It is the same as the HTTP status code. For more information, see Common error codes. |
| msg | String | OK | The message returned in response to the request. |
| data | JSONArray | A list of samples in the image library. For the structure of each element, see data. | |
| totalCount | Integer | 1 | The number of sample images in the library. |
| pageSize | Integer | 5 | Page size |
| currentPage | Integer | 1 | The page number. |
| requestId | String | 33921869-CF8A-4E62-8C31-44F37341FFC1 | The ID of the request. |
| Name | Type | Example | Description |
| dataId | String | xxx | The unique ID of the image. |
| url | String | http://example.com/x.jpg | The URL of the image. |
| createTime | Integer | xxx | The UNIX timestamp when the sample image was created in the library. |
| tags | String | xxx | The 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
}