A powerful Python application that analyzes product reviews using Firecrawl for web scraping and OpenAI GPT-4o-mini for AI-powered insights. Features a beautiful Streamlit dashboard with caching capabilities.
- 🌐 Web Scraping: Uses Firecrawl to search and scrape product reviews from multiple sources
- 🤖 AI Analysis: Leverages OpenAI GPT-4o-mini for sentiment analysis and insights generation
- 💾 Data Caching: SQLite database stores results to avoid repeated API calls
- 📊 Interactive Dashboard: Beautiful Streamlit interface with charts and visualizations
- ⚡ Real-time Progress: Live tracking of scraping and analysis progress
- 🔍 Smart Insights: Extracts pros, cons, key themes, and actionable recommendations
-
Clone the repository
git clone https://github.com/your-username/ECom-Intel.git cd ECom-Intel -
Install dependencies
pip install -r requirements.txt
-
Set up environment variables
cp .env.example .env
Edit the
.envfile and add your API keys:OPENAI_API_KEY=your_openai_api_key_here FIRECRAWL_API_KEY=your_firecrawl_api_key_here DATABASE_PATH=reviews.db
-
Start the Streamlit app
streamlit run app.py
-
Open your browser and navigate to
http://localhost:8501 -
Enter a product URL (Amazon, eBay, or other e-commerce sites)
-
Click "Analyze Reviews" and watch the magic happen!
ECom-Intel/
├── app.py # Main Streamlit application
├── database.py # SQLite database operations
├── firecrawl_client.py # Firecrawl integration
├── review_analyzer.py # OpenAI analysis logic
├── requirements.txt # Python dependencies
├── .env.example # Environment variables template
└── README.md # Project documentation
-
OpenAI API Key - For sentiment analysis and insights generation
- Get yours at: https://platform.openai.com/api-keys
- Model used:
gpt-4o-mini(cost-effective and fast)
-
Firecrawl API Key - For web scraping
- Get yours at: https://www.firecrawl.dev/
- Handles search, scraping, and content extraction
Create a .env file with the following variables:
OPENAI_API_KEY=sk-your-openai-key
FIRECRAWL_API_KEY=fc-your-firecrawl-key
DATABASE_PATH=reviews.db- Smart Search: Finds review pages related to the product
- Multi-source Scraping: Extracts reviews from various websites
- Duplicate Detection: Avoids processing the same reviews multiple times
- Rate Limiting: Respects website policies and API limits
- Sentiment Analysis: Categorizes reviews as positive, negative, or neutral
- Insight Extraction: Identifies key themes and patterns
- Pros/Cons Analysis: Summarizes what customers love and hate
- Recommendations: Provides actionable insights for improvement
- Real-time Progress: Live updates during scraping and analysis
- Interactive Charts: Sentiment distribution and rating breakdowns
- Review Samples: Browse individual reviews with sentiment labels
- Recent Analyses: History of analyzed products
- Caching Toggle: Option to use cached results for faster analysis
Works best with:
- Amazon products
- eBay listings
- Major e-commerce platforms
- Review websites
The application intelligently searches for reviews related to any product URL you provide.
- Use direct product URLs for better accuracy
- Popular products typically have more reviews available
- Check cached results first to save API credits
- Adjust the max pages slider based on your needs
- Allow sufficient time for comprehensive analysis
- All data is stored locally in SQLite database
- No data is shared with third parties
- API keys are kept secure via environment variables
- Reviews are processed anonymously
-
"API Key Not Found" Error
- Ensure
.envfile exists with correct API keys - Check that API keys are valid and active
- Ensure
-
"No Reviews Found"
- Try a different product URL
- Check if the product has reviews available
- Increase the max pages setting
-
"Scraping Failed"
- Verify Firecrawl API key is valid
- Check internet connection
- Some websites may block scraping
-
"Analysis Error"
- Verify OpenAI API key and credits
- Check if the model is available
- Try again with fewer reviews
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the project
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Firecrawl - Powerful web scraping API
- OpenAI - AI language models
- Streamlit - Beautiful data apps
- Plotly - Interactive charts
- Support for more e-commerce platforms
- Product comparison feature
- Export results to PDF/CSV
- Email notifications for analysis completion
- Multi-language support
- Advanced filtering options
- Trend analysis over time
Made with ❤️ by Abid