The Search API provides intelligent search capabilities with AI-powered recommendations, faceted filtering, autocomplete, and multilingual support optimized for the Egyptian market.
https://api.osus.ai/v1/search
Natural language understanding and semantic search
Arabic, English, and French language support
Faceted search with dynamic filter options
Personalized product recommendations
Perform intelligent product search with various filtering and sorting options.
/search
| Parameter | Type | Description | Example |
|---|---|---|---|
q |
string | Search query (required) | أريكة مودرن |
lang |
string | Search language: ar, en, fr | ar |
category |
string | Category filter | furniture |
brands |
string[] | Brand filters (comma-separated) | ikea,home-center |
minPrice |
number | Minimum price filter | 100 |
maxPrice |
number | Maximum price filter | 5000 |
colors |
string[] | Color filters | أبيض,أسود |
materials |
string[] | Material filters | خشب,معدن |
inStock |
boolean | In stock only | true |
has3D |
boolean | Has 3D model | true |
hasAR |
boolean | Has AR support | true |
sortBy |
string | Sort field: relevance, price, rating, newest | relevance |
sortOrder |
string | Sort order: asc, desc | desc |
page |
integer | Page number | 1 |
limit |
integer | Results per page (max: 100) | 20 |
curl -X GET 'https://api.osus.ai/v1/search?q=أريكة%20مودرن&category=furniture&minPrice=1000&maxPrice=5000&colors=أبيض,أزرق&sortBy=relevance&limit=20' \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Accept-Language: ar"
{
"success": true,
"data": {
"query": "أريكة مودرن",
"normalizedQuery": "اريكة مودرن",
"language": "ar",
"results": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": {
"ar": "أريكة مودرن ثلاثية",
"en": "Modern 3-Seat Sofa"
},
"description": {
"ar": "أريكة مودرن بتصميم عصري وخامات عالية الجودة",
"en": "Modern sofa with contemporary design and high-quality materials"
},
"price": 2500,
"salePrice": 2000,
"currency": "EGP",
"brand": "IKEA",
"category": "furniture",
"image": "https://cdn.osus.ai/products/sofa-001-main.jpg",
"rating": 4.5,
"reviewCount": 127,
"inStock": true,
"has3D": true,
"hasAR": true,
"relevanceScore": 0.95,
"highlights": {
"name": "أريكة مودرن ثلاثية",
"description": "أريكة مودرن بتصميم عصري..."
}
}
],
"pagination": {
"page": 1,
"limit": 20,
"total": 145,
"totalPages": 8,
"hasNext": true,
"hasPrev": false
},
"facets": {
"categories": [
{
"key": "furniture",
"name": "أثاث",
"count": 89
},
{
"key": "decor",
"name": "ديكور",
"count": 34
}
],
"brands": [
{
"key": "ikea",
"name": "IKEA",
"count": 45
},
{
"key": "home-center",
"name": "Home Center",
"count": 32
}
],
"colors": [
{
"key": "أبيض",
"name": "أبيض",
"count": 28,
"hex": "#ffffff"
},
{
"key": "أزرق",
"name": "أزرق",
"count": 22,
"hex": "#0066cc"
}
],
"priceRanges": [
{
"min": 0,
"max": 1000,
"count": 23
},
{
"min": 1000,
"max": 3000,
"count": 67
},
{
"min": 3000,
"max": 5000,
"count": 41
}
]
},
"searchMeta": {
"searchTime": 0.045,
"totalResults": 145,
"correctedQuery": null,
"suggestions": [
"أريكة كلاسيك",
"أريكة جلد",
"أريكة قماش"
]
}
},
"timestamp": "2025-01-15T10:30:00Z",
"requestId": "req_123456"
}
Get real-time search suggestions as users type.
/search/autocomplete
| Parameter | Type | Description |
|---|---|---|
q |
string | Partial search query (min 2 characters) |
lang |
string | Language preference: ar, en, fr |
category |
string | Limit suggestions to category |
limit |
integer | Number of suggestions (max: 10) |
curl -X GET 'https://api.osus.ai/v1/search/autocomplete?q=أري&lang=ar&limit=5' \
-H "Authorization: Bearer YOUR_API_KEY"
{
"success": true,
"data": {
"query": "أري",
"suggestions": [
{
"text": "أريكة",
"type": "term",
"category": "furniture",
"popularity": 0.85
},
{
"text": "أريكة مودرن",
"type": "phrase",
"category": "furniture",
"popularity": 0.72
},
{
"text": "أريكة جلد",
"type": "phrase",
"category": "furniture",
"popularity": 0.68
},
{
"text": "أريكة قماش",
"type": "phrase",
"category": "furniture",
"popularity": 0.61
},
{
"text": "أريكة سرير",
"type": "phrase",
"category": "furniture",
"popularity": 0.54
}
],
"productSuggestions": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "أريكة مودرن ثلاثية",
"image": "https://cdn.osus.ai/products/sofa-001-thumb.jpg",
"price": 2500
}
]
}
}
Get personalized product recommendations based on user behavior and preferences.
/recommendations
Get personalized recommendations
/recommendations/similar/{productId}
Get similar products
/recommendations/complementary/{productId}
Get complementary products
| Parameter | Type | Description |
|---|---|---|
type |
string | Recommendation type: trending, popular, personalized |
category |
string | Limit to specific category |
limit |
integer | Number of recommendations (max: 50) |
excludeViewed |
boolean | Exclude previously viewed products |
curl -X GET 'https://api.osus.ai/v1/recommendations?type=personalized&category=furniture&limit=10&excludeViewed=true' \
-H "Authorization: Bearer YOUR_API_KEY"
{
"success": true,
"data": {
"recommendations": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": {
"ar": "أريكة مودرن ثلاثية",
"en": "Modern 3-Seat Sofa"
},
"price": 2500,
"salePrice": 2000,
"image": "https://cdn.osus.ai/products/sofa-001-main.jpg",
"rating": 4.5,
"inStock": true,
"recommendationScore": 0.89,
"reason": {
"type": "similar_purchases",
"description": "مشتريات مشابهة لعملاء آخرين"
}
}
],
"algorithm": "collaborative_filtering",
"userSegment": "furniture_enthusiast",
"confidence": 0.87
}
}
Get trending searches, popular products, and seasonal recommendations.
/trending/searches
Get trending search terms
/trending/products
Get trending products
/popular/categories
Get popular categories
{
"success": true,
"data": {
"trendingSearches": [
{
"query": "أريكة مودرن",
"searchCount": 1250,
"growth": 0.35,
"category": "furniture"
},
{
"query": "طاولة قهوة",
"searchCount": 890,
"growth": 0.28,
"category": "furniture"
},
{
"query": "إضاءة LED",
"searchCount": 675,
"growth": 0.52,
"category": "lighting"
}
],
"timeframe": "7_days",
"region": "egypt"
}
}
Complex search queries with boolean operators and field-specific search.
/search/advanced
curl -X POST https://api.osus.ai/v1/search/advanced \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"query": {
"bool": {
"must": [
{
"match": {
"name": {
"query": "أريكة",
"boost": 2.0
}
}
}
],
"filter": [
{
"range": {
"price": {
"gte": 1000,
"lte": 5000
}
}
},
{
"terms": {
"brand": ["ikea", "home-center"]
}
}
],
"should": [
{
"match": {
"description": "مودرن"
}
}
]
}
},
"sort": [
{"_score": {"order": "desc"}},
{"price": {"order": "asc"}}
],
"from": 0,
"size": 20
}'
Search across Arabic, English, and French content with language detection.
curl -X GET 'https://api.osus.ai/v1/search?q=modern sofa blue' \
-H "Authorization: Bearer YOUR_API_KEY"
{
"success": true,
"data": {
"query": "modern sofa blue",
"detectedLanguage": "en",
"translatedQuery": "أريكة مودرن أزرق",
"results": [...],
"searchMeta": {
"languageConfidence": 0.95,
"crossLanguageMatches": true
}
}
}
Track search performance and user behavior for optimization.
/search/analytics/track
curl -X POST https://api.osus.ai/v1/search/analytics/track \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"eventType": "search_performed",
"searchQuery": "أريكة مودرن",
"searchResults": 145,
"clickedResult": {
"productId": "550e8400-e29b-41d4-a716-446655440000",
"position": 1,
"clickTime": 2.5
},
"filters": {
"category": "furniture",
"priceRange": "1000-5000"
},
"sessionId": "session-123",
"timestamp": "2025-01-15T10:30:00Z"
}'
| HTTP Status | Error Code | Description |
|---|---|---|
| 400 | INVALID_SEARCH_QUERY |
Search query is invalid or too short |
| 400 | INVALID_FILTER_PARAMS |
One or more filter parameters are invalid |
| 400 | INVALID_SORT_FIELD |
Specified sort field is not supported |
| 429 | SEARCH_RATE_LIMIT_EXCEEDED |
Too many search requests per minute |
| 500 | SEARCH_SERVICE_UNAVAILABLE |
Search service temporarily unavailable |
| 503 | SEARCH_INDEX_UPDATING |
Search index is being updated |