> For the complete documentation index, see [llms.txt](https://docs.volary.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.volary.io/sdks-guide/ai-guide/image-similarity/imagesimilaritytrain.md).

# imageSimilarityTrain

## Description

Add new image data in our search engine.

## Parameters

| Parameter | Type   | Description                                                                  |
| --------- | ------ | ---------------------------------------------------------------------------- |
| imageUrl  | string | valid image url                                                              |
| metadata  | object | metadata about the image, this metadata will be returned in the test results |

## Response

| Parameter | Type   | Description                                                                                                                                                                                                             |
| --------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `message` | string | message about the response                                                                                                                                                                                              |
| `status`  | int    | <p>0 for similar image found and training not completed</p><p>1 for similar image not found and successfully added the image to our search engine</p><p>-1 for any error occurs during the execution of the request</p> |
| `img`     | object | <p>this object will contain four properties<br>keyPoint1, keyPoint2, and matchedImg will be None<br>score will be the similarity score of the search</p>                                                                |

## Request

Here is an example of how to make a `imageSimilarityTrain` request using the Volary SDK:

```javascript
// import the ai-core-sdk
import {AIServices} from '@nest25/ai-core-sdk';

// create a new instance of the sdk
const aiServices = new AIServices();

async function main() {
  // get the result of the test
  const result = await aiServices.imageSimilarityTrain('https://ik.imagekit.io/BIOSPHERE/1678716455079_PTj9bkO9d.jpeg', {'key': 'value'});
  console.log(result);
}

main();
```

## Response

```json
{
    "img": {
        "keyPoint1": "None",
        "keyPoint2": "None",
        "matchedImg": "None",
        "score": 2.0
    },
    "message": "Similar image found.",
    "status": 0
}
```
