Product Review Sentiment Analyzer

by devwithbobby

Scrapes product reviews from e-commerce websites and analyzes sentiment using OpenAI or Hugging Face APIs.

6 runs
1 users
Try This Actor

Opens on Apify.com

About Product Review Sentiment Analyzer

Scrapes product reviews from e-commerce websites and analyzes sentiment using OpenAI or Hugging Face APIs.

What does this actor do?

Product Review Sentiment Analyzer is a web scraping and automation tool available on the Apify platform. It's designed to help you extract data and automate tasks efficiently in the cloud.

Key Features

  • Cloud-based execution - no local setup required
  • Scalable infrastructure for large-scale operations
  • API access for integration with your applications
  • Built-in proxy rotation and anti-blocking measures
  • Scheduled runs and webhooks for automation

How to Use

  1. Click "Try This Actor" to open it on Apify
  2. Create a free Apify account if you don't have one
  3. Configure the input parameters as needed
  4. Run the actor and download your results

Documentation

Product Review Sentiment Analyzer A production-ready Apify actor that scrapes product reviews from major e-commerce websites (Amazon, Walmart, Target, BestBuy) and analyzes sentiment using OpenAI GPT-4-Turbo or Hugging Face models. ## 🎯 Features - Multi-platform support: Works with Amazon, Walmart, Target, BestBuy, and generic e-commerce sites - Dual AI providers: Choose between OpenAI (GPT-4-Turbo) or Hugging Face (DistilBERT) for sentiment analysis - Smart crawling: Uses CheerioCrawler for fast scraping with PuppeteerCrawler fallback for JavaScript-heavy sites - Comprehensive analytics: Provides detailed sentiment scores, keyword extraction, and aggregated insights - Slack integration: Optional real-time notifications via Slack webhooks - Production ready: Includes error handling, retry logic, rate limiting, and proxy support ## 📊 Output Format Each product generates structured analytics: json { "productUrl": "https://example.com/product", "productTitle": "Amazing Wireless Headphones", "averageSentimentScore": 0.82, "positiveCount": 42, "negativeCount": 8, "neutralCount": 5, "topKeywords": ["battery life", "sound quality", "comfort"], "reviews": [ { "reviewerName": "Jane D.", "rating": 5, "reviewText": "Amazing headphones with great bass!", "reviewDate": "December 15, 2024", "sentiment": "positive", "score": 0.93, "keywords": ["bass", "sound", "quality"] } ] } ## 🚀 Quick Start ### Local Development 1. Install Dependencies bash npm install 2. Create Input File (input.json) json { "products": [ "https://www.amazon.com/dp/B08N5WRWNW", "https://www.walmart.com/ip/123456789" ], "llmProvider": "openai", "apiKey": "your-openai-or-huggingface-api-key", "maxReviews": 50, "notifySlackWebhook": "https://hooks.slack.com/services/YOUR/SLACK/WEBHOOK" } 3. Run Locally bash npm start ### Using Apify CLI 1. Install Apify CLI bash npm install -g @apify/cli 2. Run Actor bash apify run --input input.json ## ☁️ Deploy to Apify Platform ### Option 1: Using Apify CLI (Recommended) 1. Login to Apify bash apify login 2. Push Actor to Platform bash apify push 3. The actor is now available in your Apify Console at: - https://console.apify.com/actors ### Option 2: Manual Upload 1. Go to Apify Console 2. Click "Create Actor" 3. Upload the source code files: - src/main.js - .actor/input_schema.json - package.json - Dockerfile (if needed) ## 🔧 Configuration Options ### Required Fields - products: Array of product URLs to analyze - llmProvider: Choose "openai" or "huggingface" - apiKey: Your API key for the chosen provider ### Optional Fields - maxReviews: Limit reviews per product (default: 50, max: 500) - notifySlackWebhook: Slack webhook URL for notifications - proxyConfiguration: Proxy settings to avoid rate limits ### API Keys Setup OpenAI: 1. Go to OpenAI API Keys 2. Create new secret key 3. Copy the key starting with sk-... Hugging Face: 1. Go to Hugging Face Tokens 2. Create new token with "Read" permission 3. Copy the token starting with hf_... Slack Webhook: 1. Go to Slack API 2. Create webhook for your workspace 3. Copy webhook URL starting with https://hooks.slack.com/... ## 📱 Scheduling Runs ### Automatic Daily Analysis 1. In Apify Console, go to your actor 2. Click "Schedules" tab 3. Click "Create Schedule" 4. Configure: - Name: "Daily Sentiment Analysis" - Cron Expression: 0 9 * * * (runs daily at 9 AM UTC) - Input: Your JSON configuration - Notifications: Enable email/webhook notifications ### Weekly Reports cron 0 9 * * 1 # Every Monday at 9 AM ### Custom Intervals cron 0 */6 * * * # Every 6 hours 0 9 * * 1,3,5 # Monday, Wednesday, Friday at 9 AM ## 🎛️ Advanced Usage ### Batch Processing Multiple Products json { "products": [ "https://www.amazon.com/dp/PRODUCT1", "https://www.amazon.com/dp/PRODUCT2", "https://www.walmart.com/ip/PRODUCT3", "https://www.target.com/p/PRODUCT4" ], "llmProvider": "openai", "apiKey": "sk-your-key-here", "maxReviews": 100 } ### Using Proxy for Large-scale Scraping json { "products": ["..."], "proxyConfiguration": { "useApifyProxy": true, "apifyProxyGroups": ["RESIDENTIAL"], "apifyProxyCountry": "US" } } ### Cost-optimized Hugging Face Setup json { "products": ["..."], "llmProvider": "huggingface", "apiKey": "hf_your-token-here", "maxReviews": 200 } ## 📊 Accessing Results ### Via Apify Console 1. Go to Actor Runs tab 2. Click on completed run 3. View Dataset tab for structured results 4. Download as JSON, CSV, or Excel ### Via API bash # Get latest run results curl "https://api.apify.com/v2/acts/YOUR-ACTOR-ID/runs/last/dataset/items" \ -H "Authorization: Bearer YOUR-API-TOKEN" ### Via SDK javascript import { ApifyApi } from 'apify-client'; const client = new ApifyApi({ token: 'YOUR-API-TOKEN' }); const { items } = await client.dataset('YOUR-DATASET-ID').listItems(); console.log(items); // Your sentiment analysis results ## 🔍 Monitoring & Analytics ### Real-time Monitoring - Actor Runs: Track progress and logs in Apify Console - Slack Notifications: Receive summaries for each product analyzed - Email Alerts: Configure notifications for run completion/failure ### Performance Metrics - Processing Speed: ~5-10 reviews per minute (depends on LLM provider) - Success Rate: >95% for supported e-commerce sites - Cost Estimation: - OpenAI: ~$0.01-0.02 per review - Hugging Face: ~$0.001 per review ## 🛠️ Troubleshooting ### Common Issues 1. "No reviews extracted" - Check if the product URL has customer reviews - Verify the website is supported (Amazon, Walmart, Target, BestBuy) - Try enabling JavaScript rendering for dynamic sites 2. "API rate limit exceeded" - Reduce maxReviews per product - Enable proxy configuration to distribute requests - Add delays between API calls 3. "Invalid API key" - Verify your OpenAI/Hugging Face API key is correct - Check if your API key has sufficient credits/permissions - Ensure the key matches your chosen llmProvider ### Debug Mode Add debugging to input: json { "products": ["..."], "debug": true, "maxReviews": 10 } ### Support - Issues: GitHub Repository Issues - Documentation: Apify Docs - Community: Apify Discord ## 🏢 Business Use Cases ### Brand Monitoring Monitor sentiment across competitor products and your own product lines. ### Market Research Identify trending keywords and customer pain points in your industry. ### Product Development Use customer feedback to guide feature prioritization and improvements. ### Customer Success Proactively identify and address negative sentiment patterns. ## 📈 Scaling for Enterprise ### High-volume Processing json { "products": ["... 100+ URLs"], "maxReviews": 500, "proxyConfiguration": { "useApifyProxy": true, "apifyProxyGroups": ["RESIDENTIAL", "DATACENTER"] } } ### Cost Optimization - Use Hugging Face for large-scale analysis (lower cost) - Implement smart review sampling - Schedule runs during off-peak hours - Use dedicated Apify proxy pools ### Data Export bash # Export to your data warehouse apify call YOUR-ACTOR-ID --output-dataset-id YOUR-DATASET-ID --- ## 🔐 Security & Privacy - API keys are encrypted and stored securely - No review data is permanently stored after processing - Complies with website terms of service and robots.txt - GDPR compliant data handling ## 🚀 Ready to Get Started? 1. Create Apify Account (free tier available) 2. Deploy this actor using apify push 3. Configure your first run with sample product URLs 4. Schedule regular analysis for ongoing insights --- Built with ❤️ using Apify SDK v3 and modern AI APIs

Categories

Common Use Cases

Market Research

Gather competitive intelligence and market data

Lead Generation

Extract contact information for sales outreach

Price Monitoring

Track competitor pricing and product changes

Content Aggregation

Collect and organize content from multiple sources

Ready to Get Started?

Try Product Review Sentiment Analyzer now on Apify. Free tier available with no credit card required.

Start Free Trial

Actor Information

Developer
devwithbobby
Pricing
Paid
Total Runs
6
Active Users
1
Apify Platform

Apify provides a cloud platform for web scraping, data extraction, and automation. Build and run web scrapers in the cloud.

Learn more about Apify

Need Professional Help?

Couldn't solve your problem? Hire a verified specialist on Fiverr to get it done quickly and professionally.

Find a Specialist

Trusted by millions | Money-back guarantee | 24/7 Support