edit-icon download-icon

Search Images

Last Updated: Aug 02, 2018

Description

This API is used for image search from a specific Image Search instance . To call this API, you must specify an instance by setting the instanceName parameter and construct the content of the POST body with the relevant parameters.

Request Path

/item/search

Request Parameters

URL Parameters

Name Data type Required Description
instanceName String Yes Name of the instance where you search the images.

Body Parameters

Name Data type Required Description
cat_id String No Category ID.
n int No Number of search results to be returned.
s int No The position of the first search result to be returned among all search results.
crop boolean No parameter determines whether Image Search crops the image and uses the cropped region as the effective region. The default value is true.
region String No parameter specifies the crop region when the crop parameter is set to true. The region parameter follows the structure of x1,x2,y1,y2, where x1 and y1 notate the position of the upper-left corner point and x2, and y2 notate the position of the lower-right corner point.
pic_list List Yes Name of the image that you are searching for. You can specify only one image name.
pic_map Map Yes Content of the image that you are searching for.

Body structure

For information about the body structure, see the Add Images operation.

Response Parameters

Name Date type Description
Success Boolean Whether the request is successful or not.
RequestId String ID of the request.
Code int Error code. If the code is 0, the request is successful. If the code is not 0, the request is failed.
Message String Error information.
Head Map Description of the search results.
DocsReturn int Number of the returned search results.
DocsFound int Number of images that match your specified image on the instance.
PicInfo Map Image cutout information
Category String Category to which the images belong.
Region String A rectangle area determined by an upper-left coordinate (x1, y1) and a lower-right coordinate (x2, y2).
AllCategory Map Categories supported by the system.
Name String Category name.
Id String Category ID.
Auctions Map Information about all returned products.
CustContent String Custom product information.
PicName String Image name.
CatId String Image category ID.
ProductId String Product ID.
SortExprValues String Sequence number.
  1. {
  2. "Auctions": {
  3. "Auction": [{
  4. "CustContent": "k1:v1,k2:v2,k3:v3",
  5. "PicName": "girl_cloth3.jpg",
  6. "CatId": "0",
  7. "SortExprValues": "7.33136443711219e+24;0",
  8. "ProductId": "1002"
  9. }]
  10. },
  11. "Head": {
  12. "DocsReturn": 1,
  13. "DocsFound": 57,
  14. "SearchTime": 124
  15. },
  16. "PicInfo": {
  17. "Category": "0",
  18. "Region": "51,339,91,392",
  19. "AllCategory": {
  20. "Category": [{
  21. "Name": "Tops",
  22. "Id": "0"
  23. }, {
  24. "Name": "Dress",
  25. "Id": "1"
  26. }, {
  27. "Name": "Bottoms",
  28. "Id": "2"
  29. }, {
  30. "Name": "Bag",
  31. "Id": "3"
  32. }, {
  33. "Name": "Shoes",
  34. "Id": "4"
  35. }, {
  36. "Name": "Accessories",
  37. "Id": "5"
  38. }, {
  39. "Name": "Snack",
  40. "Id": "6"
  41. }, {
  42. "Name": "Makeup",
  43. "Id": "7"
  44. }, {
  45. "Name": "Bottle",
  46. "Id": "8"
  47. }, {
  48. "Name": "Furniture",
  49. "Id": "9"
  50. }, {
  51. "Name": "Toy",
  52. "Id": "20"
  53. }, {
  54. "Name": "Underwear",
  55. "Id": "21"
  56. }, {
  57. "Name": "Digital device",
  58. "Id": "22"
  59. }, {
  60. "Name": "Other",
  61. "Id": "88888888"
  62. }]
  63. }
  64. },
  65. "Message": "success",
  66. "RequestId": "183A7C57-20B9-4AE6-8227-1EE8B0A4B99B",
  67. "Success": true,
  68. "Code": 0
  69. }

Example

The following example shows how to search for products belonging to category 0 on instance goodssearch. The content and name of the image are specified as pic_content1 and searchPic, respectively. The position of the first search result to be returned among all search results is 0. The number of the search results to be returned is 10.

  1. URL: /item/search?instaneName=goodssearch
  2. POST Body:
  3. s,0,1#cat_id,1,2#pic_list,2,14#c2VhcmNoUGlj,14,30#n,30,32^00c2VhcmNoUGljcGljX2NvbnRlbnQx10
  4. -- c2VhcmNoUGlj represents the Base64 encoded image name.
Thank you! We've received your feedback.