# Instagram, TikTok & YouTube Comment Sentiment Analyzer (`al_anany/social-comment-insights`) Actor

Paste Instagram, TikTok, YouTube or Facebook post URLs and get an AI comment insights report: sentiment, top themes with real quotes, unanswered questions, purchase intent and complaints. Built for brands, agencies and AI agents.

- **URL**: https://apify.com/al_anany/social-comment-insights.md
- **Developed by:** [AL Anany](https://apify.com/al_anany) (community)
- **Categories:** AI, Social media
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.50 / 1,000 comment analyzeds

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

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Instagram, TikTok & YouTube Comment Sentiment Analyzer

Paste social post URLs and get a comment insights report: sentiment, top themes, unanswered questions, purchase intent and complaints. No scraping setup, no prompts.

Social Comment Insights reads the comments under public Instagram, TikTok, YouTube and Facebook posts, analyzes every comment with AI, and turns thousands of rows into one short report you can act on. It works for one post or for up to 20 posts compared side by side.

### What you get

For **each post**, plus one **overall summary** across all posts:

- **Sentiment split**: positive, neutral and negative shares, plus a like-weighted version, since comments with many likes matter more.
- **Top themes**: up to 6 topics people talk about, each with its sentiment, its share of comments and up to 3 short verbatim example quotes. Quotes never include usernames.
- **Unanswered questions**: questions nobody replied to, de-duplicated and ready for your community manager.
- **Purchase signals**: what people want to buy, or what is stopping them.
- **Top complaints**: the problems people mention most.
- **Spam share** and label shares (questions, praise, feature requests, off-topic).
- **3 recommended actions** and a 3–5 sentence **summary** in your language.
- **Post comparison** (2+ posts): which post landed best and why.
- An explicit **status** for every post (`ok`, `no_results`, `partial`, `blocked`, `failed`, `invalid_url`) with a plain-English reason. You never get an unexplained empty result.

Every percentage is **counted in code**, not estimated by the AI.

#### Example output (`OUTPUT` record, trimmed)

Real output from a run on 4 public posts (20 comments each), trimmed for length:

```json
{
  "overall_summary": {
    "type": "overall_summary",
    "status": "partial",
    "status_reason": "4 of 5 posts were fully analyzed; see each post item for details.",
    "comments_analyzed": 57,
    "sentiment": {
      "positive": 0.5,
      "neutral": 0.48,
      "negative": 0.02
    },
    "sentiment_like_weighted": {
      "positive": 0.3,
      "neutral": 0.66,
      "negative": 0.03
    },
    "summary": "The Facebook post landed best, with 90% positive comments and 69.2% like-weighted positivity, driven by its inspirational story about gardens and children. …",
    "post_comparison": [
      {
        "platform": "facebook",
        "rank": 1,
        "verdict": "Facebook post landed best, with overwhelmingly positive and like-weighted reactions praising its story and themes."
      },
      {
        "platform": "youtube",
        "rank": 2,
        "verdict": "YouTube post drew substantive engagement with no negatives, though it mainly generated questions and feature requests."
      },
      "…"
    ]
  },
  "posts": [
    {
      "type": "post_report",
      "status": "ok",
      "platform": "facebook",
      "post_url": "https://www.facebook.com/humansofnewyork/posts/pfbid0BbKbkisExKGSKuhee9a7i86RwRuMKFC8NSkKStB7CsM3uXJuAAfZLrkcJMXxhH4Yl",
      "comments_analyzed": 20,
      "sentiment": {
        "positive": 0.9,
        "neutral": 0.1,
        "negative": 0
      },
      "labels": {
        "question": 0.05,
        "purchase_intent": 0,
        "complaint": 0,
        "praise": 0.9,
        "feature_request": 0,
        "spam": 0,
        "off_topic": 0
      },
      "top_themes": [
        {
          "theme": "Gardens nourish healthy children",
          "sentiment": "positive",
          "share_estimate": 0.15,
          "example_quotes": [
            "\"But the plants are just a byproduct. We’re trying to grow healthy children.\" The garden isn't the herbs and vegetables they are growing, it's the…"
          ]
        },
        {
          "theme": "Small actions create big change",
          "sentiment": "positive",
          "share_estimate": 0.15,
          "example_quotes": [
            "So amazing how one small thing can have such a huge impact on so many! Just like the literal seeds were being planted in the…"
          ]
        },
        "…"
      ],
      "unanswered_questions": [],
      "recommended_actions": [
        "Pin a reply to the most liked comment that links to a practical way for followers to start a school or neighborhood garden.",
        "…"
      ],
      "summary": "Reactions are overwhelmingly positive: 90% of comments are positive, 10% neutral and none negative, and like-weighted positivity is 69.2%. …"
    },
    "… one item per post"
  ]
}
```

You also get a readable **REPORT.md** and a dataset with one row per post plus one overall row, which you can export to CSV, Excel or JSON.

### Who it's for

- **Brand and social media managers**: see how people reacted to a launch, campaign or influencer post in minutes.
- **Agencies**: produce client-ready comment reports across platforms without manual reading.
- **E-commerce founders**: find buyers, objections and complaints hidden in your comments.
- **AI agents**: Claude, ChatGPT, Cursor and other agents can call this Actor through the Apify MCP server and get a compact, stable JSON answer.

### Pricing

You pay per event (pay-per-event):

| What | Price |
|---|---|
| Run start | $0.10 per run |
| Comment analyzed | $0.0025 per comment |

**Scraping is billed separately, by the scraper.** This Actor uses Apify's comment scrapers to fetch the comments. They run in **your** Apify account and bill you at their own price, on top of the analysis price:

| Platform | Scraper | Price per comment (Free plan → higher plans) |
|---|---|---|
| Instagram | Instagram Comment Scraper | $0.0026 → $0.0014 |
| TikTok | TikTok Comments Scraper | $0.00125 → $0.00015 |
| YouTube | YouTube Comments Scraper | $0.002 → $0.0003 |
| Facebook | Facebook Comments Scraper | $0.0025 → $0.0004 |

**Worked examples (Free plan):**

- **1 post × 300 comments** ≈ $0.10 start + **$0.75 analysis** + **about $0.38 (TikTok) to $0.78 (Instagram) scraping** ≈ **$1.23–1.63**
- **3 posts × 300 comments** ≈ $0.10 + **$2.25 analysis** + **about $1.13–2.34 scraping** ≈ **$3.48–4.69**

You're never charged for comments that weren't analyzed: failed batches, merged duplicate comments and invalid URLs are free.

**Your maximum cost per run covers everything: scraping and analysis.** If you set a maximum cost per run, the Actor plans the scraping at the Free-plan scraper price, plus a 10% margin, so both fit inside it. If the limit is too low for the comments you asked for, it fetches fewer comments per post and says so in the report. After scraping, it subtracts what the scrapers actually billed and analyzes only as many comments as the rest of the budget allows. Example: with a **$1.00** maximum on one TikTok post, you get about 255 comments: about $0.32 scraping + $0.64 analysis. (The $0.10 start fee comes off the same limit, so the real number is a little lower.)

### How to use

1. **Paste post URLs** into **Post URLs** (`postUrls`), up to 20. Public posts, reels and videos from Instagram, TikTok, YouTube (videos and Shorts) and Facebook all work. Mobile links, short links and links with tracking parameters are fine.
2. **Choose the depth** with **Max comments per post** (`maxCommentsPerPost`, 10–5,000, default 300). More comments means a more reliable picture and a proportionally higher cost.
3. **Optional:** add **Brand context** (`brandContext`), e.g. *"We are Acme, a vegan protein brand. This post launched our new chocolate flavor."* It makes themes and actions more relevant. Pick a **Report language** (`outputLanguage`: en, de, fr, es, it, pt, nl) and choose whether to **Include example quotes** (`includeExampleQuotes`).

Then click **Start**. Open the **Output** tab for the JSON report, the Markdown report and the per-post table.

### Use with AI agents (MCP)

Connect Claude, ChatGPT, Cursor or any MCP client to the [Apify MCP server](https://mcp.apify.com) with this Actor as a tool, e.g. `https://mcp.apify.com?tools=al_anany/social-comment-insights`. It needs one required input (`postUrls`) and the options are enums. A run takes 1–3 minutes, so the agent polls the run and then reads the dataset items, or the `OUTPUT` record for the whole report as one JSON object. Example prompt:

> Use Social Comment Insights to analyze reactions to these 3 posts and tell me what people complain about and which questions we haven't answered: https://www.instagram.com/p/…, https://www.tiktok.com/@…/video/…, https://www.youtube.com/watch?v=…

### FAQ

**Which URLs are supported?**
Instagram posts and reels (`/p/`, `/reel/`, `/tv/`), TikTok videos (including `vm.tiktok.com` short links), YouTube videos, Shorts and live replays (including `youtu.be`), and Facebook posts, videos, reels, photos and share links. Profiles, hashtags, playlists and stories aren't supported. Those URLs are reported as `invalid_url` and not charged.

**Which languages?**
Comments can be in any language. The report is written in English, German, French, Spanish, Italian, Portuguese or Dutch.

**Can it analyze private posts?**
No. Only public posts can be read. Private, age-restricted or login-only posts come back with status `blocked` and a reason.

**What happens to commenters' data?**
Usernames, profile links and avatars are dropped as soon as the comments are fetched. They are never sent to the AI model and never returned. @mentions inside comments are replaced with `@user`. Quotes are short (max 25 words) and anonymized.

**How accurate is it?**
Each comment is classified individually by an AI model (Claude Haiku 5.5) and all shares are counted in code from those labels. Sentiment on short, sarcastic or emoji-only comments is harder, so treat small differences (a few percent) as noise. In our repeat test on the same 50 comments, the counts matched exactly and sentiment shares moved by at most 4 points between runs. Like-weighted sentiment moves more on small samples, because one very popular comment can tip it. Use 300+ comments when that number matters. Theme shares are estimates based on how the AI groups comment topics. The `model` field in the output records which model was used.

**Does the maximum cost per run include the scraping?**
Yes. The limit you set covers this Actor's charges **and** the scraper runs it starts in your account. The scraping is budgeted first, at the Free-plan price, and the analysis then uses only what is left. If the limit is too low to scrape and analyze even one comment per post, the run fails right away with a clear message. One exception: YouTube's scraper requires a sub-run limit of at least $0.50. Its actual bill still follows the number of comments requested ($0.002 each on the Free plan), and the Actor deducts the real amount before analyzing.

**Will I get the same comments if I run the same post twice?**
Not always. Platforms can return a different set of comments on each run, especially on viral posts where the comment order keeps changing. In one test, two runs on the same TikTok post 10 minutes apart shared only 14 of 86 comments. Results reflect the sample fetched at that moment. For stable numbers, use 300+ comments.

**On YouTube, do replies count toward the comment limit?**
Yes. YouTube's scraper returns replies together with top-level comments and counts them toward **Max comments per post** (and bills them). On a video with long reply threads, a good share of the comments analyzed can be replies. The Actor analyzes viewer replies and skips the channel owner's.

**What does "not enough remaining credit" mean?**
The comment scrapers run in your Apify account, so they need remaining credit (usage) in it. If your account's remaining usage for the billing cycle is too low, Apify won't start the scraper. The post then comes back with status `failed` and the message "Your Apify account doesn't have enough remaining credit to run the … comment scraper." YouTube's scraper needs at least $0.50 of remaining credit to start, even for a few comments. Add credit or raise your usage limit in Apify Console under Billing, then run again. Nothing is charged for those posts.

**What if a post has no comments, or the scraper gets blocked?**
You get an item with `status: "no_results"` (the post really has no public comments) or `blocked` / `failed`, with the reason and the scraper run ID. If every post fails, the run is marked as failed, so integrations and agents can tell.

### Limitations

- Only **public** posts, max **20 URLs** and **5,000 comments per post** per run.
- **Instagram, TikTok and Facebook: top-level comments only.** Reply counts are used to tell which questions are still unanswered.
- **YouTube: viewer replies are analyzed too.** YouTube's scraper always returns replies along with comments, bills them, and counts them toward the comment limit, so on posts with long reply threads a good share of the analyzed comments are replies. The channel owner's own replies are skipped.
- Comment fetching depends on the platforms. They sometimes rate-limit or block scrapers, and when they do you get a `partial` or `blocked` status for that post, never silent gaps.
- YouTube doesn't expose exact comment dates through the scraper, so `created_at` isn't used for YouTube.
- Sentiment shares exclude comments labeled spam. Spam is reported separately as `spam_share`.
- Theme shares and AI-written text (summaries, actions) are estimates. Counts and percentages are exact for the analyzed sample.
- Scraping costs are billed by the scraper Actors in your account, in addition to this Actor's price. Your maximum cost per run covers both (see Pricing).
- Platforms can serve a different set of comments on each run, so two runs on the same post can differ.

# Actor input Schema

## `postUrls` (type: `array`):

Public post, reel or video URLs from Instagram, TikTok, YouTube (videos and Shorts) and Facebook. Up to 20 per run. Examples: instagram.com/p/…, instagram.com/reel/…, tiktok.com/@user/video/…, youtube.com/watch?v=…, youtube.com/shorts/…, facebook.com/…/posts/…. Duplicates are removed; unsupported URLs are reported as "invalid_url" and not charged.

## `maxCommentsPerPost` (type: `integer`):

How many comments to fetch and analyze per post (10-5,000). Each analyzed comment is one $0.0025 charge, and the scraper bills about $0.00125-0.0026 per fetched comment to your account. 300 comments on one post cost about $0.75 for analysis plus $0.38-0.78 for scraping. Your run's maximum charge covers both: if it is lower, fewer comments are fetched.

## `brandContext` (type: `string`):

One or two sentences about you and the post. Makes themes, purchase signals and recommended actions more relevant. Example: "We are Acme, a vegan protein brand. This post launched our new chocolate flavor."

## `outputLanguage` (type: `string`):

Language of the report (summary, themes, questions, actions). Comments can be in any language.

## `includeExampleQuotes` (type: `boolean`):

Add up to 3 short, verbatim example quotes (max 25 words, no usernames, @handles removed) to each theme.

## Actor input object example

```json
{
  "postUrls": [
    "https://www.tiktok.com/@looooooooch/video/7332342275151760642"
  ],
  "maxCommentsPerPost": 20,
  "outputLanguage": "en",
  "includeExampleQuotes": true
}
```

# Actor output Schema

## `output` (type: `string`):

Compact JSON report {overall_summary, posts\[]}. Read this record when calling the Actor from an AI agent.

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

Human-readable Markdown version of the same report.

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

Dataset: one item per post plus one overall_summary item.

# 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 = {
    "postUrls": [
        "https://www.tiktok.com/@looooooooch/video/7332342275151760642"
    ],
    "maxCommentsPerPost": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("al_anany/social-comment-insights").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 = {
    "postUrls": ["https://www.tiktok.com/@looooooooch/video/7332342275151760642"],
    "maxCommentsPerPost": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("al_anany/social-comment-insights").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 '{
  "postUrls": [
    "https://www.tiktok.com/@looooooooch/video/7332342275151760642"
  ],
  "maxCommentsPerPost": 20
}' |
apify call al_anany/social-comment-insights --silent --output-dataset

```

## MCP server setup

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

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/ZJGGcWSjPRX498SRp/builds/2lKj3fp8TyXDyHjzv/openapi.json
