POST add

Index and add an image to your collection. This method is used to populate your image collection.

Resource URL

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

Performance

The MobileEngine 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: When images are uploaded to the service, the same path is used to store it. 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, uploaded images should be 300px in size in the smallest dimension. For example, 600x400 pixels is larger than required and it will take longer to transfer this file to your MobileEngine server. It would be faster to resize this image to be 450x300 and then send it.
  • Image content: Some images may not contain enough detail to be indexed effectively. For example, images that are extremely small or contain only a single color 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 example

Images

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

or

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

URLs

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

Response example

JSON

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

XML

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