HTTP API Integration Guide

This document explains how to integrate with our Text-based Image Search service using HTTP API

1. Get API Key

  1. Log in to Admin Dashboard
  2. Navigate to "API Keys" page
  3. Click "Generate New Key" button
  4. Copy and securely store the generated API Key

2. Upload Image

Use POST request to upload and index an image:

curl -X POST \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: multipart/form-data" \
  -F "thumbnail=@/path/to/your/image.jpg" \
  -F "biz_id=your_business_id" \
  -F "tags=tag1,tag2" \
  https://your-domain.com/api/image/v1

Request parameters:

Response example:

{
  "id": "img_123"
}

3. Search Images by Text

Use POST request to search images by text description:

curl -X POST \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "input": "yellow cat",
    "tags": ["cat", "table"],
    "limit": 10,
    "offset": 0
  }' \
  https://your-domain.com/api/search/v1

Request parameters:

Response example:

[
  {
    "thumbnail_url": "https://...",
    "biz_id": "your_business_id",
    "tags": ["cat", "table", "person"],
    "score": 0.95
  }
]

Notes

  1. Keep your API Key secure and don't expose it
  2. Input text should be in English for best results
  3. Search results are ordered by similarity score (descending)
  4. Default limit is 10 results if not specified