DEV Community

Daniel Rozin for Reviewiq.com

Posted on • Originally published at aversusb.net

Building Structured Product Comparisons with Next.js and AI

How we built SmartReview's comparison engine to serve 50K+ monthly "X vs Y" searches — and what we learned along the way.


If you've ever searched "AirPods vs Sony WF-1000XM5" or "Roomba vs Roborock," you've seen comparison content. Most of it is mediocre — walls of text that don't actually help you decide.

We built SmartReview to fix that. Here's the technical architecture behind our AI-powered comparison engine.

The Problem

Comparison searches ("X vs Y") represent a massive, underserved search intent:

  • "AirPods vs Sony" — 50,000+ monthly searches
  • "Roomba vs Roborock" — 30,000+ monthly searches
  • "Nespresso vs Keurig" — 25,000+ monthly searches

Users want structured, scannable answers — not 2,000-word essays. They want to know: which one should I buy, and why?

Architecture Overview

┌─────────────────────────────────────────────┐
│  Discovery Layer (DataForSEO + Tavily)      │
│  → Identifies high-volume "vs" keywords     │
│  → Scores by volume × (100 - difficulty)    │
└──────────────┬──────────────────────────────┘
               ▼
┌─────────────────────────────────────────────┐
│  Enrichment Layer (Tavily + Web Scraping)   │
│  → Fetches real-time specs, pricing, reviews│
│  → Aggregates from 5+ review sources        │
└──────────────┬──────────────────────────────┘
               ▼
┌─────────────────────────────────────────────┐
│  Generation Layer (Claude API)              │
│  → Structured comparison with key diffs     │
│  → Short verdict + detailed breakdown       │
│  → FAQ generation from PAA data             │
└──────────────┬──────────────────────────────┘
               ▼
┌─────────────────────────────────────────────┐
│  Serving Layer (Next.js + PostgreSQL)       │
│  → ISR for fresh content                    │
│  → JSON-LD structured data                  │
│  → Redis cache for API responses            │
└─────────────────────────────────────────────┘
Enter fullscreen mode Exit fullscreen mode

Structured Data for Comparison Content

Google doesn't have a dedicated "Comparison" schema, but we combine several schema types for rich results:

{
  "@context": "https://schema.org",
  "@type": "WebPage",
  "name": "AirPods Pro 2 vs Sony WF-1000XM5",
  "description": "Detailed comparison of AirPods Pro 2 and Sony WF-1000XM5 across sound quality, ANC, battery life, and price.",
  "mainEntity": {
    "@type": "ItemList",
    "itemListElement": [
      {
        "@type": "Product",
        "name": "Apple AirPods Pro 2",
        "brand": { "@type": "Brand", "name": "Apple" },
        "aggregateRating": {
          "@type": "AggregateRating",
          "ratingValue": "4.7",
          "reviewCount": "12453"
        }
      },
      {
        "@type": "Product",
        "name": "Sony WF-1000XM5",
        "brand": { "@type": "Brand", "name": "Sony" },
        "aggregateRating": {
          "@type": "AggregateRating",
          "ratingValue": "4.5",
          "reviewCount": "8921"
        }
      }
    ]
  }
}
Enter fullscreen mode Exit fullscreen mode

This gives us Product rich results with ratings directly in SERPs — a significant CTR boost.

The AI Generation Pipeline

The key insight: AI-generated comparisons are only as good as the data you feed them.

Our pipeline:

  1. Parallel enrichment — We run 3 Tavily searches simultaneously: "A vs B comparison 2026", entity A specs, entity B specs
  2. Review aggregation — Pull ratings from Reddit, G2, Amazon, Wirecutter, and RTINGS
  3. Structured prompt — Claude generates a comparison with enforced sections: short answer, key differences (5-7), detailed breakdown by attribute, verdict, FAQs
  4. Fact verification — Cross-reference generated specs against enrichment data

The result: comparison pages that are factually grounded, consistently structured, and immediately useful.

SEO Results

After 3 months of publishing structured comparisons:

  • 40% of pages rank in top 10 for their target "vs" keyword
  • Average time on page: 3.2 minutes (vs. 1.4 for generic blog content)
  • FAQ sections capture 15% of our organic traffic via PAA features

What We'd Do Differently

  1. Start with fewer categories — we launched across 10 categories simultaneously. 3-4 would have let us iterate faster.
  2. Invest in entity resolution early — "AirPods Pro 2" vs "AirPods Pro (2nd gen)" vs "Apple AirPods Pro 2" are all the same product. Building a proper entity graph saved us months of duplicate content.
  3. User signals matter more than content volume — 50 comparisons with high engagement beat 500 thin pages every time.

Try It Out

Browse our comparisons at aversusb.net — every page follows this architecture.

If you're building comparison content and want to discuss technical approaches, drop a comment below or find us on LinkedIn.


This post is part of our "Building SmartReview" series. Next up: how we handle real-time price tracking across 50+ retailers.

Top comments (0)