DEV Community

Cover image for I Built an AI-Powered Price Comparison Tool That Searches 100+ Retailers Instantly
Shirisha Uppoju
Shirisha Uppoju

Posted on

I Built an AI-Powered Price Comparison Tool That Searches 100+ Retailers Instantly

Have you ever spent 30 minutes opening tabs across Amazon, Best Buy, Walmart, and eBay just to find the best price on a laptop? I did too — so I built a tool to do it in seconds.

What is ShopSmartAI?

ShopSmartAI is an AI-powered price comparison platform that searches 100+ retailers in real-time and shows you the best deals — for both the US and Canada.

You can search in plain English like "gaming laptop under $800 with RTX" and the AI understands exactly what you're looking for.

The Tech Stack

Here's what powers it:

  • Frontend: Next.js 14 (App Router) on Vercel
  • Backend: Node.js/Express on Railway
  • Database: PostgreSQL with AI response caching (7-day TTL)
  • AI: Gemini 2.5 Flash for natural language search and product spec generation
  • Search Data: Google Shopping API via Serper.dev + Best Buy API
  • Affiliate: Amazon Associates, eBay Partner Network, and more

Key Features

AI Natural Language Search
Instead of keyword matching, the AI interprets what you actually want. Search for "best noise cancelling headphones for flying" and it returns relevant results ranked by what matters.

Side-by-Side Comparison
Add up to 4 products and get an AI-generated comparison with:

  • Per-category winners (Display, Performance, Battery, etc.)
  • AI-generated specs from real product data
  • Price comparison across all available retailers
  • An overall verdict on which product wins and why

US + Canada Auto-Detection
The site detects your location and shows prices in USD or CAD with the right retailers. Canadian users see Canadian stores and prices — no more converting currencies in your head.

Price Alerts (No Signup Required)
Want to know when a product drops to your target price? Just enter your email — no account needed. We check prices and email you when it drops.

AI-Powered Blog
An automated blog publishes deal roundups and product comparisons every few days, targeting real search queries people are looking for.

How the AI Search Works

When a user searches, here's what happens:

  1. The AI parses the natural language query to extract intent, budget, and must-have features
  2. We search Google Shopping API with optimized queries
  3. Results are normalized across retailers (different sites format data differently)
  4. Products are ranked by relevance — actual products rank above accessories
  5. Affiliate links are applied automatically based on retailer and country
  6. Results are cached in PostgreSQL to reduce API costs

The AI doesn't just match keywords — it understands that "gaming laptop under $800 with RTX" means you want a laptop (not a case), with an NVIDIA RTX GPU, priced below $800.

Challenges I Faced

Canadian Data is Different
Google Shopping returns base64-encoded images for Canadian results instead of URLs. I almost filtered these out as "broken" before realizing they're perfectly valid data URIs that render fine.

Affiliate Link Complexity
Each retailer has a different affiliate URL format. Amazon uses tag=, eBay needs 5 different parameters (mkevt, mkcid, mkrid, campid, toolid), and some retailers don't have affiliate programs at all. Building a universal affiliate tag system that handles all of these was a fun challenge.

Keeping Costs Low
AI API calls add up fast. I implemented a 3-tier caching strategy:

  • In-memory cache (24-hour TTL) for instant hits
  • PostgreSQL cache (7-day TTL) for persistent storage
  • AI generation only when cache misses

This cut our AI costs by ~90%.

What's Next

  • Chrome extension (built, pending Web Store approval) — compare prices on any shopping site
  • More retailer integrations (Dell, HP, B&H Photo)
  • Price history tracking with charts
  • Mobile app

Try It Out

Check it out at shopsmartai.org — search for any product and see how it works. I'd love feedback from the dev community.

If you're interested in the technical details of any specific part (the AI search pipeline, the caching strategy, the affiliate system, or the Next.js architecture), let me know in the comments and I'll do a deep dive.


Built with Next.js, Node.js, PostgreSQL, and Gemini AI. Deployed on Vercel + Railway.

Top comments (1)

Collapse
 
malik_sohaib_iqbal profile image
Malik Sohaib iqbal

Hey! This is an awesome build. I love the tech stack, especially using Gemini 2.5 for the natural language parsing that’s a clever way to handle specific queries like 'gaming laptop under $800.
I’d love to help you polish this further as a manual tester. Since I'm looking to grow my portfolio in QA, I’m happy to dig deep into the edge cases and report bugs for you. Let me know if you’re open to some extra eyes on the project!