Mobile Image Recognition JSON-API instruction

Creator: Anastasia Churina,
Content manager Kuznech
E-mail: anastasia.churina@kuznech.com
Skype: nastya.ch

Description of the image URL request:

GET /search/mobile/url?url=:url

Request parameters in the URL:

  1. url – URL of an image, type: String, is required
  2. beginIndex – starting index for limiting visually similar images array, type: Integer, is not required
  3. endIndex – ending index for limiting visually similar images array, type: Integer, is not required

URL request example:
http://mobileapi.kuznech.com/kupila-api/mobile/search/standard/url?url=http://propos.ru/wp-content/uploads/2015/01/a7A3MKsteN.jpg

Successful search result:

HTTP Status 200
Content-Type: application/json;charset=UTF-8

Body response:

  1. searchResults – set of results (detected objects in the image)
    1. rectangle – detected object in the image
      1. height – rectangle height
      2. width – rectangle width
      3. x – rectangle x coordinate
      4. y – rectangle y coordinate
    2. categoryName – name of detected object in the image
    3. items – information about similar images
      1. image – URL of an image
      2. relevancy – relevancy of an image
      3. url – URL of a product
    4. resultsize – full result size of elements (similar images) searched for that rectangle
  2. status – status of search request, “ok” if successful.

Unsuccessful search result:

HTTP Status 500
Content-Type: application/json;charset=UTF-8

Body response:

{"message":"Detector failed","status":"error"}

  1. status – status of search request, “error” if unsuccessful.

To recognize products in the array of bytes of an image make a POST-request to the URL:

http://mobileapi.kuznech.com/kupila-api/mobile/search/standard

Description of the array of bytes of an image request (Base64 format):
POST request: /search/mobile

Headers:
Accept: application/json
Content-Type: application/json

Request parameters in the URL:

  1. beginIndex – starting index for limiting visually similar images array, type: Integer, is not required
  2. endIndex – ending index for limiting visually similar images array, type: Integer is not required

Body request parameters:

  1. input – the array of bytes of an image, type: byte[] (Base64 format), is required
Request example:

URL request example: http://mobileapi.kuznech.com/kupila-api/mobile/search/standard
Body request example: {“input”:”/9j/4QBORXhpZgAASUkqA……khJBLm+wpEykgASZNMiX//Z”}
Headers: Accept: application/json, Content-Type: application/json

Successful search result:

HTTP Status 200
Content-Type: application/json;

Body response:

  1. searchResults – set of results (detected objects in the image)
    1. rectangle – detected object in the image
      1. height – rectangle height
      2. width – rectangle width
      3. x – rectangle x coordinate
      4. y – rectangle y coordinate
    2. categoryName – name of detected object in the image
    3. items – information about similar images
      1. image – URL of an image
      2. relevancy – relevancy of an image
      3. url – URL of a product
    4. resultsize – full result size of elements (similar images) searched for that rectangle
  2. status – status of search request, “ok” if successful.

Unsuccessful search result:

HTTP Status 500
Content-Type: application/json;

Body response:

{"message":"Detector failed","status":"error"}

  1. status – Status of search request, “error” if unsuccessful, type: String.