Product Review Sentiment Analyzer avatar
Product Review Sentiment Analyzer

Pricing

$8.00 / 1,000 results

Go to Apify Store
Product Review Sentiment Analyzer

Product Review Sentiment Analyzer

Developed by

Dev with Bobby

Dev with Bobby

Maintained by Community

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

  1. Install Dependencies
$npm install
  1. 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"
}
  1. Run Locally
$npm start

Using Apify CLI

  1. Install Apify CLI
$npm install -g @apify/cli
  1. Run Actor
$apify run --input input.json

☁️ Deploy to Apify Platform

  1. Login to Apify
$apify login
  1. Push Actor to Platform
$apify push
  1. 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

0 9 * * 1 # Every Monday at 9 AM

Custom Intervals

0 */6 * * * # Every 6 hours
0 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

  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

# 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

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

🏒 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 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