General

Tutorials

API documentation

Add

Index and add an image to your collection. This method is used to populate your image collection. Images can be uploaded directly to the server or a URL where the image is located can be specified.

Note: only the image of the label and the filepath/filename string is stored in your WineEngine collection. Any metadata that you need to store about a label should be stored in your own database and accessed using the filepath as a key.

POST resource URL

https://wineengine.tineye.com/<company>/rest/add/

Performance

The WineEngine API can perform one add or delete operation at a time. Any extra requests submitted will be queued up for processing as slots become available.

For maximum performance images should be pre-scaled, as described under Image Limitations below. Thus, in some cases where you could use URLs, it may be better to do the download yourself, scale the image, and send it in the request. If you are using URLs, make sure that the image comes from a low latency server as the API will need to download them before indexing.

Image limitations

  • Naming conflicts: Uploading an image with the same file path will result in the existing image being overwritten. This helps avoid duplicate entries.
  • Image size: For optimal performance, images should be 600 pixels in size in the smallest dimension. For example, 1200x900 pixels is larger than required and it will take longer to transfer this file to your WineEngine server. It would be faster to resize this image to be 800x600 and then send it. Images smaller than 600px may provide acceptable results, if you don’t have access to higher resolution versions. Do not scale up images.
  • Image content: Some images may not contain enough detail to be indexed effectively. For example, images that are extremely small will not show up in search results.
  • Image format: Accepted formats are JPEG, PNG, GIF (non-animated), BMP and TIFF files.

Parameters

Images

In addition to the Common parameters there are:

Key Description
image An image file object that will be added to the collection.
filepath (optional) A filepath under which the image file will be added to the collection. If not supplied, the API will use the name as specified in the filename parameter of a multipart HTTP request.

URLs

Note that each url must have a filepath.

In addition to the Common parameters there are:

Key Description
url The URL of an image file that will be added to the collection.
filepath A filepath under which the image file will be added to the collection.

Request examples

Images

curl https://wineengine.tineye.com/<company>/rest/add/        \
     -F "image=@1.jpg"

or

curl https://wineengine.tineye.com/<company>/rest/add/        \
     -F "image=@1.jpg"                                        \
     -F "filepath=image_1.jpg"

URLs

curl https://wineengine.tineye.com/<company>/rest/add/        \
     -F "url=http://example.com/1.jpg"                        \
     -F "filepath=image_1.jpg"

Response examples

JSON

{
  "status": "ok",
  "method": "add",
  "error": [],
  "result": []
}

XML

<?xml version="1.0" encoding="utf-8"?>
<data>
  <status>ok</status>
  <method>add</method>
  <error/>
  <result/>
</data>