API Reference

SearchByte API

A single REST API to index your product catalog, run semantic and visual search, and track analytics — for any eCommerce platform.

Base URL

https://uat-kisna-search-service.ucxe8k.easypanel.host

Content-Type

application/json

Quick Example

curl -X GET "https://uat-kisna-search-service.ucxe8k.easypanel.host/search/?q=sustainable+yoga+mat" \
  -H "x-api-key: sk_your_api_key_here" \
  -H "X-Session-ID: sess_abc123"

Permissions

API keys can be scoped to specific permissions. Pass a permissions array when generating a key to restrict its access.

PermissionDescription
search:semanticRun semantic AI search queries
search:fulltextRun full-text keyword search queries
search:imageRun visual image search queries
products:uploadBulk-upload and index products
products:updateUpdate individual products
products:deleteRemove products from the index
analytics:readRead analytics insights and reports
analytics:writeSend tracking events

Authentication

POST/auth/login

Login

Authenticate with your credentials to receive a JWT token. This token is required for management operations such as generating API keys.

Request Body

NameTypeDescription
emailreqstringYour SearchByte account email
passwordreqstringYour account password

Request

{
  "email": "you@example.com",
  "password": "••••••••"
}

Response

{
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "user": {
    "id": "usr_01",
    "email": "you@example.com",
    "plan": "growth"
  },
  "expires_in": 259200
}
POST/auth/api-keyRequires JWT token

Generate API Key

Generate a scoped API key for use in your storefront integration. Keys can be restricted to specific permissions.

Headers

NameTypeDescription
AuthorizationreqstringBearer <jwt_token>

Request Body

NameTypeDescription
namereqstringHuman-readable label for this key
permissionsstring[]Scope the key — e.g. ["search:semantic", "products:upload"]. Omit for full access.

Request

{
  "name": "My Storefront Key",
  "permissions": [
    "search:semantic",
    "search:fulltext",
    "analytics:write"
  ]
}

Response

{
  "api_key": "sk_a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "name": "My Storefront Key",
  "permissions": [
    "search:semantic",
    "search:fulltext",
    "analytics:write"
  ],
  "created_at": "2025-05-01T10:00:00Z"
}

Products

POST/products/uploadproducts:upload

Upload Products

Bulk-upload or sync your product catalog. Products are indexed immediately. Existing products with the same ID are updated.

Headers

NameTypeDescription
x-api-keyreqstringYour SearchByte API key

Request Body

NameTypeDescription
idreqstringUnique product ID from your platform
namereqstringProduct display name
descriptionstringFull description — used for semantic indexing
pricereqnumberBase price in specified currency
currencystringISO 4217 code. Default: USD
categoriesstring[]Category hierarchy for filtering
imagesobject[]Array of { url, alt } image objects
tagsstring[]Custom tags used in semantic matching
variantsobject[]Product variants with id, price, and attributes
in_stockbooleanInventory availability flag

Request

[
  {
    "id": "prod_001",
    "name": "EcoGrip Cork Mat 6mm",
    "description": "Sustainably sourced cork yoga mat with natural rubber base. Excellent grip, even when wet.",
    "price": 48,
    "currency": "USD",
    "categories": [
      "Sports",
      "Yoga"
    ],
    "images": [
      {
        "url": "https://cdn.example.com/mat.jpg",
        "alt": "Cork yoga mat"
      }
    ],
    "tags": [
      "eco-friendly",
      "yoga",
      "cork",
      "sustainable"
    ],
    "in_stock": true
  }
]

Response

{
  "indexed": 1,
  "updated": 0,
  "failed": 0,
  "errors": []
}
PUT/products/{id}products:update

Update Product

Update a single product by ID. Partial updates are supported — send only the fields you want to change.

Headers

NameTypeDescription
x-api-keyreqstringYour SearchByte API key

Request

{
  "price": 44,
  "in_stock": false
}

Response

{
  "success": true,
  "id": "prod_001"
}
DELETE/products/{id}products:delete

Delete Product

Remove a product from the search index. The product will no longer appear in any search results.

Headers

NameTypeDescription
x-api-keyreqstringYour SearchByte API key

Response

{
  "success": true,
  "id": "prod_001"
}

Analytics

POST/analytics/eventsanalytics:write

Track Event

Record a user interaction event (search, click, view). Used to power analytics dashboards and improve result ranking.

Headers

NameTypeDescription
x-api-keyreqstringYour SearchByte API key

Request Body

NameTypeDescription
event_typereqstringOne of: search, click, view
querystringThe search query (for search events)
product_idstringProduct that was interacted with
user_idstringOpaque user identifier
session_idstringSession identifier
positionnumberResult position clicked (1-indexed)

Request

{
  "event_type": "click",
  "query": "sustainable yoga mat",
  "product_id": "prod_001",
  "user_id": "usr_anon_abc123",
  "session_id": "sess_xyz789",
  "position": 1
}

Response

{
  "success": true
}
GET/analytics/insights/queriesanalytics:read

Query Insights

Per-query analytics including impressions, clicks, and CTR. Useful for identifying high-intent queries and catalog gaps.

Headers

NameTypeDescription
x-api-keyreqstringYour SearchByte API key

Query Parameters

NameTypeDescription
fromstringStart date ISO 8601. Default: 30 days ago
tostringEnd date ISO 8601. Default: now
limitnumberTop N queries to return. Default: 50

Response

{
  "queries": [
    {
      "query": "sustainable yoga mat",
      "searches": 342,
      "clicks": 289,
      "ctr": 0.845,
      "zero_results": 0
    },
    {
      "query": "blue sneakers size 10",
      "searches": 218,
      "clicks": 143,
      "ctr": 0.656,
      "zero_results": 12
    }
  ]
}
GET/analytics/insights/session-metricsanalytics:read

Session Metrics

Aggregate session-level engagement metrics to understand search depth and quality.

Headers

NameTypeDescription
x-api-keyreqstringYour SearchByte API key

Response

{
  "avg_searches_per_session": 3.4,
  "avg_search_depth": 1.8,
  "engaged_sessions_percentage": 0.72,
  "total_sessions": 5840
}
GET/analytics/insights/user-countsanalytics:read

User Counts

Break down your user base into new, returning, and power users over a given time range.

Headers

NameTypeDescription
x-api-keyreqstringYour SearchByte API key

Query Parameters

NameTypeDescription
fromstringStart date ISO 8601
tostringEnd date ISO 8601

Response

{
  "all_users": 12840,
  "new_users": 3210,
  "returning_users": 8420,
  "power_users": 1210
}