Search

Image search

Image search endpoint allows you to perform similarity search on your image datasets. It accepts Base64 encoded images or image URLs as queries which are internally transformed to feature vectors, and returns a result set.

Recommended image size is 224x224px. Larger images can cause latency issues while smaller images can hurt the search performance.

POST https://api.anndb.com/v1/search/image/:dataset_name

Request

REST
REST
{
"query": "data:image/jpeg;base64,/9j...",
"k": 10
}

Response

REST
REST
{
"items": [
{
"id": "2c44707c-acbf-49be-a8ef-a63028491f4c",
"metadata": {
"key": "value",
...
}
},
...
]
}

Vector search

Vector search endpoint allows you to search datasets that contain your own vectors without any pre-processing. It accepts an array of floating point numbers and returns a result set.

POST https://api.anndb.com/v1/search/vector/:dataset_name

Request

Length of the query vector must match the dataset dimension specified when creating the dataset.

REST
REST
{
"query": [0.12, 0.34, 0.8, 0.56, ...],
"k": 10
}

Response

REST
REST
{
"items": [
{
"id": "2c44707c-acbf-49be-a8ef-a63028491f4c",
"metadata": {
"key": "value",
...
}
},
...
]
}

‚Äč