Skip to main content

Comparison

The comparator lets the user pick up to 4 products from the listing and get an AI-generated side-by-side analysis: pros, cons, match score, "winner" recommendation and overall summary. Components involved: ComparisonBar and ComparisonModal and InlineComparison.

How it activates

  1. The user clicks "Add to comparison" on a ProductCard. The floating bar (ComparisonBar) shows the chosen products and a counter.
  2. Once 2-4 products are picked, "Compare" opens the modal and triggers the request.

Endpoint

GET/api/widget/compare
curl "https://api.neuroon.ai/api/widget/compare?productIds=p1,p2,p3" \
-H "X-Widget-Token: $WIDGET_TOKEN"

Controller at WidgetProductController.java.

Response

ComparisonResponse (.

  • AI analysis toggle — expandable section with summary (comparison.aiSummary).
  • Drag to reorder — accessible and SR-announced (comparison.dragToReorder).
  • On-demand — some shops only load the AI analysis on click ("Get AI analysis" → comparison.getAiAnalysis).

Limits

  • Maximum 4 products. Trying to add a fifth shows comparison.comparisonFull on the button.
  • Only products with a valid id for the current shop. No cross-shop comparison.

Rate limits

GET /api/widget/compare is limited to 10 requests per minute per widget token. Each analysis is relatively expensive (LLM call with multi-product metadata), so the limit is strict.

Further reading