Search API

Semantic Search

Search your databases using images, text descriptions, or text content. Find similar content across image and text databases with powerful semantic search capabilities.

API Endpoint

POST https://api.vecstore.app/search

Search Types

Image Search by Image

Upload an image to find similar images in your database. Perfect for reverse image search or finding visually similar content.

Image Search by Text

Describe what you're looking for in natural language to find matching images. For example: "sunset over mountains" or "red sports car".

Text Search

Search through text documents using semantic similarity. Find documents based on meaning, not just keyword matching.

Multilingual Support

Our text databases support over 100+ languages.

Parameters

Authorization Header - Required

Your API key for authentication.

database JSON - Required

The name of the database to search in.

image JSON - Optional

Base64-encoded image data to search with. Use this for image-to-image search. Cannot be used together with text parameter.

text JSON - Optional

Text query to search with. Use this for text search or text-to-image search. Cannot be used together with image parameter.

metadata JSON - Optional

JSON metadata filter to narrow down search results.

limit JSON - Optional

Maximum number of results to return (defaults to 10).

page JSON - Optional

Page number for pagination (starts at 1).

Python Example - Image Search

import requests
import base64

# Configuration
API_KEY = "your_api_key_here"
IMAGE_PATH = "path/to/search/image.jpg"
DATABASE = "your_database_name"

# Read and encode image
with open(IMAGE_PATH, 'rb') as image_file:
   image_data = base64.b64encode(image_file.read()).decode('utf-8')

# Prepare JSON payload with optional metadata filter
payload = {
   "database": DATABASE,
   "image": image_data,
   "metadata": {"category": "landscape"},
   "limit": 10,
   "page": 1
}
headers = {
   "Authorization": API_KEY,
   "Content-Type": "application/json"
}

# Search with image
response = requests.post(
   "https://api.vecstore.app/search",
   headers=headers,
   json=payload
)

# Process results
if response.status_code == 200:
   results = response.json()
   print(f"Found {len(results['results'])} similar images")

Python Example - Text Search

import requests

# Configuration
API_KEY = "your_api_key_here"
DATABASE = "your_database_name"

# Prepare JSON payload with optional metadata filter
payload = {
   "text": "dog",
   "database": DATABASE,
   "metadata": {"category": "animal"},
   "limit": 10,
   "page": 1
}
headers = {
   "Authorization": API_KEY,
   "Content-Type": "application/json"
}

# Search with text
response = requests.post(
   "https://api.vecstore.app/search",
   headers=headers,
   json=payload
)

# Process results
if response.status_code == 200:
   results = response.json()
   print(f"Found {len(results['results'])} matching documents")

Response Format

{
 "results": [
   {
     "id": "ed037209-76c9-4c2e-a22c-b0be0a4f27ea",
     "score": "95.00%",
     "metadata": {
       "filename":"dog.jpg",
       "category": "landscape"
     }
   },
   {
     "id": "741efb17-e34d-4cf3-b1e9-2f2de415cdc4",
     "score": "87.00%",
     "metadata": {
       "filename": "cat.jpg",
       "category": "nature"
     }
   }
 ],
 "time": "120ms"
}

API Credit Usage

Each operation consumes one API credit.