DEV Community

Fahad Shah
Fahad Shah

Posted on

I built an AI-powered comparison tool with Next.js and Claude API

I kept Googling "X vs Y" and getting the same SEO-spam listicles
that say nothing useful. So I built Simily — type any two things
and get an actual AI-powered breakdown.

What it does

  • Category-by-category scores (Performance, Price, Ease of Use, etc.)
  • Pros & cons for each option
  • A clear winner with reasoning
  • FAQ section for common questions
  • You can add up to 5 items to compare at once

Try it: ChatGPT vs Claude

The stack

Frontend: Next.js 16 App Router, Tailwind CSS v4, TypeScript

AI: Anthropic Claude API (claude-sonnet) — I send a structured
prompt and ask it to return JSON with scores, pros/cons, and FAQs.
Works surprisingly well.

Caching: Upstash Redis with a 7-day TTL. First person to run a
comparison pays the API cost, everyone after gets it instantly for free.
This keeps costs very low.

Deployment: Vercel

The interesting part — the prompt

Getting Claude to return consistent JSON was the main challenge.
The trick that worked was being very explicit about the schema and
adding a rule like "return only valid JSON, no markdown."

I also version the cache keys (compare:v3:...) so when I update
the prompt structure I can invalidate old cached responses without
touching Redis directly.

What I just added

  • Best Of guides — ranked lists like Best AI Chatbot or Best Code Editor using the same AI engine
  • Related comparisons — shows up to 6 "people also compare" links at the bottom of each page for internal linking
  • Rate limiting — 10 requests per IP per hour using @upstash/ratelimit to protect the API budget

What's next

Working on getting more traffic via SEO — the 160+ pages in the
sitemap are slowly getting indexed by Google. Would love any feedback
on what's useful vs what's noise.

Check it out: simily.org

Top comments (0)