# Review Sentiment Analyzer (`daftvader/review-sentiment-analyzer-7489ae06-fcd6-5ca6-bc16-5e4c91dcb6fd`) Actor

Turn up to 5,000 supplied reviews into sentiment, theme, complaint, and trend summaries.

- **URL**: https://apify.com/daftvader/review-sentiment-analyzer-7489ae06-fcd6-5ca6-bc16-5e4c91dcb6fd.md
- **Developed by:** [Sam Towers](https://apify.com/daftvader) (community)
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $10.00 / 1,000 reviews analyzeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## Review Sentiment Analyzer

Turn a collection of customer reviews into a compact view of sentiment, recurring
themes, complaints, and changes over time. Supply reviews directly or select an
existing Apify dataset, and receive one structured analysis record ready for
inspection or downstream automation.

### What you can learn

- See positive, neutral, and negative review counts and percentages.
- Find frequently mentioned words as themes and recurring negative terms as complaints.
- Compare positive and negative percentages by month when reviews include dates.
- Confirm exactly how many reviews were analyzed and how many billable review blocks were used.

This Actor is useful for summarizing feedback exports, monitoring recurring service
issues, comparing sentiment across batches, and preparing review data for reports
or workflows.

### Input

Provide exactly one review source:

- `reviews`: an array of review strings or objects. Objects may use `text`,
  `review`, or `content` for the review text, plus optional numeric `rating` and
  `date` or `reviewed_at` values.
- `dataset_id`: an accessible Apify dataset containing review strings or objects
  in the same shape.

Use `max_items` to limit analysis from 1 to 5,000 reviews and `max_themes` to
return from 1 to 50 themes and complaint terms. `proxy_configuration` is retained
for interface compatibility; the local analysis does not require a proxy.

Example:

```json
{
  "reviews": [
    {"text": "Great service and friendly support", "rating": 5, "date": "2026-01-10"},
    {"text": "Slow delivery and poor communication", "rating": 2, "date": "2026-02-12"}
  ],
  "max_items": 5000,
  "max_themes": 10
}
```

### Output

The default dataset receives one record with:

- `analyzed_review_count`;
- sentiment counts and percentages;
- frequency-ranked themes and complaint terms;
- month-ordered trends when usable dates are present; and
- `billable_events`, an auditable summary of charged-event quantities.

Percentages are rounded to two decimal places. The analysis is deterministic and
uses a simple English sentiment lexicon with ratings as a fallback. It does not
infer sarcasm, nuanced negation, non-English sentiment, or semantic topic clusters.

### Pricing and limits

The Actor charges an `apify-actor-start` event when a run starts and one
`reviews-analyzed-100` event for each started block of 100 analyzed reviews. The
input is capped at 5,000 reviews per run. Current event prices are shown on the
Actor's Apify pricing page before you start a run.

### Run locally

```sh
python3 -m unittest discover -s tests -v
```

# Actor input Schema

## `reviews` (type: `array`):

Review texts or objects containing text, review, or content. Use this or Dataset, but not both.

## `dataset_id` (type: `string`):

An accessible Apify dataset containing review items. Use this or Reviews, but not both.

## `max_items` (type: `integer`):

Analyze at most this many reviews.

## `max_themes` (type: `integer`):

Return up to this many themes and complaint terms.

## `proxy_configuration` (type: `object`):

Accepted for interface compatibility. Local review analysis does not use a proxy.

## Actor input object example

```json
{
  "reviews": [
    {
      "text": "Great service and friendly support",
      "rating": 5,
      "date": "2026-01-10"
    },
    {
      "text": "Slow delivery and poor communication",
      "rating": 2,
      "date": "2026-02-12"
    },
    {
      "text": "The order arrived as described",
      "rating": 3,
      "date": "2026-02-20"
    }
  ],
  "max_items": 5000,
  "max_themes": 10
}
```

# Actor output Schema

## `dataset` (type: `string`):

No description

# 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 = {
    "reviews": [
        {
            "text": "Great service and friendly support",
            "rating": 5,
            "date": "2026-01-10"
        },
        {
            "text": "Slow delivery and poor communication",
            "rating": 2,
            "date": "2026-02-12"
        },
        {
            "text": "The order arrived as described",
            "rating": 3,
            "date": "2026-02-20"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("daftvader/review-sentiment-analyzer-7489ae06-fcd6-5ca6-bc16-5e4c91dcb6fd").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 = { "reviews": [
        {
            "text": "Great service and friendly support",
            "rating": 5,
            "date": "2026-01-10",
        },
        {
            "text": "Slow delivery and poor communication",
            "rating": 2,
            "date": "2026-02-12",
        },
        {
            "text": "The order arrived as described",
            "rating": 3,
            "date": "2026-02-20",
        },
    ] }

# Run the Actor and wait for it to finish
run = client.actor("daftvader/review-sentiment-analyzer-7489ae06-fcd6-5ca6-bc16-5e4c91dcb6fd").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 '{
  "reviews": [
    {
      "text": "Great service and friendly support",
      "rating": 5,
      "date": "2026-01-10"
    },
    {
      "text": "Slow delivery and poor communication",
      "rating": 2,
      "date": "2026-02-12"
    },
    {
      "text": "The order arrived as described",
      "rating": 3,
      "date": "2026-02-20"
    }
  ]
}' |
apify call daftvader/review-sentiment-analyzer-7489ae06-fcd6-5ca6-bc16-5e4c91dcb6fd --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,daftvader/review-sentiment-analyzer-7489ae06-fcd6-5ca6-bc16-5e4c91dcb6fd"
        }
    }
}
```

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/NvVJx6ZdeAebzgLiK/builds/3d6zKIkfocLR8XGzJ/openapi.json
