# Review Sentiment Analysis - Reviews, Posts & Support Texts (`tidytools/sentiment-analysis-texts`) Actor

Review sentiment analysis for your own reviews, social posts and support messages: each text gets positive, neutral, negative or mixed, plus confidence and a one-line reason. Paste texts or pass a Dataset. $4 per 1,000 texts; blank rows free.

- **URL**: https://apify.com/tidytools/sentiment-analysis-texts.md
- **Developed by:** [Yukai Lin](https://apify.com/tidytools) (community)
- **Categories:** AI, Automation, Business
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.20 / 1,000 classified pages

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

## Review Sentiment Analysis — Reviews & Texts

### What does it do?

Paste your own product reviews, social posts or support messages. This variant uses the AI page classifier with **Sentiment** selected by default, returning one Dataset row per text with a `label` of `positive`, `neutral`, `negative` or `mixed`, plus a short `reason` and `confidence`. The three example reviews are ready to run without changing a field. You can also classify public page URLs or text from another Actor's dataset.

This Actor classifies text you supply. It does **not** crawl a review website or discover reviews. To analyze reviews from a site, first use a review scraper that permits your use, then pass its dataset ID and review-text field here.

### How to use

1. Keep the three example entries in **Reviews, posts or support messages** to try it, or replace each entry with one of your own texts.
2. Keep **Classification: Sentiment** and **Analysis depth: Standard**, or adjust the depth. If you want to process only a source dataset, clear the three prefilled texts, select **Dataset ID**, and set **Dataset field** to the text column when automatic detection is unsuitable.
3. Start the Actor. The **Sentiment results** Dataset view shows the source ID, sentiment label, confidence, reason, language, charge flag and any error. Export the view as CSV, Excel or JSON. The full Dataset includes `textPreview`, source and error details.

### Input example

```json
{"texts":["Great product, arrived early.","Terrible support, never again.","Good price but the box was damaged."]}
```

An API request should send `taxonomy: "sentiment"` explicitly: the Apify console applies the input schema default, while raw engine calls otherwise default to Page type. For dataset-only API runs, send `"texts": []` to avoid including the console examples.

### Output example

Illustrative labels and reasons for the three examples (AI wording and confidence can vary):

```json
{"source":"text-0","textPreview":"Great product, arrived early.","label":"positive","confidence":"high","reason":"Praises the product and early delivery.","language":"en","taxonomy":"sentiment","analysisDepth":"standard","charged":true}
```

The next two rows should be `negative` and `mixed` when the model reads those examples. The full row also has `inputIndex`, `success`, `reviewSuggested`, `labelSource` and `classifiedAt`; error rows have `errorType`, `error` and `charged: false`.

### Pricing

This variant uses the original classifier's events and prices. Each successfully classified text or page emits one depth-specific event: Quick `page-classified-quick` ($0.003), Standard `page-classified` ($0.004, default), or Deep `page-classified-deep` ($0.008) on Free/Bronze. Three successful prefilled texts therefore emit three Standard events ($0.012). Other Apify plan discounts and the run's maximum charge setting follow the original classifier. Optional Apify proxy use is billed separately by Apify.

An empty text entry produces a free `invalid_input` row with `charged: false` and no classification event. A failed classification or timeout also produces a free error row. Long text is **not automatically free**: the engine sends at most the first 200,000 guarded characters to the backend and asks the model to read up to the chosen depth (Quick 4,000, Standard 12,000, Deep 32,000). If classification succeeds, it still emits one event; if it fails, the error row is free. Review the result when the original message exceeds the selected depth.

### Limitations

Sentiment is an AI estimate, not a verified assessment of the writer's intent. Sarcasm, context missing from short messages and mixed opinions can change the label; check `reason` and sample important cases manually. Text entered into this Actor is sent to the classifier backend. Only use messages you are allowed to process; remove personal or confidential data when possible. A public URL is read as a page, not as individual reviews on that page.

### FAQ

**Can I classify a spreadsheet of reviews?** Yes. Import it into an Apify Dataset, clear the prefilled examples, select its dataset ID and set the field containing each review. Values that look like URLs may be read as pages by the original engine.

**Are blank rows billed?** No. An empty entry gets a free `invalid_input` row, and no `page-classified` event.

**Does a long review get rejected for free?** No automatic length rejection is implemented. The engine truncates the text it sends to the backend, then charges once if it returns a usable classification. Failed rows are free.

**Does this scrape reviews from a website?** No. Use a review scraper first, subject to its source terms, then pass its Dataset here.

# Actor input Schema

## `domains` (type: `array`):

Optional public page URLs or domains to classify by sentiment, one per line. For reviews on a website, extract the review text with a separate scraper first; this Actor does not scrape review listings.

## `startUrls` (type: `array`):

Same as "URLs or domains", in Apify's request list format (also accepts a link to a text file with URLs). Kept for existing integrations; new integrations should use "domains".

## `taxonomy` (type: `string`):

Sentiment returns positive, neutral, negative or mixed for each review, social post, support message or public page. Other original classifier taxonomies remain available.

## `customLabels` (type: `array`):

Used when "Classify by" is "Custom labels". One label per line, optionally with a description after a colon, e.g. "Competitor: sells project management software". 2 to 100 labels, any language.

## `multiLabel` (type: `boolean`):

Return all labels that clearly apply (in "labels") besides the main one. On by default for topics and IAB, off for page types, industries and custom labels.

## `instructions` (type: `string`):

Optional hints for the AI, up to 1,000 characters, e.g. "Pages about our own product are not competitors."

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

Paste your own review, social post or support message, one text per entry. Each successful text classification is one charged item. Empty entries return free error rows.

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

Optional dataset from a review scraper or another Actor. Clear the prefilled texts if you want to process only the dataset; choose its review-text field below.

## `previousDatasetId` (type: `string`):

Compare this run's sentiment labels with a previous run of this Actor. The prior dataset is only a baseline; every text is analysed again and charged as usual. Previous data must be readable and contain at most 100,000 rows.

## `datasetField` (type: `string`):

Dataset field holding each review or message, for example text or review.body. Empty uses the engine automatic URL/text field selection.

## `analysisDepth` (type: `string`):

How much of each page the AI reads. Quick: the first 4,000 characters (cheapest, fine for home pages). Standard: 12,000. Deep: 32,000 (long or complex pages). Each depth has its own price.

## `readAboutPage` (type: `boolean`):

For home pages or bare domains with less than 300 characters of text (JavaScript shells, splash pages), also read the site's About page (an About / Company link, or /about) and classify both together. No extra charge. Not used with the Page type taxonomy.

## `industryCodes` (type: `string`):

Only with the Industry taxonomy: also return standard industry codes for each industry label, from a fixed lookup table (NAICS 2022 6-digit, SIC 1987 4-digit), with codeConfidence (high, medium, low, or none when no single code fits). No extra AI call and no extra charge. none = no code columns.

## `mode` (type: `string`):

"Auto" reads pages over plain HTTP and uses a real browser only when a site blocks that or needs JavaScript. Values: auto = Auto (recommended); fast = Plain HTTP only; browser = Browser only.

## `maxConcurrency` (type: `integer`):

How many pages are classified at the same time.

## `httpVia` (type: `string`):

Some sites block requests from data centers. Auto retries from a second network before falling back to a real browser. If both are refused, Auto also tries our second server (Oracle, different IP) before a real browser.

## `warpRetry` (type: `boolean`):

Only for URLs (used with Auto and Our servers only): when a website refuses every request (HTTP 401, 403, 406 or 451, not a CAPTCHA or bot-check page), its page is asked once more through our Cloudflare WARP network with a standard browser User-Agent (still ending with our TidyTools token). A recovered page is a normal result at the normal price; if it refuses again, the row stays a free error row (retried: true). CAPTCHAs are never solved.

## `networkRetry` (type: `boolean`):

Only for URLs (used with Auto and Our servers only): a website that could not be reached for a passing reason (connection error, time limit, temporary DNS failure) is read once more at the end of the run through our Cloudflare WARP network instead of the same routes. A recovered page is a normal result at the normal price; if it still fails, the row stays a free error row with its first error type (retried: true). Off: that one retry uses the usual routes.

## `itemTimeoutSecs` (type: `integer`):

A page or text that takes longer (reading + AI) is stopped and returned as a free error row with errorType "timeout". 0 = no limit.

## `dedupeStoreName` (type: `string`):

For lists you run again and again. Give a name (e.g. "my-leads"): each charged result is also kept in a key-value store named classifier-cache-<name> in your Apify account, and a later run with the same name and the same settings (taxonomy, labels, instructions, depth; for URLs also the reading mode, route and proxy) returns the earlier result for that URL or text instead of classifying it again, marked fromCache and not charged. Empty = off.

## `dedupeMaxAgeDays` (type: `integer`):

Only with the store name above: results older than this are classified again (and charged as usual).

## `proxyConfiguration` (type: `object`):

Only used for requests sent from Apify's network. Apify proxy usage is billed to your Apify account.

## Actor input object example

```json
{
  "taxonomy": "sentiment",
  "texts": [
    "Great product, arrived early.",
    "Terrible support, never again.",
    "Good price but the box was damaged."
  ],
  "analysisDepth": "standard",
  "readAboutPage": true,
  "industryCodes": "none",
  "mode": "auto",
  "maxConcurrency": 10,
  "httpVia": "auto",
  "warpRetry": true,
  "networkRetry": true,
  "itemTimeoutSecs": 180,
  "dedupeMaxAgeDays": 30
}
```

# Actor output Schema

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

No description

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

No description

## `full` (type: `string`):

No description

## `details` (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 = {
    "texts": [
        "Great product, arrived early.",
        "Terrible support, never again.",
        "Good price but the box was damaged."
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("tidytools/sentiment-analysis-texts").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": [
        "Great product, arrived early.",
        "Terrible support, never again.",
        "Good price but the box was damaged.",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("tidytools/sentiment-analysis-texts").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": [
    "Great product, arrived early.",
    "Terrible support, never again.",
    "Good price but the box was damaged."
  ]
}' |
apify call tidytools/sentiment-analysis-texts --silent --output-dataset

```

## MCP server setup

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

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/pMAh6tLHjjlwnCz8o/builds/Jz37j4wPq8hGcqbg6/openapi.json
