Search
Search REST API
Full reference for the search endpoint.
Search REST API
POST /api/v1/search/{collection}
Search records within a collection using full-text search with structured filters.
Request
curl -X POST https://api.qanatix.com/api/v1/search/manufacturing \
-H "Authorization: Bearer sk_live_abc123..." \
-H "Content-Type: application/json" \
-d '{
"query": "stainless M8 bolt ISO 4017",
"limit": 20,
"offset": 0,
"format": "json",
"filters": {
"in_stock": true,
"country": "DE"
}
}'Parameters
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
query | string | no | — | Search query, 1-500 characters. Optional when filters are provided. |
limit | integer | no | 20 | Max results (1-100) |
offset | integer | no | 0 | Pagination offset |
sort | string | no | — | Sort field. Prefix with - for descending. E.g. price_usd, -weight_kg. |
format | string | no | json | Response format: json, compact, yaml |
filters | object | no | {} | Filters on collection_data fields (supports _min, _max, _gt, _lt, _in suffixes and comma-separated multi-value) |
Response
{
"results": [
{
"record_id": "550e8400-...",
"name": "Stainless Steel Hex Head Bolt M8x40 ISO 4017",
"score": 0.87,
"collection": "manufacturing",
"record_type": "fastener",
"collection_data": {
"part_number": "SS-M8-40-A2",
"material": "Stainless Steel A2",
"standard": "ISO 4017",
"price_eur": 0.12,
"in_stock": true,
"country": "DE"
},
"description_llm": "...",
"source_type": "file_upload",
"updated_at": "2026-03-05T14:30:00Z"
}
],
"pagination": {
"offset": 0,
"limit": 20,
"has_more": false
},
"metadata": {
"search_mode": "fulltext",
"query_type": "keyword",
"processing_time_ms": 42,
"total_estimate": 1,
"zero_result_fallback_used": false,
"cache_hit": false,
"timings": {
"classify_ms": 0.1,
"search_ms": 12.4,
"hydrate_ms": 8.1
}
}
}Response fields
| Field | Description |
|---|---|
results[].score | Relevance score (0-1). Identifier matches = 1.0. |
results[].collection_data | Your structured data |
metadata.search_mode | Strategy used: fulltext, identifier, or error |
metadata.query_type | Classification: identifier or keyword |
metadata.total_estimate | Total matching records (use with offset/limit for pagination) |
metadata.processing_time_ms | Total server-side time |
metadata.cache_hit | Whether response was served from cache |
metadata.zero_result_fallback_used | If true, query was dropped and only filters were applied |
pagination.has_more | Whether more results exist beyond offset + limit |
GET /api/v1/search/{collection}
Same as POST, with query parameters:
curl "https://api.qanatix.com/api/v1/search/manufacturing?q=M8+bolt&limit=5" \
-H "Authorization: Bearer sk_live_abc123..."| Parameter | Maps to | Default |
|---|---|---|
q | query (required, 1-500 chars) | — |
limit | limit (1-100) | 20 |
offset | offset | 0 |
Filters and format are not supported via GET — use POST for those.
Error responses
| Status | Meaning |
|---|---|
| 400 | Invalid query or parameters |
| 401 | Missing or invalid API key |
| 404 | Collection not found |
| 429 | Rate limit exceeded |
| 500 | Internal error |