Product Review Sentiment Analyzer
Pricing
$8.00 / 1,000 results
Product Review Sentiment Analyzer
Scrapes product reviews from e-commerce websites and analyzes sentiment using OpenAI or Hugging Face APIs.
0.0 (0)
Pricing
$8.00 / 1,000 results
0
1
1
Last modified
3 days ago
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:
{"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
- Install Dependencies
$npm install
- Create Input File (
input.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"}
- Run Locally
$npm start
Using Apify CLI
- Install Apify CLI
$npm install -g @apify/cli
- Run Actor
$apify run --input input.json
βοΈ Deploy to Apify Platform
Option 1: Using Apify CLI (Recommended)
- Login to Apify
$apify login
- Push Actor to Platform
$apify push
- The actor is now available in your Apify Console at:
https://console.apify.com/actors
Option 2: Manual Upload
- Go to Apify Console
- Click "Create Actor"
- 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:
- Go to OpenAI API Keys
- Create new secret key
- Copy the key starting with
sk-...
Hugging Face:
- Go to Hugging Face Tokens
- Create new token with "Read" permission
- Copy the token starting with
hf_...
Slack Webhook:
- Go to Slack API
- Create webhook for your workspace
- Copy webhook URL starting with
https://hooks.slack.com/...
π± Scheduling Runs
Automatic Daily Analysis
- In Apify Console, go to your actor
- Click "Schedules" tab
- Click "Create Schedule"
- 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
0 9 * * 1 # Every Monday at 9 AM
Custom Intervals
0 */6 * * * # Every 6 hours0 9 * * 1,3,5 # Monday, Wednesday, Friday at 9 AM
ποΈ Advanced Usage
Batch Processing Multiple Products
{"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
{"products": ["..."],"proxyConfiguration": {"useApifyProxy": true,"apifyProxyGroups": ["RESIDENTIAL"],"apifyProxyCountry": "US"}}
Cost-optimized Hugging Face Setup
{"products": ["..."],"llmProvider": "huggingface","apiKey": "hf_your-token-here","maxReviews": 200}
π Accessing Results
Via Apify Console
- Go to Actor Runs tab
- Click on completed run
- View Dataset tab for structured results
- Download as JSON, CSV, or Excel
Via API
# Get latest run resultscurl "https://api.apify.com/v2/acts/YOUR-ACTOR-ID/runs/last/dataset/items" \-H "Authorization: Bearer YOUR-API-TOKEN"
Via SDK
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:
{"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
{"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
# Export to your data warehouseapify 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?
- Create Apify Account (free tier available)
- Deploy this actor using
apify push
- Configure your first run with sample product URLs
- Schedule regular analysis for ongoing insights
Built with β€οΈ using Apify SDK v3 and modern AI APIs