# Social Comment Classifier — buying intent & questions · $0.5/1k (`leoworks/social-comment-classifier`) Actor

Classify Instagram, TikTok, Facebook, YouTube comments: buying intent, sentiment — Instagram comments sentiment and TikTok comments analyzer. Use for comments; for reviews use leoworks/korean-review-classifier. datasetId (text auto-detected) or texts. ~100 comments/4 s, pay per comment.

- **URL**: https://apify.com/leoworks/social-comment-classifier.md
- **Developed by:** [Leoworks](https://apify.com/leoworks) (community)
- **Categories:** AI, Social media, Agents
- **Features:** Limited permissions
- **Stats:** 3 total users, 2 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $0.43 / 1,000 comment classifications

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

## Social Comment Classifier — purchase intent, questions & sentiment

**Part of LeoWorks review analysis tools** (same labels, any language): [Korean](https://apify.com/leoworks/korean-review-classifier) · [Japanese](https://apify.com/leoworks/japanese-review-classifier) · [Spanish](https://apify.com/leoworks/spanish-review-classifier) · [Amazon](https://apify.com/leoworks/amazon-review-classifier) · [AliExpress](https://apify.com/leoworks/aliexpress-reviews-classifier) · [Google Maps](https://apify.com/leoworks/google-maps-review-classifier) · [social comments](https://apify.com/leoworks/social-comment-classifier).

**For brands, social media managers, agencies and AI agents that already scrape comments** — from an Instagram, TikTok, Facebook or YouTube comment scraper, any other Apify dataset, or pasted as text — and need an Instagram comments sentiment and TikTok comments analyzer — every comment labelled by what it is, for $0.50 per 1,000 comments, with no prompt writing or LLM key. It is an Instagram comment sentiment analysis and TikTok comment sentiment analysis tool, with YouTube comments analysis too.

- **Comment type** — `purchase_intent` · `question` · `complaint` · `request` · `praise` · `spam` · `other` (one main type, with a probability for every type)
- **Sentiment** — positive / neutral / negative
- **Needs reply** — whether the brand or creator should answer (questions, problems, "how do I buy?")
- **Reply queue** — comments that need an answer (buyers first, then complaints, questions, requests), most-liked first, as a CSV
- **Summary by post** — type mix (also weighted by likes), sentiment, reply-needed count, languages, daily trend and last 7 days vs before, the most-liked buying questions and complaints — as JSON and CSV
- **Your own labels** — up to 10 yes/no criteria in plain language (e.g. "mentions shipping or delivery", "asks about a discount code")
- **No wasted spend** — the post owner's own replies, duplicates, and (optionally) replies, emoji-only or low-like comments are skipped and not charged

**Use it to:** find buyers in your comments ("price?", "link?", "when is the restock?") · answer unanswered questions · catch complaints before they spread · hide spam and fake-shop promotion · collect product requests · Instagram, TikTok and YouTube comment sentiment analysis at scale · compare comment mix across posts or competitors.

### How to use

1. Run a comment scraper for your posts or a competitor's — for example [Instagram Comments Scraper](https://apify.com/apify/instagram-comment-scraper) or [TikTok Comments Scraper](https://apify.com/clockworks/tiktok-comments-scraper) (see **Works with** for 15 more).
2. Open this Actor and pick that run's dataset in **Comments dataset** (or paste comments to try it).
3. Optional: add **Custom labels**; list your own brand accounts in **Exclude accounts**; set **Only comments newer than: 7 days**. Skipped comments are not charged.
4. Click **Start**. 9 comments take about 3 seconds.
5. In **Output**, open **Classified comments**, **Needs a reply** or **Labels with probabilities**, or download `REPLY_QUEUE.csv` and `REPORT_POSTS.csv`. Export the table as CSV, Excel or JSON.

#### Run it automatically after every scrape

In your comment scraper (or its saved task), open **Integrations → Add integration → Apify Actor**, choose this Actor and set its input to:

```json
{ "datasetId": "{{resource.defaultDatasetId}}", "commentsNewerThan": "1 day" }
```

Schedule the scraper daily and you get a fresh reply queue every morning. Add a Slack or email integration on this Actor to be told when it finishes.

### Output sample

Real rows from run `tphg77KXmZ9fMS6Pg` (2026-10-11, build 0.2.2; same labels as the first run `PgvMClRhIRV9gKmp7` on 2026-10-09): public comments from the four comment scrapers below, with one custom label ("mentions shipping or delivery").

| comment | source | type (probability) | sentiment | needs reply | custom: shipping |
|---|---|---|---|---|---|
| When will you restock Generation G Fuzz? | Instagram | **purchase_intent** (1.00) | neutral | yes | no |
| Link | Facebook (live shopping) | **purchase_intent** (0.50) | neutral | no | no |
| How much do they hold? | Instagram | **question** (1.00) | neutral | yes | no |
| Temu, you guys are up over here making tiktoks. When im still am waiting for my package… | TikTok | **complaint** (1.00) | negative | yes | **yes** |
| I would like a refund for the 2 weeks the towers were down in my area. | Facebook | **complaint** (0.94) | negative | yes | no |
| can y'all make the resurfacing retinol serum in a bigger bottle ? | TikTok | **request** (1.00) | neutral | yes | no |
| obsessed with every single one of these! | Instagram | **praise** (1.00) | positive | no | no |
| For me personally… I do buy quality fakes/knockoffs at (shop name) | YouTube | **spam** (0.75) | neutral | no | no |

Each row also keeps the comment ID and post fields you choose (`id`, `cid`, `postUrl`, `videoWebUrl`, …), and in full mode `typeScores` with the probability of every type.

### Input example

The form default — two pasted comments, no dataset needed (about $0.001, 2 seconds):

```json
{
  "texts": [
    "Where can I buy this in Canada? Need it!!",
    "Ordered 3 weeks ago and still nothing. Is anyone answering messages?"
  ]
}
```

To classify a comment scraper's output, pass its dataset instead — the text, post, date, likes, reply flag and IDs are detected automatically:

```json
{
  "datasetId": "YOUR_COMMENTS_DATASET_ID",
  "commentsNewerThan": "7 days",
  "excludeAuthors": ["yourbrand", "yourbrand_support"],
  "customLabels": ["mentions shipping or delivery"]
}
```

### Pricing

Pay only for classified comments — no subscription.

| Event | Price | When |
|---|---|---|
| `comment-judged` | $0.0005 | One comment classified (type such as purchase intent, question or complaint; sentiment; needs-reply flag and any custom labels). |

That is **$0.50 per 1,000 comments**. **First run with the form defaults: about $0.001** (2 comments, 2 seconds).

**Cost examples**

| Comments | Cost |
|---|---|
| 100 | $0.05 |
| 1,000 | $0.50 |
| 10,000 | $5.00 |
| 100,000 | $50.00 |

With the free $5 monthly Apify credit you can classify about **10,000 comments**.

Items without comment text are skipped and **not charged**. Comments that fail after retries are reported with an `error` field and **not charged**. If you set a maximum cost per run, the Actor stops cleanly when it is reached.

### Works with

Field names are matched ignoring case, `_` and `-` (also inside `user.username`-style objects), like counts such as `"3.4K"` are read as numbers, relative dates such as "3 days ago" are counted back from the run time, and nested replies are flattened. The first four were checked against real output (2026-10-09); the others against each scraper's published output schema (2026-10-11).

| Platform | Scraper on Apify Store | Text | Post | Likes | Date | Reply / owner flag |
|---|---|---|---|---|---|---|
| Instagram | [Instagram Comments Scraper (apify)](https://apify.com/apify/instagram-comment-scraper) | `text` | `postUrl` | `likesCount` | `timestamp` | nested `replies[]` |
| TikTok | [TikTok Comments Scraper (clockworks)](https://apify.com/clockworks/tiktok-comments-scraper) | `text` | `videoWebUrl` | `diggCount` | `createTimeISO` | `repliesToId` |
| Facebook | [Facebook Comments Scraper (apify)](https://apify.com/apify/facebook-comments-scraper) | `text` | `facebookUrl` | `likesCount` (text) | `date` | `threadingDepth`, nested `comments[]` |
| YouTube | [YouTube Comments Scraper (streamers)](https://apify.com/streamers/youtube-comments-scraper) | `comment` | `videoId` | `voteCount` | `publishedTimeText` (relative) | `type`, `authorIsChannelOwner` |
| TikTok | apidojo, xtdata TikTok comment scrapers | `text` | `awemeId` / `aweme_id` | `likeCount` / `digg_count` | `createdAt` / `create_time` | `parentId` / `reply_id` |
| Instagram | apidojo, supreme_coder, scrapesmith, datadoping, louisdeconinck | `text` / `message` | `postId`, `postUrl`, `media_id`, `input_url` | `likesCount` / `like_count` | `timestamp` / `created_at` | `type`, `depth`, `parentCommentId` |
| Instagram | [Instagram Scraper (apify)](https://apify.com/apify/instagram-scraper), posts mode | `latestComments[]` (flattened) | `url` | `likesCount` | `timestamp` | — |
| Facebook | thedoor, chronometrica, dami_studio | `text` | `post_url`, `postUrl`, `facebookUrl` | `reactions_count`, `reactionsCount`, `likesCount` | `comment_time`, `publishedAt`, `date` | `isReply`, `threadingDepth` |
| YouTube | apidojo, solidcode | `text` | `videoId` | `likeCount` ("3.4K") | `publishedTime`, `publishedAt` | `isCreatorReply` |
| LinkedIn | harvestapi LinkedIn post comments | `commentary` | `postId` | — | `createdAt` | `type` |

Rows without comment text (post rows, video info rows) are skipped and not charged. Anything still not detected can be set under **Field mapping & advanced**. **Also:** the Apify API and JavaScript/Python clients · Apify Schedules · Claude, Cursor and Claude Code through the Apify MCP server (below) · for product reviews, our [Amazon](https://apify.com/leoworks/amazon-review-classifier), [Google Maps](https://apify.com/leoworks/google-maps-review-classifier), [Korean](https://apify.com/leoworks/korean-review-classifier) and [AliExpress](https://apify.com/leoworks/aliexpress-reviews-classifier) review classifiers.

### Call it from code

```bash
curl -X POST "https://api.apify.com/v2/acts/leoworks~social-comment-classifier/run-sync-get-dataset-items?token=YOUR_APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"datasetId": "YOUR_DATASET_ID", "commentsNewerThan": "7 days"}'
```

JavaScript (`npm install apify-client`):

```js
import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: 'YOUR_APIFY_TOKEN' });
const run = await client.actor('leoworks/social-comment-classifier').call({ datasetId: 'YOUR_DATASET_ID' });
const { items } = await client.dataset(run.defaultDatasetId).listItems();
const buyers = items.filter((c) => c.type === 'purchase_intent');
```

Python (`pip install apify-client`):

```python
from apify_client import ApifyClient
client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("leoworks/social-comment-classifier").call(run_input={"datasetId": "YOUR_DATASET_ID"})
items = client.dataset(run["defaultDatasetId"]).list_items().items
to_answer = [c for c in items if c.get("needsReply")]
```

### Use with Claude, Cursor or Claude Code (MCP)

**Ask your AI agent.** Add the Apify MCP server with this Actor as a tool, then say, for example:

- *"Which of these comments are from people who want to buy? “Where can I buy this in Canada? Need it!!” / “Ordered 3 weeks ago and still nothing. Is anyone answering messages?” / “Love the colour 😍”"*
- *"Classify dataset YOUR_DATASET_ID from my TikTok comments scraper run and list the unanswered questions and complaints first."*
- *"Which of these Instagram comments are spam and which need a reply? “Follow me for free gift cards!!” / “Does it come in size L?” / “Not working, I want my money back.”"*

The agent calls the tool `leoworks--social-comment-classifier` and reads the labels with `get-dataset-items`. Replace `YOUR_DATASET_ID` with the ID of your own dataset.

Claude Desktop or Cursor (`mcp.json`):

```json
{
  "mcpServers": {
    "apify": {
      "url": "https://mcp.apify.com?tools=leoworks/social-comment-classifier",
      "headers": { "Authorization": "Bearer YOUR_APIFY_TOKEN" }
    }
  }
}
```

Claude Code: `claude mcp add --transport http apify "https://mcp.apify.com?tools=leoworks/social-comment-classifier" --header "Authorization: Bearer YOUR_APIFY_TOKEN"`. Leave out the header to sign in with OAuth in the browser instead. Your Apify token is in Console → Settings → API & Integrations. We verified this setup with the Apify MCP server (v0.17.4) on 2026-10-09: the agent classified a pasted comment in 6 seconds end to end (run `XTdACdD0TchL5eQ34`).

### Output

| Where | What |
|---|---|
| Dataset — view **Classified comments** | One row per comment with flat, spreadsheet-friendly columns |
| Dataset — view **Needs a reply** | Type, likes, date, comment, post and link — filter `needsReply` = true |
| Dataset — view **Labels with probabilities** | Every label with its probability, including all seven type scores |
| `REPLY_QUEUE.csv` | Comments that need an answer: purchase intent, then complaints, questions and requests; most-liked first |
| `REPORT_POSTS.csv` | One row per post: comments, share of each type, sentiment, reply-needed count, top language, last 7 days vs before |
| `REPORT` (JSON) | The same per post plus like-weighted type shares, daily trend (30 days) and the most-liked example comments per type |
| `BUYERS.csv` | Only with **Include commenter usernames**: one row per commenter who showed purchase intent |
| `SUMMARY` (JSON) | Detected fields, filters and counts, including skipped owner replies and duplicates |

Nothing extra is charged for the files.

#### One row

From run `tphg77KXmZ9fMS6Pg` (build 0.2.2, a dataset mixing four platforms; `typeScores` left out):

```json
{
  "cid": "7694457506550088461",
  "post": "https://www.tiktok.com/@temu/video/7694358584565583117",
  "publishedAt": "2026-10-09T00:25:38.000Z",
  "likes": 0,
  "replies": 1,
  "isReply": false,
  "text": "Temu, you guys are up over here making tiktoks. When im still am waiting for my package like, give me my freaking package, please.",
  "type": "complaint",
  "sentiment": "negative",
  "needsReply": true,
  "emojiOnly": false,
  "customLabelsMatched": "mentions shipping or delivery",
  "labels": {
    "type": { "label": "complaint", "probability": 1, "confidence": 1 },
    "sentiment": { "label": "negative", "probability": 1, "confidence": 1 },
    "needsReply": { "probability": 0.85, "matched": true },
    "custom": [{ "label": "mentions shipping or delivery", "probability": 0.98, "matched": true }]
  }
}
```

`author` appears only with **Include commenter usernames**; `language` when the scraper gives one. In full mode `labels.typeScores` lists all seven types. **Minimal mode** returns IDs and label keys only.

**How types are chosen:** each comment gets one main type. When a comment fits several, the first in this order wins: spam → purchase_intent → complaint → question → request → praise → other. So "Love it! Where can I buy it in the UK?" is `purchase_intent`, and "It stopped working after a week, any tips?" is `complaint`. Use `typeScores` or **Needs reply** when you want every comment that asks something.

#### Summary by post (REPORT)

Each run also saves a **REPORT** record (Output tab → *Summary by post*) at no extra charge: for every post, the comment type mix (by count and by likes), sentiment shares, how many comments need a reply, languages, a daily trend with last 7 days vs before, and up to 3 most-liked example comments for purchase intent, questions, complaints and requests — plus the same for all comments together. `lowSample` is true below 30 classified comments. Posts are grouped by `summaryGroupField` (detected automatically from fields such as `postUrl`, `videoWebUrl`, `facebookUrl` or `videoId` when empty).

Illustrative shape (numbers made up for the example):

```json
{
  "groupField": "videoWebUrl",
  "groups": [{
    "group": "https://www.tiktok.com/@brand/video/1",
    "comments": 120,
    "classified": 118,
    "types": [{ "label": "praise", "count": 51, "share": 0.432 }, { "label": "purchase_intent", "count": 22, "share": 0.186 }],
    "sentiment": { "positive": 0.55, "neutral": 0.36, "negative": 0.09 },
    "needsReplyRate": 0.31,
    "examples": { "purchase_intent": [{ "likes": 14, "text": "price?" }, { "likes": 3, "text": "Do you ship to Canada?" }], "question": [{ "likes": 9, "text": "Is it waterproof?" }] }
  }]
}
```

### Accuracy

Measured on 205 hand-labelled public English comments from Instagram, TikTok, Facebook and YouTube (beauty brands, a mobile carrier, a retailer's live shopping and product review videos; 2026-10-09). The questions were adjusted on one part, then checked once on a separate part that was not used for adjusting.

| Set | Comments | Main type | Main type (either label where two fit) | Sentiment |
|---|---|---|---|---|
| **Check set — not used for adjusting** | 100 | **90%** | 95% | **87%** |
| Adjusting set | 105 | 88% | 93% | 84% |

On the check set, complaints were found 97% of the time, questions 100%, spam 86% and purchase intent 71% (7 comments). Short comments without context ("No", "Vibes") are the hardest. Probabilities are calibrated — use `typeScores` and **Label threshold** to trade coverage for certainty. Automated labels can be wrong; check samples before making big decisions.

### Limits

| Item | Limit |
|---|---|
| Comment length | First 4,000 characters are used (post title: 300) |
| Custom labels | Up to 10, each up to 200 characters |
| Dataset size | Any — datasets are read in pages of 1,000 |
| Language | English (measured). Other languages are accepted and usually work, but accuracy has not been measured — treat them as **beta** |
| Replies | Each row is classified on its own, without its parent comment. Nested replies (Instagram `replies`, Facebook `comments`, Instagram Scraper `latestComments`) are flattened to rows; turn **Classify nested replies** off to skip them |
| Speed | About 100 comments in 3–4 seconds |
| Dates | Relative dates ("3 days ago") are approximate — counted back from the run time |
| Data | Only the comment text, the post title and your custom labels are sent for classification. Usernames are never sent; they are copied to the output only when you turn on **Include commenter usernames** |

### Run it on a schedule

Daily is the usual rhythm: schedule your comment scraper with an [Apify Schedule](https://docs.apify.com/platform/schedules), connect this Actor to it (see **Run it automatically after every scrape**) and set **Only comments newer than** to `1 day` to get a fresh reply queue every morning. To start it from other tools, use the Apify [n8n](https://docs.apify.com/platform/integrations/n8n) or [Make](https://docs.apify.com/platform/integrations/make) integration, or the Apify API.

### Related Actors

**Scrapers that collect the input** (Apify Store, other publishers — this Actor reads their datasets):

| Scraper | Collects |
|---|---|
| [Instagram Comments Scraper (apify)](https://apify.com/apify/instagram-comment-scraper) | comments of Instagram posts |
| [TikTok Comments Scraper (clockworks)](https://apify.com/clockworks/tiktok-comments-scraper) | comments of TikTok videos |
| [YouTube Comments Scraper (streamers)](https://apify.com/streamers/youtube-comments-scraper) | comments of YouTube videos |

**More from Leoworks:**

| Need | Actor |
|---|---|
| Google Maps reviews | [Google Maps Review Classifier](https://apify.com/leoworks/google-maps-review-classifier) |
| Amazon reviews | [Amazon Review Classifier](https://apify.com/leoworks/amazon-review-classifier) |
| Korean reviews | [Korean Review Classifier](https://apify.com/leoworks/korean-review-classifier) |

### FAQ

#### How is this different from Apify's Comments Analyzer Agent or asking ChatGPT?

Those summarise comments with a language model. This labels every comment with one of seven types and a calibrated probability, so you can count and filter them, and the price is fixed at $0.50 per 1,000 — no prompt to maintain. It also works on the output of any comment scraper you already use.

#### What are the alternatives to Social Comment Classifier?

The platforms' own inboxes (one account at a time, no labels), a social-listening subscription, or an LLM with your own prompts. This Actor labels comments from any Instagram, TikTok, Facebook or YouTube comment scraper for $0.50 per 1,000 comments.

#### How do I analyze Instagram and TikTok comments?

Run a comment scraper (see **Works with**), pick its dataset here and start. Every comment gets a `type` — filter for `purchase_intent` to see people asking for price, links or restocks, and for `spam` to hide fake-shop promotion — plus sentiment.

#### Which AI makes the judgments?

Jev, TypeSafe's decision model (version `jev-1.13.0`, pinned). Jev answers each label with a calibrated probability instead of generated text, so a 0.9 means the same thing for every item. Answers are stable but not fixed: re-running the same input can change a few borderline answers (under 1% of answers in our repeat tests) — filter on probability when an item must never flip. Only the comment text, the post title and your custom labels are sent to Jev; usernames and other fields are not.

#### Does it scrape Instagram, TikTok, Facebook or YouTube?

No. It classifies comments you already have — run a comment scraper first (see **Works with**) or paste texts.

#### Does it write replies?

No. It only assigns labels with probabilities — fast, cheap and consistent. Use **Needs reply** to decide which comments to answer.

#### Are the brand's own replies charged?

No. Comments flagged by the scraper as written by the channel owner or creator, and any account in **Exclude accounts**, are skipped before classification. Duplicates are skipped too.

#### Can I get a list of people who want to buy?

Turn on **Include commenter usernames**: each row gets the public username from your dataset and the run saves `BUYERS.csv` with one row per commenter who showed purchase intent. Usernames are never sent for classification. Use them in line with the platform's terms and privacy law.

#### Can I classify only new comments every day?

Yes. Schedule the scraper, connect this Actor through **Integrations** (see **How to use**) with **Only comments newer than: 1 day**. Older comments and duplicates are skipped and not charged.

#### Why `request` as well as `complaint`?

Product requests ("please make a bigger bottle") are feedback for product teams, not problems for support. They are kept apart so each team gets its own list.

### Disclaimer

> Independent tool — not affiliated with, endorsed by or sponsored by Meta (Instagram, Facebook), TikTok, Google (YouTube), or by the authors of the scrapers listed above. Names are used only to describe compatible data sources. The comments shown are public comments used as examples.

### Reviews and support

If this Actor saved you time, a short review on Apify Store helps others find it. Questions or a dataset whose fields are not detected? Open an issue in the **Issues** tab — we answer within a day.

### Changelog

See the Changelog tab.

# Changelog

This Actor's version history is a separate document: https://apify.com/leoworks/social-comment-classifier/changelog.md

# Actor input Schema

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

An Apify dataset containing comments — for example the output of an Instagram, TikTok, Facebook or YouTube comment scraper. Use this OR “Comment texts”.

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

Paste comment texts directly (one per line). Use this OR “Comments dataset”.

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

Up to 10 extra yes/no labels (each up to 200 characters) written in plain language, e.g. “mentions shipping to Canada”, “asks about a discount code”. Each gets a probability.

## `commentsNewerThan` (type: `string`):

Classify only comments posted after this date — a date like `2026-10-01` or a period like `7 days`, `4 weeks`, `3 months`. Relative dates such as "3 days ago" (YouTube) are counted back from the run time. Leave empty for all.

## `minLikes` (type: `integer`):

0 = all. Comments without a like count are kept.

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

Classify at most this many comments per post or video, in dataset order. 0 = no limit.

## `skipReplies` (type: `boolean`):

Classify only top-level comments, not replies to other comments.

## `skipOwnerReplies` (type: `boolean`):

Skip comments flagged by the scraper as written by the channel owner or creator (e.g. YouTube `authorIsChannelOwner`), plus any account listed in **Exclude accounts**.

## `excludeAuthors` (type: `array`):

Usernames whose comments are skipped — usually your own brand or support accounts (with or without @).

## `skipEmojiOnly` (type: `boolean`):

Skip comments with no letters or digits ("🔥🔥", "❤️"). They are mostly praise; skipping them saves cost.

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

Classify at most this many comments (0 = all).

## `includeAuthor` (type: `boolean`):

Add the commenter's public username to each row and save BUYERS.csv (one row per commenter with purchase intent). Off by default. Usernames are only copied from your dataset, never sent for classification. Use them in line with the platform's terms and privacy law.

## `expandNestedReplies` (type: `boolean`):

Datasets that keep replies inside a comment (Instagram `replies`, Facebook `comments`) or comments inside a post (Instagram Scraper `latestComments`) are flattened to one row per comment.

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

Field holding the comment text. Leave empty to auto-detect (text, comment, content, body, …).

## `contextField` (type: `string`):

Field holding the title or caption of the post the comment was written under (helps with short comments like “link?”). Leave empty to auto-detect (postTitle, title, …).

## `idFields` (type: `array`):

Fields copied unchanged from each input item to the output so you can join results back (e.g. id, cid, postUrl). Leave empty to auto-pick the comment ID and post URL.

## `labelThreshold` (type: `number`):

Minimum probability (0–1) for the needs-reply flag and custom labels to be marked as matched. Raise it for fewer, surer matches.

## `outputMode` (type: `string`):

Minimal mode returns only label keys — smaller and easier to aggregate.

## `summaryGroupField` (type: `string`):

Field in your dataset that identifies the post (e.g. `postUrl`, `videoWebUrl`, `videoId`). The run then saves a REPORT record with, per post: comment type mix, sentiment shares, share needing a reply and example purchase-intent, question, complaint and request comments. Leave empty to detect it automatically (overall summary only if none is found). No extra charge.

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

Comments classified in parallel.

## `healthCheck` (type: `boolean`):

Internal: fail the run when results look degraded (used by the developer's scheduled checks).

## Actor input object example

```json
{
  "texts": [
    "Where can I buy this in Canada? Need it!!",
    "Ordered 3 weeks ago and still nothing. Is anyone answering messages?"
  ],
  "customLabels": [],
  "minLikes": 0,
  "maxCommentsPerPost": 0,
  "skipReplies": false,
  "skipOwnerReplies": true,
  "excludeAuthors": [],
  "skipEmojiOnly": false,
  "maxItems": 0,
  "includeAuthor": false,
  "expandNestedReplies": true,
  "idFields": [],
  "labelThreshold": 0.5,
  "outputMode": "full",
  "maxConcurrency": 10,
  "healthCheck": false
}
```

# Actor output Schema

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

No description

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

No description

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

No description

## `postsCsv` (type: `string`):

No description

## `replyQueue` (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": [
        "Where can I buy this in Canada? Need it!!",
        "Ordered 3 weeks ago and still nothing. Is anyone answering messages?"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("leoworks/social-comment-classifier").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": [
        "Where can I buy this in Canada? Need it!!",
        "Ordered 3 weeks ago and still nothing. Is anyone answering messages?",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("leoworks/social-comment-classifier").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": [
    "Where can I buy this in Canada? Need it!!",
    "Ordered 3 weeks ago and still nothing. Is anyone answering messages?"
  ]
}' |
apify call leoworks/social-comment-classifier --silent --output-dataset

```

## MCP server setup

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

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/bRcr9i2Hfer5vY5rH/builds/Zm8xY22BiR0uFuZqU/openapi.json
