# Product Reviews with Sentiment Analysis (`e-commerce/product-reviews-sentiment`) Actor

Scrape product reviews from 78 marketplaces (Amazon, Walmart, eBay, Target, and more) and enrich each review with sentiment, a confidence score, and per-aspect analysis. Generate a per-product sentiment report. Export data, run via API, schedule and monitor runs, or integrate with other tools.

- **URL**: https://apify.com/e-commerce/product-reviews-sentiment.md
- **Developed by:** [E Commerce](https://apify.com/e-commerce) (community)
- **Categories:** E-commerce, AI
- **Stats:** 6 total users, 1 monthly users, 100.0% runs succeeded, 3 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $1.34 / 1,000 review sentiments

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Product Reviews with Sentiment Analysis

Collects product reviews, enriches every review with sentiment, and generates a full
sentiment report per product.

### What it does

1. **Collects reviews** by calling the deployed e-commerce standby Actors directly
   (`e-commerce--<marketplace>-standby.apify.actor`, `POST /reviews`) for each product or
   review URL, following pagination until every review is collected. 35 marketplaces are
   supported (Amazon, Walmart, eBay, IKEA, Target, Best Buy, and more).
2. **Enriches each review** with sentiment (positive / neutral / negative), a confidence
   score, and per-aspect sentiment, using OpenAI. One enriched row per review is written to
   the dataset.
3. **Generates a per-product report** across all of that product's reviews: an aspect-based
   sentiment analysis with themes, pain points, representative quotes, and recommendations.
   Each report is stored in the key-value store and summarized in the run log.

### Input

Provide at least one product URL or review listing URL on a supported marketplace. Options:
`sortReview`, `additionalReviewProperties`, `maxReviewsPerProduct`, `maxProducts` (report-spend
safety cap), `generateReport`, and `reportFormat` (markdown / html / pdf). The OpenAI models and
sentiment is handled internally - the customer pays per review scored and per report.

#### Configuration (operator only, via env)

- `OPENAI_API_KEY` - required. The Actor uses the operator's OpenAI account; the customer does
  not supply a key.
- `PLATFORM_ACCOUNT_TOKEN` - required. Full Apify account token used to authenticate calls to the
  standby Actors (falls back to `APIFY_TOKEN`).
- `SENTIMENT_MODEL` / `REPORT_MODEL` - optional overrides (default `gpt-4o-mini` / `gpt-4o`).

### Output

- **Dataset**: one enriched review per row (`sentimentLabel`, `sentimentScore`, `aspects`, plus
  the original review fields).
- **Key-value store**: per product, `report-<id>.json` (machine-readable), `report-<id>.md`
  or `.html` (human-readable), and `reports-index.json` mapping every product URL to its
  report records.

### Pricing (pay-per-event)

| Event              | When it is charged                                 |
| ------------------ | -------------------------------------------------- |
| `review-sentiment` | Once per review scored and written to the dataset. |
| `sentiment-report` | Once per product, after its report is stored.      |

# Actor input Schema

## `searchKeywords` (type: `array`):

Enter product keywords (for example "wireless earbuds"). Each keyword is searched on every selected marketplace and the best-matching product is analyzed. Use this instead of, or alongside, pasting product URLs below.

## `searchSources` (type: `array`):

Which marketplaces each keyword is searched on (78 supported). Only applies to keyword search, not to pasted URLs.

## `productReviewUrls` (type: `array`):

Direct links to individual product pages on a supported marketplace. All reviews for each product are collected and analyzed.

## `reviewListingUrls` (type: `array`):

Links to category or listing pages that contain multiple products (for example a Walmart category page). Each product found on the page is collected and its reviews analyzed. Bounded by "Maximum products".

## `sortReview` (type: `string`):

How reviews are sorted before collection. Some marketplaces may not support all options and fall back to the default.

## `additionalReviewProperties` (type: `boolean`):

Includes additional marketplace-specific properties on each collected review.

## `maxReviewsPerProduct` (type: `integer`):

The maximum number of reviews to collect per product.

## `maxProducts` (type: `integer`):

Safety cap on how many distinct products are analyzed in one run. A sentiment report is generated (and charged) per product, so this bounds report spend.

## `generateReport` (type: `boolean`):

Off by default. When enabled, a full sentiment report is generated per product and stored in the key-value store. Each report is a paid event, so turn this on only when you want the reports.

## `reportFormat` (type: `string`):

Human-readable report written to the key-value store. A machine-readable JSON report is always written alongside it.

## Actor input object example

```json
{
  "searchSources": [
    "amazon",
    "ebay",
    "walmart",
    "mercadolibre"
  ],
  "sortReview": "Most recent",
  "additionalReviewProperties": true,
  "maxReviewsPerProduct": 100,
  "maxProducts": 25,
  "generateReport": false,
  "reportFormat": "html"
}
```

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "additionalReviewProperties": true,
    "maxReviewsPerProduct": 100
};

// Run the Actor and wait for it to finish
const run = await client.actor("e-commerce/product-reviews-sentiment").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "additionalReviewProperties": True,
    "maxReviewsPerProduct": 100,
}

# Run the Actor and wait for it to finish
run = client.actor("e-commerce/product-reviews-sentiment").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "additionalReviewProperties": true,
  "maxReviewsPerProduct": 100
}' |
apify call e-commerce/product-reviews-sentiment --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,e-commerce/product-reviews-sentiment"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/ZtNODKp2Ggyh1BqVQ/builds/by5j8I4feNXlIGjUE/openapi.json
