# Review Action AI (`danielmichalek/review-insights-analyzer`) Actor

Analyze supplied reviews in Polish or English and see suggested actions with supporting quotes. Ready to review your customer feedback?

- **URL**: https://apify.com/danielmichalek/review-insights-analyzer.md
- **Developed by:** [Daniel Michałek](https://apify.com/danielmichalek) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 90.9% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$100.00 / 1,000 review reports

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 Action AI

Turn reviews for one business into a cited report of themes and suggested actions. The Actor accepts reviews you already have; it does not scrape review websites.

### What it does

The Actor normalizes one current sample, removes duplicate review IDs and asks a language model to identify up to five themes using short review identifiers. The application validates those identifiers and copies the complete bounded, redacted review text into each citation. It restores original review IDs and periods locally. Quotations show prepared source text, rather than model-written excerpts or untouched original documents. Optional previous reviews are included in the same request and identified separately in the output.

Counts show how many reviews the model cited, not a complete statistical measurement. Themes, summaries and suggested actions are AI interpretations and need human review; matching a quotation does not automatically prove the model's interpretation.

### Input

Provide either `reviews`, a JSON array with `id`, `text`, optional `rating` and `reviewUrl`, or `datasetId`, the ID of an existing Apify dataset. Supply a single business per run. Optional `previousReviews` or `previousDatasetId` provides an earlier sample. Choose `language` as `en` or `pl`, and set `maxReviews` between 1 and 60 per sample. Empty reviews are skipped; repeated IDs with different texts are rejected. Long input is truncated and marked.

Set `allowPaidAI` only after reviewing AI and platform usage costs. One request sends redacted review text to the Apify OpenRouter proxy using the Actor's run credential. Emails and telephone-like strings are redacted and URL query strings are removed, but other personal details may remain; only submit data you are entitled to process and share. The Actor does not write its own run credential into the report.

### Output

The default dataset contains one structured report with themes, suggested actions, supporting review IDs, source quotations and available source URLs. The `REPORT` key in the default key-value store contains the readable Markdown version. Comparison counts refer to cited reviews in each sample and must not be treated as population-wide statistics. The `AI_USAGE` key stores the generation ID and usage values returned by the provider for reconciliation; a reported model cost is not an invoice for every platform charge. The `AI_RESPONSE` diagnostic key stores the model's structured draft before validation, under the run's normal storage access rules. It is not a validated report and may exist after a failed run.

### Pricing and cost control

The Actor makes at most one AI request per run, with up to 60 reviews per sample and a maximum of 1200 output tokens. The complete serialized model input, including both samples and instructions, is limited to 32000 UTF-8 bytes. Oversized requests fail before inference; reduce or split the review set. Individual reviews and total review text are also bounded and any text truncation is marked.

AI and platform usage can incur costs in addition to any Actor event price; a result charge limit is not a guarantee of zero AI cost. Check current provider prices and account limits before enabling the AI option. The proxy requires Apify runtime; local development cannot use this proxy endpoint merely by supplying an account token. A successful real cloud example is included, based on explicitly synthetic input.

### Limitations and fair use

Apify's OpenRouter service may be unavailable to free accounts. If permission, credentials or the model are unavailable, the run fails clearly and does not invent a report. The Actor does not access logins, bypass security checks or send messages. It does not verify whether the underlying review is truthful, whether an AI conclusion logically follows from a citation, or whether a proposed business action will work.

### Example

Provide two or more reviews with text and stable IDs, select the report language and explicitly enable AI after reviewing costs. For the default sample the report will cite excerpts from that sample rather than claiming it came from a real customer. Existing datasets must be accessible to the authenticated Apify account.

# Actor input Schema

## `businessName` (type: `string`):

Name to show in the report.

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

One business at a time. Each object has id and text; rating and reviewUrl are optional. Use this or a dataset ID.

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

Existing dataset containing reviews; grants read access to this selected dataset. Leave empty when using the JSON field.

## `previousReviews` (type: `array`):

Optional earlier sample for a cited comparison.

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

Optional earlier dataset; grants read access only to this selected dataset. Do not combine with previous reviews JSON.

## `language` (type: `string`):

Language used by the model and the report.

## `maxReviews` (type: `integer`):

At most 60 current and 60 previous reviews are sent in a single AI request.

## `allowPaidAI` (type: `boolean`):

Off: return a non-AI summary of the supplied reviews, without an AI call or review-report event. On: send sanitized review text to Apify OpenRouter for themes and suggested actions; AI and platform usage may cost extra. Platform usage may also apply to the non-AI mode.

## `maxItems` (type: `integer`):

One report per run.

## Actor input object example

```json
{
  "businessName": "Business",
  "reviews": [
    {
      "id": "sample1",
      "text": "The staff was friendly, but the wait was long.",
      "rating": 3
    }
  ],
  "language": "en",
  "maxReviews": 60,
  "allowPaidAI": false,
  "maxItems": 1
}
```

# Actor output Schema

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

No description

## `report` (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": [
        {
            "id": "sample1",
            "text": "The staff was friendly, but the wait was long.",
            "rating": 3
        }
    ],
    "allowPaidAI": false
};

// Run the Actor and wait for it to finish
const run = await client.actor("danielmichalek/review-insights-analyzer").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": [{
            "id": "sample1",
            "text": "The staff was friendly, but the wait was long.",
            "rating": 3,
        }],
    "allowPaidAI": False,
}

# Run the Actor and wait for it to finish
run = client.actor("danielmichalek/review-insights-analyzer").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": [
    {
      "id": "sample1",
      "text": "The staff was friendly, but the wait was long.",
      "rating": 3
    }
  ],
  "allowPaidAI": false
}' |
apify call danielmichalek/review-insights-analyzer --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,danielmichalek/review-insights-analyzer"
        }
    }
}
```

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/hyzo5wBhfxeAlKrUQ/builds/Tn1JbhBFiZhnknsFm/openapi.json
