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

TypeDescriptionUse Case
SimilarProducts similar to a given item"You might also like"
TrendingPopular products based on engagementHomepage featured section
Cart-basedBased on items in the shopping cartCart 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

  1. Show context — Include "Why we recommend this" when possible
  2. Use cart context — Cart-based recommendations improve conversions
  3. A/B test placements — Test where recommendations convert best
  4. Cache aggressively — Recommendations don't need real-time updates
  5. Fall back gracefully — Show trending items if specific recommendations are unavailable

Next Steps