Image Search

The Image Search API allows you to search through your indexed images using natural language queries. Images must be uploaded with index: true to be searchable.

Prerequisites

Before using Image Search, ensure your images have been successfully indexed:

  1. Upload images with index=true using the /v1/images/upload endpoint
  2. Wait for indexing to complete

Search Images

Search through indexed images using natural language descriptions.

Endpoint

  • POST /v1/images/search

Request

Bash

curl -X POST https://vision-agent.api.reka.ai/v1/images/search \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"query": "a red car",
"max_results": 10,
"threshold": 0.5
}'

Python

import requests
url = f"{BASE_URL}/v1/images/search"
query = "a red car"
limit = 10
payload = {
"query": query,
"max_results": limit,
"threshold": threshold
}
headers = {
"X-Api-Key": REKA_API_KEY
}
response = requests.post(url, json=payload, headers=headers)
if response.status_code == 200:
result = response.json()
print("Search images successful:", result)
result
else:
raise ValueError(f"Error: {response.status_code} {response.text}")

Parameters

  • query (required): Natural language search query describing the image content you’re looking for
  • max_results (optional): Maximum number of results to return (default: 10)
  • threshold (optional): Minimum similarity threshold for results (0-1 scale)

Response

Returns an array of images matching the search query, ranked by relevance. Each result includes:

  • image_id: Unique identifier for the image
  • image_url: URL to access the image
  • score: Relevance score (0-1 scale)

Use Cases

Image search is useful for:

  • Content discovery: Find specific images in large collections
  • Visual cataloging: Search product images by description
  • Media management: Locate images based on visual content
  • Quality control: Find images matching specific criteria