features/Recommendations
Recommendations
Intufind provides AI-powered recommendations to help users discover relevant products and content — similar items, trending products, and cart-based cross-sells.
Recommendation Types
| Type | Description | Use Case |
|---|---|---|
| Similar | Products similar to a given item | "You might also like" |
| Trending | Popular products based on engagement | Homepage featured section |
| Cart-based | Based on items in the shopping cart | Cart page cross-sells |
Similar Products
curl https://api.intufind.com/recommendations/product-123?limit=5 \
-H "Authorization: Bearer if_sk_xxx"
import { createClient, getProductRecommendations } from '@intufind/ai-sdk';
const client = createClient({
baseUrl: 'https://api.intufind.com',
auth: process.env.INTUFIND_SECRET_KEY!,
});
const { data } = await getProductRecommendations({
client,
path: { productId: 'product-123' },
query: { limit: 5 },
});
for (const rec of data.recommendations) {
console.log(rec.product.name, '— Score:', rec.score);
}
Trending Products
curl "https://api.intufind.com/recommendations/trending?limit=10&category=Electronics&timeframe=7d" \
-H "Authorization: Bearer if_sk_xxx"
import { getTrendingRecommendations } from '@intufind/ai-sdk';
const { data } = await getTrendingRecommendations({
client,
body: {
limit: 10,
category: 'Electronics',
timeframe: '7d', // 24h, 7d, or 30d
},
});
Cart-Based Recommendations
Recommend products based on what's in the shopping cart:
import { getCartRecommendations } from '@intufind/ai-sdk';
const { data } = await getCartRecommendations({
client,
body: {
productIds: ['product-1', 'product-2'],
limit: 10,
},
});
Display Patterns
Product Page — "You Might Also Like"
function SimilarProducts({ productId }: { productId: string }) {
const [recs, setRecs] = useState([]);
useEffect(() => {
getProductRecommendations({
client,
path: { productId },
query: { limit: 4 },
}).then(({ data }) => setRecs(data.recommendations));
}, [productId]);
return (
<section>
<h2>You Might Also Like</h2>
<div className="product-grid">
{recs.map((rec) => (
<ProductCard key={rec.product.id} product={rec.product} />
))}
</div>
</section>
);
}
Homepage — Trending
function TrendingProducts() {
const [trending, setTrending] = useState([]);
useEffect(() => {
getTrendingRecommendations({
client,
body: { limit: 8, timeframe: '7d' },
}).then(({ data }) => setTrending(data.recommendations));
}, []);
return (
<section>
<h2>Trending Now</h2>
<ProductGrid products={trending} />
</section>
);
}
Filtering Recommendations
By Category
const { data } = await getTrendingRecommendations({
client,
body: {
limit: 10,
filters: { categories: ['Electronics', 'Accessories'] },
},
});
By Price Range
const { data } = await getProductRecommendations({
client,
path: { productId: 'p-123' },
query: {
limit: 5,
filters: { price_min: 50, price_max: 200 },
},
});
In Stock Only
const { data } = await getTrendingRecommendations({
client,
body: {
limit: 10,
filters: { stock_status: 'instock' },
},
});
Caching
Recommendations don't change frequently — cache aggressively to reduce API calls:
async function getCachedRecommendations(productId: string, limit = 5) {
const key = `recs_${productId}_${limit}`;
let cached = cache.get(key);
if (!cached) {
const { data } = await getProductRecommendations({
client,
path: { productId },
query: { limit },
});
cached = data;
cache.set(key, cached, 3600); // 1 hour
}
return cached;
}
Best Practices
- Show context — Include "Why we recommend this" when possible
- Use cart context — Cart-based recommendations improve conversions
- A/B test placements — Test where recommendations convert best
- Cache aggressively — Recommendations don't need real-time updates
- Fall back gracefully — Show trending items if specific recommendations are unavailable
Next Steps
- API Reference — Full recommendations endpoint documentation
- Semantic Search — How search results are ranked
- WordPress Recommendations — WooCommerce integration