Search Items
Search for items using keyword or hybrid semantic search with advanced filtering options.
Endpoint
/search
https://search-api.atriai.chat/search
Authentication
Request Parameters
The request body should contain a JSON object with the following parameters:
Request Body Parameters
The search query string to find matching items
Type of search to perform. 'keyword' for traditional search, 'hybrid' for semantic-keyword combination
Optional identifier for the consumer making the request. Used for analytics and tracking
Filter expression to narrow down search results (e.g., 'category = Electronics')
List of facets to return aggregated data for (e.g., ['category', 'brand'])
Maximum number of results to return
Number of results to skip for pagination
Ratio of semantic vs keyword search (0.0 = full keyword, 1.0 = full semantic). Only used when search_type is 'hybrid'
Response Schema
The API returns a JSON object with the following structure:
Array of search results matching the query. Each hit contains the indexed document fields
The processed search query that was executed
Time taken to process the search request in milliseconds
Maximum number of results returned (as requested)
Number of results skipped (as requested)
Estimated total number of documents matching the search query
Aggregated facet data (only included if facets were requested)
Response Example
Example response for a successful search request:
{ "hits": [ { "id": "prod-123", "title": "Gaming Laptop Pro", "description": "High-performance laptop perfect for gaming", "price": 1599.99, "category": "Electronics", "brand": "TechBrand", "in_stock": true, "rating": 4.5 }, { "id": "prod-456", "title": "Business Laptop Elite", "description": "Professional laptop for business use", "price": 1299.99, "category": "Electronics", "brand": "BusinessTech", "in_stock": true, "rating": 4.2 } ], "query": "gaming laptop", "processingTimeMs": 45, "limit": 10, "offset": 0, "estimatedTotalHits": 147, "facetDistribution": { "brand": { "TechBrand": 89, "BusinessTech": 34, "GamerTech": 24 }, "category": { "Electronics": 147 } } }
Try it out
Select a language to see how to make a request to the AI Search API
curl -L 'https://search-api.atriai.chat/search' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer YOUR_BEARER_TOKEN' \ -H 'Content-Type: application/json' \ -d '{ "search_term": "laptop", "search_type": "keyword", "limit": 5 }'
Bearer Token Required
Replace YOUR_BEARER_TOKEN
with your actual bearer token to authenticate requests.