An intelligent shopping search engine that allows users to browse and search across multiple online retailers. Currently integrated with Walmart's Product Search API and Best Buy's Product Search API.
- 🔍 Smart Search: Search for products across retailers with intelligent query processing
- 🛍️ Product Display: Beautiful product cards with images, prices, ratings, and discounts
- 💰 Price Comparison: See discounts, original prices, and current sale prices
- ⭐ Customer Ratings: View product ratings and review counts
- 📱 Responsive Design: Fully responsive UI that works on all devices
- 🚀 Fast Performance: Built with Next.js 14+ and React Server Components
- 🏪 Multi-Retailer Search: Search products from Walmart and Best Buy simultaneously
- Framework: Next.js 14+ (App Router)
- Language: TypeScript
- Styling: Tailwind CSS
- Icons: Lucide React
- API Integration: Walmart Product Search API, Best Buy Product Search API
- Node.js 18+ installed
- Walmart API credentials from https://developer.walmart.com/
- Consumer ID (Client ID)
- Private Key (for signing requests)
- Key Version (usually "1")
- Best Buy API credentials from https://developer.bestbuy.com/
- API Key
- Clone the repository:
git clone <your-repo-url>
cd emporika- Install dependencies:
npm install-
Set up environment variables:
Create a
.env.localfile in the root directory and add your API credentials:# Walmart API credentials WALMART_CONSUMER_ID=your_consumer_id_here WALMART_PRIVATE_KEY="-----BEGIN PRIVATE KEY-----\nYour private key here\n-----END PRIVATE KEY-----" WALMART_KEY_VERSION=1 # Best Buy API credentials BESTBUY_API_KEY=your_bestbuy_api_key_here
-
Run the development server:
npm run dev- Open http://localhost:3000 in your browser
emporika/
├── app/
│ ├── api/
│ │ ├── search/
│ │ │ └── route.ts # Unified search API endpoint
│ │ └── trending/
│ │ └── route.ts # Trending products API endpoint
│ ├── globals.css # Global styles
│ ├── layout.tsx # Root layout
│ └── page.tsx # Home page
├── components/
│ ├── ProductCard.tsx # Product card component
│ ├── ProductGrid.tsx # Product grid layout
│ ├── SearchBar.tsx # Search input component
│ └── TrendingFeed.tsx # Trending products component
├── lib/
│ ├── walmart.ts # Walmart API client
│ └── bestbuy.ts # Best Buy API client
├── types/
│ ├── walmart.ts # TypeScript types for Walmart API
│ ├── bestbuy.ts # TypeScript types for Best Buy API
│ └── unified.ts # Unified product types for cross-retailer display
└── .env.local # Environment variables
The application integrates with Walmart's Affiliate API v1 Search endpoint:
Endpoint: https://api.walmartlabs.com/v1/search
Parameters:
query: Search termsort: Sort order (relevance, price, title, bestseller, customerRating, new)order: Ascending or descendingnumItems: Number of items to return (default: 25)start: Pagination offset
The application integrates with Best Buy's Products API:
Endpoint: https://api.bestbuy.com/v1/products((search={query}))
Parameters:
apiKey: Your Best Buy API keyformat: Response format (json)pageSize: Number of items to returnpage: Page number for paginationshow: Fields to include in the response
To add more retailers:
- Create a new API client in
lib/(e.g.,lib/amazon.ts) - Define TypeScript types in
types/(e.g.,types/amazon.ts) - Add normalization function to
types/unified.ts - Update the search logic in
app/api/search/route.tsto include the new source
| Variable | Description | Required |
|---|---|---|
WALMART_CONSUMER_ID |
Your Consumer ID (Client ID) from developer.walmart.com | Yes |
WALMART_PRIVATE_KEY |
Your private key for signing API requests | Yes |
WALMART_KEY_VERSION |
Private key version (usually "1") | Yes |
BESTBUY_API_KEY |
Your API key from developer.bestbuy.com | Yes |
# Run development server
npm run dev
# Build for production
npm run build
# Start production server
npm start
# Run linter
npm run lint- Add Best Buy as a retailer
- Add more retailers (Amazon, Target, etc.)
- Advanced filtering (price range, ratings, categories)
- Sort options (price, rating, relevance)
- Pagination for results
- Product comparison feature
- Price history tracking
- User accounts and saved searches
- Price alerts and notifications
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
- Walmart Open API for product data
- Next.js for the amazing framework
- Tailwind CSS for styling
- Lucide React for icons