# Sentiment Analysis — Reviews, Comments & Any Dataset (`tidydata/sentiment-analysis`) Actor

Positive, neutral or negative for every review, comment or post: paste texts, upload a CSV/Excel or chain any scraper dataset (Google Maps, Amazon, Trustpilot, YouTube…). 16+ languages, mixed opinions, star-rating mismatches and a summary report. Own model, no third-party API.

- **URL**: https://apify.com/tidydata/sentiment-analysis.md
- **Developed by:** [tidydata](https://apify.com/tidydata) (community)
- **Categories:** AI, Social media, E-commerce
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 text analyseds

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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

## 😊 Sentiment Analysis — reviews, comments & any dataset, in 16+ languages

![Real run: customer reviews scored positive, neutral or negative, with mixed opinions, best and worst sentence, star ratings that do not match the text, and the one-page sentiment report](https://api.apify.com/v2/key-value-stores/UJXqVadHhfb2eqS2e/records/sentiment-analysis.png)

**Know what people really think, in bulk.** Paste texts, upload a CSV or Excel file, or chain it after any reviews or comments scraper, and get for every text **positive / neutral / negative**, a **score from −1 to +1**, the probabilities, **mixed opinions** with the best and the worst sentence, and a **flag when the star rating does not match the words**. Every run also writes a **one-page report**: net sentiment, by star rating, by product or place, by language, and *what people mention* in positive and in negative texts.

**$1 per 1,000 texts** (up to 1,000 words each) **+ the Apify compute of the run** (see [Pricing](#pricing)). Empty rows, failed files and skipped texts are free. No API key, no subscription.

- ✅ **Its own multilingual model** (XLM-RoBERTa large, Apache-2.0) running inside the Actor: **no OpenAI or other third-party API**, nothing that breaks when a website changes, and **your texts are not sent to any other service**
- ✅ **16+ languages** in one run, with no setting: English, Spanish, French, German, Italian, Portuguese, Dutch, Russian, Turkish, Arabic, Hindi, Indonesian, Vietnamese, Chinese, Japanese, Korean… (language detected per text)
- ✅ Understands real comments: **irony** ("Great, another update that breaks everything 🙄" → negative), **emojis**, negation ("not bad at all" → positive), slang and typos
- ✅ **Chain any scraper**: Google Maps, Amazon, Trustpilot, Booking, TripAdvisor, Yelp, App Store, Google Play, YouTube, TikTok, Instagram, X, Reddit… The text, star-rating and ID fields are **found automatically**, and **all the original columns are kept** → one enriched table to export
- ✅ **Files**: CSV / TSV (any separator and encoding), Excel (.xlsx), JSON / JSON Lines, TXT (one text per line), uploads or Google Drive / Dropbox / OneDrive links — exports from Trustpilot, App Store Connect, Play Console, Typeform, Google Forms, help desks…
- ✅ **Honest results**: probabilities and a confidence on every row, our own accuracy test published below

### What can I use it for?

- **Reviews (local businesses, hotels, restaurants)**: run [Google Maps Reviews](https://apify.com/compass/Google-Maps-Reviews-Scraper) or a TripAdvisor / Booking scraper, then this → net sentiment per place, what guests complain about, 5-star reviews with an angry text.
- **E-commerce**: Amazon, Trustpilot or Shopify reviews → which products get negative reviews and why (*battery*, *delivery*, *size*…), with `groupByField: "asin"`.
- **Apps**: App Store and Google Play reviews → spot the update that made people angry.
- **Social media and brands**: YouTube, TikTok, Instagram or X comments → how people react to each video, post or campaign.
- **Customer support and surveys**: tickets, chats, NPS and open survey answers → route negative ones first, measure feedback over time.
- **AI agents, n8n, Make, Zapier**: send `{"texts": […]}` and branch on `sentiment` — no LLM call, no prompt, the same answer every time.

### How to use it

1. **Give it texts** in any of these ways (you can mix them):
   - **Texts**: one per line. From the API you can also send objects: `[{"id": "R-1", "text": "…", "rating": 4}]`.
   - **Files**: links to CSV, Excel, JSON or TXT files, or **upload** them.
   - **Dataset of another Actor**: pick the dataset of a reviews / comments scraper (or pass its ID from an integration or webhook).
2. Optional: the **field with the text** (e.g. `text`, `reviewText`, `title,text` to join two fields), the **star-rating field**, the **ID field** and a field to **group the report by** (place, product, app, channel…). Empty = found automatically.
3. **Run.** Results: one row per text in the dataset, plus the **REPORT** (HTML page) and **SUMMARY** (JSON) records in the run's key-value store — both linked in the *Output* tab.

**Chain it after a scraper** with an Apify integration ("Run Actor" when the scraper succeeds, passing `{"datasetId": "{{resource.defaultDatasetId}}"}`), or call it from your code:

```bash
curl -X POST "https://api.apify.com/v2/acts/tidydata~sentiment-analysis/run-sync-get-dataset-items?token=YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"texts": ["Loved it, will come back!", "Waited 50 minutes, food was cold."]}'
```

### Output example

```json
{
  "position": 3,
  "source": "dataset",
  "id": "ChdDSUhNMG9nS0VJQ0FnSUR",
  "sentiment": "positive",
  "sentimentScore": 0.28,
  "confidence": 0.49,
  "positive": 0.49,
  "neutral": 0.30,
  "negative": 0.21,
  "isMixed": true,
  "bestSentence": "The terrace is lovely",
  "worstSentence": "but parking is a nightmare.",
  "rating": 4,
  "ratingMismatch": false,
  "language": "en",
  "languageName": "English",
  "wordCount": 11,
  "datasetRow": 3,
  "charged": true,
  "name": "Li",
  "stars": 4,
  "title": "Casa Lola",
  "input_text": "Good value. The terrace is lovely, but parking is a nightmare."
}
```

- `sentiment`: `positive`, `neutral` or `negative` · `sentimentScore`: −1 (very negative) … +1 (very positive) = positive − negative probability · `confidence`: probability of the chosen sentiment.
- `isMixed`: the text has a clearly positive **and** a clearly negative part ("great battery, but the camera…"). `bestSentence` / `worstSentence`: the most positive / negative sentence or clause.
- `rating`: the star rating of the row on a 1-5 scale (10-point and 100-point scores, "4/10" and "4.0 out of 5 stars" are converted). `ratingMismatch` / `mismatchType`: `high_rating_negative_text` or `low_rating_positive_text` — reviews worth reading first.
- With **Keep all the original fields** (default for files and datasets) every result also has the columns of the original row; a column that has the same name as one of ours is renamed `input_<name>` (like `input_text` above).
- Rows that could not be analysed have `status: "failed"` and the reason in `error` (never charged).

**The report** (record `REPORT`, also as JSON in `SUMMARY`): texts analysed, **net sentiment** (% positive − % negative), % positive / neutral / negative, average score, mixed texts, a table **by star rating**, **by group** (your field) and **by language**, the **terms people mention** much more in positive texts and in negative texts ("battery life", "delivery", "staff"…), the most positive and most negative texts, and examples of ratings that do not match the text.

### Accuracy (our own test, November 2026)

We tested 5 open sentiment models before choosing this one:

| Test | This Actor | Next best model |
|---|---|---|
| 600 Amazon reviews in 6 languages (EN, ES, DE, FR, JA, ZH), 120 per star level — positive vs negative (1-2 vs 4-5 stars) | **96 %** | 96 % |
| Same reviews — negative / neutral / positive (3 stars = neutral) | **82 %** | 83 % |
| 63 hard comments we wrote in 14 languages: irony, emojis, negation, slang, mixed opinions | **57 of 63** | 54 of 63 |

The model we use (`clapAI/roberta-large-multilingual-sentiment`, XLM-RoBERTa large, Apache-2.0) was the best overall; the classic 1-5-star model many tools use scored 71 % and 44 of 63. The most common mistake: **plain facts read as slightly positive** ("Delivered on Tuesday" → positive), because the model learned from reviews. Use `confidence` and the probabilities if you need to be strict.

### Pricing

| What | Price |
|---|---|
| One text up to 1,000 words | **$0.001** |
| Longer texts | $0.001 per started 1,000 words |
| Empty rows, failed files, skipped texts | free |
| Apify compute (paid to Apify; your plan's free credit covers it) | about **$0.17 per 1,000 short reviews** + about **$0.005 per run** to start |

So **1,000 short reviews cost about $1.20 in total** — measured on Apify in November 2026. Other sentiment Actors charge $3 to $4 per 1,000 comments. Apify store discounts apply automatically (−10 % Bronze, −15 % Silver, −20 % Gold and above). **Tip:** send many texts in one run instead of one run per text — the start is paid once.

Your **spending limit** is respected: the Actor checks it **before** each batch and stops cleanly, marking the rest as skipped (free).

### Limits and good to know

- **Sentiment is not a fact.** It is a probability from a statistical model: great for trends, sorting and routing thousands of texts, less for judging a single sentence. Very short texts ("ok", "👍") get a sentiment, but a weak one.
- **Languages**: the 16 languages listed above were in the model's training; other languages (Polish, Swedish, Greek…) usually work but were not in our test — the row says so in `note`.
- **Long texts** (articles, transcripts) are read in pieces of about 300 words and averaged; texts over 20,000 words are cut there (noted in the row). Sentence analysis looks at the first 40 sentences.
- **Key terms** in the report need at least a few dozen texts and are not computed for Chinese, Japanese, Korean and Thai (no spaces between words).
- **Files**: old `.xls` → save as `.xlsx` or `.csv`. PDFs and web pages are not read as review tables; for web articles use [Article Text Extractor](https://apify.com/tidydata/article-text-extractor) first.

### FAQ

**Is my text sent to OpenAI or another API?** No. The model runs inside your Actor run on Apify; texts are not sent to any other service and are not stored by us.

**Why not ask ChatGPT?** You can, but for thousands of reviews an LLM is slower, costs more, needs a prompt and can answer differently each time. This model gives the same answer for the same text, with probabilities, at $1 per 1,000.

**Does it scrape the reviews?** No: it analyses texts you give it. Run any reviews or comments scraper first and chain this Actor after it (or give it the dataset ID).

**How fast is it?** About 1,000 short reviews in 15 minutes on the default 4 GB of memory (measured on Apify). Turning off *Analyse each sentence too* makes long reviews faster.

**How do I get the result into Google Sheets or Excel?** Export the dataset as CSV or Excel (with *Keep all the original fields* on, it is your original table plus the sentiment columns), or use [Google Sheets Import & Export](https://apify.com/tidydata/google-sheets-export-import).

### Related Actors

- [Merge, Dedupe & Transform Datasets](https://apify.com/tidydata/merge-dedupe-datasets) — join several review datasets before scoring them, or filter the negative ones after
- [Bulk Translator](https://apify.com/tidydata/bulk-translator) — translate reviews and comments from any language into yours (46 languages), keeping all the columns
- [AI Content Detector](https://apify.com/tidydata/ai-content-detector) — check if reviews or posts were written by AI
- [Audio & Video Transcription](https://apify.com/tidydata/audio-video-transcription) — turn calls, videos and podcasts into text, then score the sentiment here
- [Google Sheets Import & Export](https://apify.com/tidydata/google-sheets-export-import) — send the results to a spreadsheet

# Actor input Schema

## `texts` (type: `array`):

One text per line: reviews, comments, posts, survey answers, tickets, emails… From the API, n8n, Make, Zapier or an AI agent you can also send objects: \[{"id": "R-1", "text": "…", "rating": 4}].

## `fileUrls` (type: `array`):

Links to CSV / TSV, Excel (.xlsx), JSON / JSON Lines or TXT files (one text per line). The text column is found automatically (or set it below). Google Drive, Dropbox and OneDrive share links work.

## `uploadedFiles` (type: `array`):

Upload CSV, Excel, JSON or TXT files from your computer: exports from Trustpilot, App Store Connect, Google Play Console, surveys (Typeform, Google Forms), help desks…

## `datasetId` (type: `string`):

Add sentiment to the results of a reviews or comments scraper (Google Maps, Amazon, Trustpilot, Booking, TripAdvisor, App Store, Google Play, YouTube, TikTok, Instagram, X, Reddit…). Pick the dataset or pass its ID from an integration / webhook.

## `textField` (type: `string`):

Column or field with the text, e.g. text, reviewText, comment or a nested path like review.body. Two or more fields are joined: title,text. Empty = found automatically.

## `ratingField` (type: `string`):

Optional: e.g. stars, rating, score. Empty = found automatically (stars, rating, ratingScore…). 1-5 stars, 1-10 scores and 0-100 are understood. Used for the star-rating breakdown and to flag ratings that do not match the text.

## `idField` (type: `string`):

Optional: a field copied to each result as 'id' (e.g. reviewId, url, sku). Empty = reviewId / commentId / id if present.

## `groupByField` (type: `string`):

Optional: a field to compare in the report, e.g. title (place name), asin (product), app, brand, location or channel.

## `includeInputFields` (type: `boolean`):

For files and datasets: each result keeps all the columns of the original row plus the sentiment columns, so you can export one enriched table. Off = only the sentiment columns, the text and the ID.

## `sentenceAnalysis` (type: `boolean`):

Scores every sentence of a text to find mixed opinions ("great battery, terrible camera") and return the best and the worst sentence. Off = faster on long reviews.

## `includeSentences` (type: `boolean`):

Adds the list of sentences with their sentiment to each result (bigger output).

## `maxTexts` (type: `integer`):

Upper limit of texts analysed in one run.

## `maxFileSizeMb` (type: `integer`):

Bigger files are not downloaded (free).

## Actor input object example

```json
{
  "texts": [
    "The room was spotless and the staff could not have been friendlier. We will be back!",
    "Great, another update that breaks everything. Thanks a lot 🙄",
    "Does it come in blue as well?",
    "The battery life is amazing, but the camera is disappointing in low light.",
    "Me encanta, llegó antes de lo previsto y funciona de lujo.",
    "Service client inexistant, à fuir.",
    "Leider völlig unbrauchbar, geht sofort zurück.",
    "质量很好，物流也很快，满意"
  ],
  "includeInputFields": true,
  "sentenceAnalysis": true,
  "includeSentences": false,
  "maxTexts": 10000,
  "maxFileSizeMb": 100
}
```

# Actor output Schema

## `report` (type: `string`):

One page: net sentiment, % positive / neutral / negative, by star rating, by group and language, what people mention in positive and negative texts, most positive and most negative texts, rating mismatches.

## `results` (type: `string`):

One row per text: sentiment, score, probabilities, mixed opinion, best / worst sentence, stars and mismatch, language.

## `summary` (type: `string`):

All the report numbers as JSON: totals, net sentiment, by rating, by language, by group, key terms, examples.

# 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 = {
    "texts": [
        "The room was spotless and the staff could not have been friendlier. We will be back!",
        "Great, another update that breaks everything. Thanks a lot 🙄",
        "Does it come in blue as well?",
        "The battery life is amazing, but the camera is disappointing in low light.",
        "Me encanta, llegó antes de lo previsto y funciona de lujo.",
        "Service client inexistant, à fuir.",
        "Leider völlig unbrauchbar, geht sofort zurück.",
        "质量很好，物流也很快，满意"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("tidydata/sentiment-analysis").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 = { "texts": [
        "The room was spotless and the staff could not have been friendlier. We will be back!",
        "Great, another update that breaks everything. Thanks a lot 🙄",
        "Does it come in blue as well?",
        "The battery life is amazing, but the camera is disappointing in low light.",
        "Me encanta, llegó antes de lo previsto y funciona de lujo.",
        "Service client inexistant, à fuir.",
        "Leider völlig unbrauchbar, geht sofort zurück.",
        "质量很好，物流也很快，满意",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("tidydata/sentiment-analysis").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 '{
  "texts": [
    "The room was spotless and the staff could not have been friendlier. We will be back!",
    "Great, another update that breaks everything. Thanks a lot 🙄",
    "Does it come in blue as well?",
    "The battery life is amazing, but the camera is disappointing in low light.",
    "Me encanta, llegó antes de lo previsto y funciona de lujo.",
    "Service client inexistant, à fuir.",
    "Leider völlig unbrauchbar, geht sofort zurück.",
    "质量很好，物流也很快，满意"
  ]
}' |
apify call tidydata/sentiment-analysis --silent --output-dataset

```

## MCP server setup

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

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/J7dFNKfKpMCI5HXC9/builds/4VQc7qJKcla90i3Yf/openapi.json
