Skip to main content
Dev Sac

Building a Grocery Price Comparison Tool for Sacramento

By Michael Kahn 4 min read

Michael was spending $180 a week on groceries at the Raley’s closest to his house. Then one weekend he checked the same items at WinCo and saved $40. That is $2,000 a year, just by driving an extra five minutes. The problem was figuring out which store actually had the best price on each item. So he built a tool to do it.

Why Sacramento Needed This

National grocery deal apps like Flipp focus on chain circulars and weekly ads. They are fine if you want to know that chicken breast is on sale at Safeway this week. But they miss the stores Sacramento shoppers actually use: WinCo, Grocery Outlet, Rancho San Miguel, the Sacramento Natural Foods Co-op. They do not let you compare the same product across stores side by side.

Sacramento grocery prices vary by 40 to 70 percent on identical items across stores. A dozen eggs costs $4.99 at Raley’s and $3.49 at Foods Co. Bananas are $0.27/lb at Whole Foods and $0.69/lb at Safeway. Multiply those differences across a full shopping list and you are looking at $30 to $50 in savings per trip.

How SacGroceries Works

SacGroceries compares grocery prices across 39 Sacramento-area stores. Search for a product, see every store’s price ranked from cheapest to most expensive, and build a shopping list optimized by store.

SacGroceries homepage showing product prices across Sacramento stores

The database tracks over 134,000 prices and updates weekly. Stores include the big chains (Safeway, Raley’s, Costco, Trader Joe’s, Walmart) and the local spots that national apps ignore (Corti Brothers, Oto’s Marketplace, La Esperanza, 99 Ranch Market, H Mart).

SacGroceries stores page showing all 39 Sacramento area grocery stores

Click any product and it expands to show the price at every store that carries it, ranked from cheapest to most expensive. Chicken breast ranges from $1.97/lb at Raley’s to $6.99/lb at Whole Foods. That is the kind of spread that adds up fast.

SacGroceries product detail showing chicken breast prices compared across stores

The Technical Stack

The entire backend runs on Cloudflare Workers with a D1 (SQLite) database. Building custom web applications like this means choosing the right stack for the problem, and this one won because it is serverless, cheap to run, and fast. API responses come back quickly because everything runs at the edge, close to Sacramento users. The Hono framework handles routing, and TypeScript covers the full stack. More on the technical tradeoffs is in the post on running Cloudflare Workers in production.

Price data comes in through scheduled Workers running on cron triggers. Each store source has its own collector that normalizes data into a common format. This is the hardest part of the project. Stores change their data formats, drop products, rename categories. The normalization pipeline handles all of that automatically.

Lessons From Building It

Grocery data is messy. The same product appears under different names, sizes, and UPC codes across stores. “Organic 2% Milk 1 Gallon” at one store is “Horizon Organic Reduced Fat Milk 128oz” at another. Building reliable matching required a custom normalization pipeline with fuzzy matching and manual override rules before the data was usable.

Edge computing is perfect for local apps. With Cloudflare Workers, the code executes at the nearest data center instead of a distant AWS region. For a tool serving Sacramento shoppers, this architecture keeps API responses fast.

People care about grocery prices. The tool started as a personal project, but the response from Sacramento shoppers has been strong. Everyone has a story about discovering their “usual” store was overcharging them on basics. The most common request is adding more stores, which is why coverage has grown from 12 stores at launch to 39 today.

Where It Stands

The core price comparison engine is live with 134,000+ prices across 39 stores, updated weekly. The shopping list feature lets you build a list and see the total at each store. Store coverage is actively expanding, and price history tracking is coming for Premium subscribers.

If you want to compare grocery prices in Sacramento, try it out. And if you have suggestions for stores to add, get in touch.

To understand the full picture behind projects like this, read about what a Sacramento web developer actually does day to day and how much custom web apps cost.

Michael Kahn
Michael Kahn

AI architect and web developer in Sacramento, and founder of Frog Stone Media. Helping small businesses connect their operations and websites to AI.

Related Posts