# Social Media Sentiment Analyzer (`khadinakbar/social-media-sentiment-analyzer`) Actor

Analyze social media sentiment for any keyword, hashtag, or brand across Reddit, YouTube, X/Twitter, and Instagram. Returns per-post sentiment, emotion, aspect breakdown, language, and toxicity, plus an AI brand-health report with top praise, complaints, and crisis signals.

- **URL**: https://apify.com/khadinakbar/social-media-sentiment-analyzer.md
- **Developed by:** [Khadin Akbar](https://apify.com/khadinakbar) (community)
- **Categories:** Social media, AI, MCP servers
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 post analyzeds

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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## Social Media Sentiment Analyzer — AI Emotion, Aspects & Brand Health

Analyze **social media sentiment** for any keyword, hashtag, or brand across **Reddit, YouTube, X/Twitter, and Instagram** in one run. Give it a search term — it pulls fresh public posts and comments, scores each with AI (sentiment, emotion, aspect-based breakdown, language, optional toxicity), and produces an aggregate **brand-health report** (0–100 score, top praise, top complaints, crisis signals, recommendations).

Unlike comment scrapers that just bolt "sentiment" onto the title, this actor does real per-post analysis **and** an LLM-written intelligence report — and it stays reliable by orchestrating dedicated, battle-tested scrapers under the hood instead of fighting anti-bot itself.

### When to use it

- **Social listening & brand monitoring** — what are people saying about your product, campaign, or competitor right now?
- **Launch / campaign tracking** — measure reception across platforms in one pass.
- **Market & audience research** — themes, emotions, and aspects behind the numbers.
- **Community & brand safety** — optional toxicity scoring per post.
- **AI agents (MCP)** — a single tool call: keyword in, structured sentiment + report out.

**Not for:** scraping one specific profile's full post history (use the platform-specific scrapers), or monitoring brand perception inside AI assistants like ChatGPT/Gemini (use AI Search Brand Monitor).

### What you get

The dataset's **first record is the aggregate report**, followed by one record per analyzed post.

#### Brand-health report (record 1)

| Field | Description |
|---|---|
| `brandHealthScore` | 0–100 overall sentiment health (100 = overwhelmingly positive) |
| `headline` | One-line summary of overall sentiment |
| `summary` | 3–5 sentence narrative for a quick skim |
| `sentimentBreakdown` | positive / neutral / negative / mixed counts + percentages |
| `emotionDistribution` | Emotion tallies (joy, anger, fear, sadness, surprise, disgust, trust, anticipation) |
| `topPraise` / `topComplaints` | Up to 5 themes each, with frequency + an example quote |
| `crisisSignals` | Reputational risks (boycotts, lawsuits, viral negativity, safety) with severity |
| `recommendations` | Actionable next steps |
| `platformCounts` | Posts analyzed per platform |

#### Per-post records

| Field | Description |
|---|---|
| `platform` | reddit / youtube / twitter / instagram |
| `text`, `author`, `title`, `sourceUrl`, `publishedAt` | The post and its metadata |
| `engagement` | likes / comments / shares / score (per platform) |
| `sentiment`, `sentimentScore`, `confidence` | Label, −1…+1 score, 0–1 confidence |
| `emotions` | Detected emotions (AI engine) |
| `aspects` | Aspect-based sentiment — which specific topics are positive/negative (AI engine) |
| `language` | Detected ISO 639-1 language (AI engine) |
| `toxicity` | 0–1 toxicity score (AI engine, when enabled) |

### Pricing (Pay-Per-Event)

| Event | Price |
|---|---|
| Actor start | $0.002 |
| Post analyzed | $0.003 each |
| AI brand-health report | $0.10 per run |

A typical run of 100 posts with a report costs about **$0.40** in this actor's charges.

> **Heads-up on scraping costs:** this actor calls dedicated scrapers (Reddit, YouTube, X, Instagram) to fetch the posts. Those scrapers have their own per-result fees billed separately to your account. The cost cap and logs in this actor cover only its own analysis charges — set `maxItems` to bound volume on both sides.

### Platforms & credentials

| Platform | Works out of the box | Needs |
|---|---|---|
| **Reddit** | ✅ Yes | — |
| **YouTube** | ✅ Yes | — (searches videos → analyzes their comments) |
| **X / Twitter** | ⚠️ Opt-in | `xAuthToken` + `xCt0` cookies from your logged-in x.com session |
| **Instagram** | ⚠️ Opt-in | `instagramSessionCookies` from your logged-in instagram.com session |

Selected platforms without credentials are skipped with a warning — the run still succeeds on the rest.

### Sentiment engine

- **AI (default)** — an LLM (Claude Haiku or GPT-4o-mini) scores each post with sentiment, emotion, aspects, language, and optional toxicity. Multilingual. Uses the actor's managed key, or bring your own (`llmApiKey`) for Anthropic or OpenAI.
- **Lexicon** — a fast offline word-list scorer (polarity only, English). Set `engine: "lexicon"` for cheap, high-volume runs or when you don't want an LLM in the loop.

If the AI engine is selected but no key is available, the actor automatically falls back to lexicon with a warning — runs never hard-fail over a missing key.

### Example input

```json
{
  "query": "ChatGPT",
  "platforms": ["reddit", "youtube"],
  "maxItems": 100,
  "timeRange": "7d",
  "engine": "llm",
  "includeToxicity": false,
  "includeReport": true,
  "responseFormat": "detailed"
}
````

#### Run via API (JavaScript)

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

const client = new ApifyClient({ token: 'YOUR_TOKEN' });
const run = await client.actor('khadinakbar/social-media-sentiment-analyzer').call({
  query: 'Tesla',
  platforms: ['reddit', 'youtube'],
  maxItems: 150,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items[0]); // the brand-health report
```

#### Run via API (Python)

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_TOKEN")
run = client.actor("khadinakbar/social-media-sentiment-analyzer").call(run_input={
    "query": "Tesla",
    "platforms": ["reddit", "youtube"],
    "maxItems": 150,
})
items = client.dataset(run["defaultDatasetId"]).list_items().items
print(items[0])  ## the brand-health report
```

### Use with AI agents (MCP)

This actor is MCP-ready. Exposed through the Apify MCP server, an AI agent can call it with a single `query` and receive a structured report plus per-post sentiment — ideal for "what's the sentiment around X right now?" questions. The first dataset record is the report; sample a few post records for detail.

### How it works

The actor is an **orchestrator**: it calls dedicated, maintained scrapers for each platform in parallel, normalizes their output into a common shape, runs the sentiment engine in batches, and synthesizes the report. This keeps reliability high (each scraper owns its own anti-bot handling) and lets the actor focus on analysis.

Part of a brand-intelligence cluster:

- **Brand Sentiment Analyzer** — mention monitoring across Reddit, Google News, and Trustpilot reviews.
- **AI Search Brand Monitor** — how AI assistants (ChatGPT, Gemini, Claude) describe your brand.
- Underlying scrapers: Reddit Posts & Comments, YouTube Search, YouTube Comments, X/Twitter, Instagram Hashtag.

### FAQ

**Do I need an OpenAI/Anthropic key?** No — the AI engine uses a managed Anthropic key by default. Provide `llmApiKey` only if you want to use your own quota or OpenAI.

**Why are X and Instagram opt-in?** Both require a logged-in session cookie to read public content reliably. Paste your cookies into the encrypted credential fields to enable them.

**How do I bound cost?** Set `maxItems` (caps analyzed posts and roughly the scraping volume) and optionally `maxCostUsd` (hard cap on this actor's own charges).

**Does it support non-English content?** Yes, with the AI engine — it detects language per post and scores multilingual text. The lexicon engine is English-only.

**What if a platform returns nothing?** The run still succeeds; the platform shows 0 in `platformCounts` and a note is added to `warnings`.

### Legal & responsible use

This actor analyzes **publicly available** social media content for research, monitoring, and analytics. You are responsible for complying with each platform's Terms of Service and applicable laws (including data-protection regulations such as GDPR/CCPA) when using the data. Provide only credentials you are authorized to use. Do not use this actor to harass, profile, or target individuals. Sentiment and toxicity scores are automated estimates and may be imperfect — treat them as signals, not ground truth.

# Actor input Schema

## `query` (type: `string`):

The keyword, hashtag, brand, or topic to analyze across the selected platforms. Used as the search term for each source (e.g. 'Tesla', 'climate change', '#AI'). Defaults to 'ChatGPT'. NOT a profile or post URL — this is a search term, and the actor finds matching public posts and comments itself.

## `platforms` (type: `array`):

Which social platforms to pull public posts and comments from. Reddit and YouTube work with no credentials. X/Twitter needs X auth cookies and Instagram needs Instagram session cookies (see Platform credentials) — if selected without credentials they are skipped with a warning. Defaults to Reddit + YouTube.

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

Hard cap on how many posts/comments to analyze across all platforms combined; the budget is split evenly across selected platforms. Default 100, range 10-1000. Each analyzed post costs $0.003, so this directly bounds this actor's per-post charges. The underlying scrapers' own charges are billed separately.

## `timeRange` (type: `string`):

How far back to look for posts, where the platform supports it. '24h' for breaking/crisis monitoring, '7d' for launch tracking, '30d' for steady-state, 'all' for no limit. Default '7d'. Some sources (e.g. Instagram hashtag) ignore this and always return the most recent posts.

## `engine` (type: `string`):

'llm' (default) uses an AI model (Claude Haiku or GPT-4o-mini) via the actor's managed key for rich per-post sentiment, emotion, aspect-based breakdown, language detection, and optional toxicity — best quality and multilingual. 'lexicon' uses a fast offline word-list scorer returning polarity only — cheaper and English-only. If 'llm' is selected but no API key is available, the actor falls back to 'lexicon' with a warning.

## `llmProvider` (type: `string`):

Preferred LLM provider when engine is 'llm'. The actor uses its managed key automatically (Claude Haiku if an Anthropic key is configured, otherwise GPT-4o-mini). Provide your own key in the LLM API key field to use your quota for either provider. Ignored when engine is 'lexicon'.

## `llmApiKey` (type: `string`):

Bring your own API key for the selected provider to use your own quota instead of the managed key. For Anthropic use a key starting 'sk-ant-', for OpenAI a key starting 'sk-'. Leave blank to use the actor's managed Anthropic key (Anthropic only). Stored encrypted and never logged.

## `includeToxicity` (type: `boolean`):

When enabled, the AI engine also returns a 0-1 toxicity score per post (hate, harassment, threats, profanity). Useful for community moderation and brand-safety screening. Adds reasoning per post but no extra per-post fee. Only applies when engine is 'llm'; ignored for lexicon.

## `includeReport` (type: `boolean`):

If true (default), after scoring individual posts the AI produces one aggregate brand-health report: overall score (0-100), sentiment split, emotion distribution, top praise themes, top complaints, crisis signals, and recommendations. Adds a $0.10 report fee. Set false to get per-post sentiment only.

## `responseFormat` (type: `string`):

'concise' returns short text + sentiment label + score per post (~90 tokens/item — best for AI agents). 'detailed' returns full text, author, engagement, URL, emotions, aspects, language, and toxicity (~280 tokens/item — best for dashboards). Default 'detailed'. Does not affect the aggregate report.

## `xAuthToken` (type: `string`):

Your x.com 'auth\_token' cookie, required only if 'twitter' is selected. Get it from your browser: F12 → Application → Cookies → x.com → auth\_token. Keep it secret — it grants account access. Leave blank to skip X/Twitter.

## `xCt0` (type: `string`):

Your x.com 'ct0' CSRF cookie, from the same browser session as auth\_token. Get it via F12 → Application → Cookies → x.com → ct0. Required together with auth\_token when 'twitter' is selected. Leave blank to skip X/Twitter.

## `instagramSessionCookies` (type: `string`):

Your instagram.com cookie string, required only if 'instagram' is selected. Get it via F12 → Application → Cookies → instagram.com (the 'sessionid' and 'csrftoken' values matter most). Without it Instagram returns a login wall and is skipped. Leave blank to skip Instagram.

## `maxCostUsd` (type: `number`):

Hard cap on THIS actor's own PPE charges (start + per-post + report) per run; it stops gracefully when reached. Does NOT include the underlying scrapers' own charges, which are billed separately. Leave at 0 for no cap. Accepts decimals, e.g. 0.5 stops this actor after $0.50 of its own charges.

## Actor input object example

```json
{
  "query": "ChatGPT",
  "platforms": [
    "reddit",
    "youtube"
  ],
  "maxItems": 100,
  "timeRange": "7d",
  "engine": "llm",
  "llmProvider": "anthropic",
  "includeToxicity": false,
  "includeReport": true,
  "responseFormat": "detailed",
  "maxCostUsd": 0
}
```

# Actor output Schema

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

The standalone aggregate report saved as a JSON file in the key-value store. Open the run's key-value store and look for the 'report-<query>-<timestamp>' file.

## `posts` (type: `string`):

The full dataset: first record is the aggregate report (recordType=report), followed by individual analyzed posts/comments (recordType=post). Download as JSON, CSV, HTML, or Excel.

## `consoleRun` (type: `string`):

Apify Console run page with logs, stats, and timeline.

# 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 = {
    "query": "ChatGPT",
    "platforms": [
        "reddit",
        "youtube"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("khadinakbar/social-media-sentiment-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 = {
    "query": "ChatGPT",
    "platforms": [
        "reddit",
        "youtube",
    ],
}

# Run the Actor and wait for it to finish
run = client.actor("khadinakbar/social-media-sentiment-analyzer").call(run_input=run_input)

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

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

```

## CLI example

```bash
echo '{
  "query": "ChatGPT",
  "platforms": [
    "reddit",
    "youtube"
  ]
}' |
apify call khadinakbar/social-media-sentiment-analyzer --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=khadinakbar/social-media-sentiment-analyzer",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Social Media Sentiment Analyzer",
        "description": "Analyze social media sentiment for any keyword, hashtag, or brand across Reddit, YouTube, X/Twitter, and Instagram. Returns per-post sentiment, emotion, aspect breakdown, language, and toxicity, plus an AI brand-health report with top praise, complaints, and crisis signals.",
        "version": "1.0",
        "x-build-id": "DSjsOAT1Pfnkq3wwk"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/khadinakbar~social-media-sentiment-analyzer/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-khadinakbar-social-media-sentiment-analyzer",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/khadinakbar~social-media-sentiment-analyzer/runs": {
            "post": {
                "operationId": "runs-sync-khadinakbar-social-media-sentiment-analyzer",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/khadinakbar~social-media-sentiment-analyzer/run-sync": {
            "post": {
                "operationId": "run-sync-khadinakbar-social-media-sentiment-analyzer",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "query"
                ],
                "properties": {
                    "query": {
                        "title": "Search query, hashtag, or brand",
                        "type": "string",
                        "description": "The keyword, hashtag, brand, or topic to analyze across the selected platforms. Used as the search term for each source (e.g. 'Tesla', 'climate change', '#AI'). Defaults to 'ChatGPT'. NOT a profile or post URL — this is a search term, and the actor finds matching public posts and comments itself.",
                        "default": "ChatGPT"
                    },
                    "platforms": {
                        "title": "Platforms to analyze",
                        "type": "array",
                        "description": "Which social platforms to pull public posts and comments from. Reddit and YouTube work with no credentials. X/Twitter needs X auth cookies and Instagram needs Instagram session cookies (see Platform credentials) — if selected without credentials they are skipped with a warning. Defaults to Reddit + YouTube.",
                        "items": {
                            "type": "string",
                            "enum": [
                                "reddit",
                                "youtube",
                                "twitter",
                                "instagram"
                            ],
                            "enumTitles": [
                                "Reddit (no login)",
                                "YouTube comments (no login)",
                                "X / Twitter (needs cookies)",
                                "Instagram hashtag (needs cookies)"
                            ]
                        },
                        "default": [
                            "reddit",
                            "youtube"
                        ]
                    },
                    "maxItems": {
                        "title": "Max posts to analyze (total)",
                        "minimum": 10,
                        "maximum": 1000,
                        "type": "integer",
                        "description": "Hard cap on how many posts/comments to analyze across all platforms combined; the budget is split evenly across selected platforms. Default 100, range 10-1000. Each analyzed post costs $0.003, so this directly bounds this actor's per-post charges. The underlying scrapers' own charges are billed separately.",
                        "default": 100
                    },
                    "timeRange": {
                        "title": "Time window",
                        "enum": [
                            "24h",
                            "7d",
                            "30d",
                            "all"
                        ],
                        "type": "string",
                        "description": "How far back to look for posts, where the platform supports it. '24h' for breaking/crisis monitoring, '7d' for launch tracking, '30d' for steady-state, 'all' for no limit. Default '7d'. Some sources (e.g. Instagram hashtag) ignore this and always return the most recent posts.",
                        "default": "7d"
                    },
                    "engine": {
                        "title": "Sentiment engine",
                        "enum": [
                            "llm",
                            "lexicon"
                        ],
                        "type": "string",
                        "description": "'llm' (default) uses an AI model (Claude Haiku or GPT-4o-mini) via the actor's managed key for rich per-post sentiment, emotion, aspect-based breakdown, language detection, and optional toxicity — best quality and multilingual. 'lexicon' uses a fast offline word-list scorer returning polarity only — cheaper and English-only. If 'llm' is selected but no API key is available, the actor falls back to 'lexicon' with a warning.",
                        "default": "llm"
                    },
                    "llmProvider": {
                        "title": "LLM provider",
                        "enum": [
                            "anthropic",
                            "openai"
                        ],
                        "type": "string",
                        "description": "Preferred LLM provider when engine is 'llm'. The actor uses its managed key automatically (Claude Haiku if an Anthropic key is configured, otherwise GPT-4o-mini). Provide your own key in the LLM API key field to use your quota for either provider. Ignored when engine is 'lexicon'.",
                        "default": "anthropic"
                    },
                    "llmApiKey": {
                        "title": "LLM API key (optional, BYOK)",
                        "type": "string",
                        "description": "Bring your own API key for the selected provider to use your own quota instead of the managed key. For Anthropic use a key starting 'sk-ant-', for OpenAI a key starting 'sk-'. Leave blank to use the actor's managed Anthropic key (Anthropic only). Stored encrypted and never logged."
                    },
                    "includeToxicity": {
                        "title": "Score toxicity",
                        "type": "boolean",
                        "description": "When enabled, the AI engine also returns a 0-1 toxicity score per post (hate, harassment, threats, profanity). Useful for community moderation and brand-safety screening. Adds reasoning per post but no extra per-post fee. Only applies when engine is 'llm'; ignored for lexicon.",
                        "default": false
                    },
                    "includeReport": {
                        "title": "Generate AI brand-health report",
                        "type": "boolean",
                        "description": "If true (default), after scoring individual posts the AI produces one aggregate brand-health report: overall score (0-100), sentiment split, emotion distribution, top praise themes, top complaints, crisis signals, and recommendations. Adds a $0.10 report fee. Set false to get per-post sentiment only.",
                        "default": true
                    },
                    "responseFormat": {
                        "title": "Per-post detail level",
                        "enum": [
                            "concise",
                            "detailed"
                        ],
                        "type": "string",
                        "description": "'concise' returns short text + sentiment label + score per post (~90 tokens/item — best for AI agents). 'detailed' returns full text, author, engagement, URL, emotions, aspects, language, and toxicity (~280 tokens/item — best for dashboards). Default 'detailed'. Does not affect the aggregate report.",
                        "default": "detailed"
                    },
                    "xAuthToken": {
                        "title": "X (Twitter) auth_token cookie",
                        "type": "string",
                        "description": "Your x.com 'auth_token' cookie, required only if 'twitter' is selected. Get it from your browser: F12 → Application → Cookies → x.com → auth_token. Keep it secret — it grants account access. Leave blank to skip X/Twitter."
                    },
                    "xCt0": {
                        "title": "X (Twitter) ct0 cookie",
                        "type": "string",
                        "description": "Your x.com 'ct0' CSRF cookie, from the same browser session as auth_token. Get it via F12 → Application → Cookies → x.com → ct0. Required together with auth_token when 'twitter' is selected. Leave blank to skip X/Twitter."
                    },
                    "instagramSessionCookies": {
                        "title": "Instagram session cookies",
                        "type": "string",
                        "description": "Your instagram.com cookie string, required only if 'instagram' is selected. Get it via F12 → Application → Cookies → instagram.com (the 'sessionid' and 'csrftoken' values matter most). Without it Instagram returns a login wall and is skipped. Leave blank to skip Instagram."
                    },
                    "maxCostUsd": {
                        "title": "Max cost ceiling (USD)",
                        "minimum": 0,
                        "type": "number",
                        "description": "Hard cap on THIS actor's own PPE charges (start + per-post + report) per run; it stops gracefully when reached. Does NOT include the underlying scrapers' own charges, which are billed separately. Leave at 0 for no cap. Accepts decimals, e.g. 0.5 stops this actor after $0.50 of its own charges.",
                        "default": 0
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
