# Comment Intent Miner: Instagram & TikTok Questions & Leads (`samsocial/comment-intent-miner`) Actor

Give it Instagram or TikTok post URLs or creators. Every comment is labelled (question, objection, buying signal, praise, complaint, request) and grouped into themes with FAQ answers and content ideas. Built for daily schedules and AI agents.

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

## Pricing

Pay per event

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

## Comment Intent Miner: Instagram & TikTok Questions & Leads

Give it Instagram post or reel URLs, TikTok video URLs, or just creator handles (yours or a competitor's). It reads the comments, labels every one as a **question, objection, buying signal, praise, complaint, request or other**, scores buying intent, and groups them into themes. Each theme comes with real quotes, an FAQ answer outline and a content idea. You get your audience's own words, sorted into what to answer, what to fix and what to post next.

### Who it is for

- **DTC and ecommerce brands** that want the questions and objections blocking sales, in customers' own words.
- **Creators** looking for the next video idea their audience is already asking for.
- **Social media agencies** reporting on client (and competitor) comment sections every week.
- **AI agents** that need structured audience research they can act on.

### Why it is more than a scraper

A comment scraper gives you a pile of text. This Actor turns it into decisions.

| Step | How |
|---|---|
| Find the posts | Direct post/reel/video URLs, or each creator's latest posts (`apify/instagram-reel-scraper`, `clockworks/tiktok-scraper`) |
| Read the comments | `apify/instagram-comment-scraper`, `clockworks/tiktok-comments-scraper` (top-level comments) |
| Code first | Emoji-only and tag-only comments are labelled by code, no model call. Code spots trends: when many comments open with the same words, the model is told it is probably a joke or prompt from the video, so play-along replies are not counted as complaints |
| Label in batches | The fast model labels 40 comments per call: label, sentiment, intent score 0-100 and a short topic |
| Cluster into themes | Per label, comments are grouped into themes; count and likes are computed by code, quotes are real comments cut to under 15 words |
| Turn themes into actions | FAQ answer outline (questions, objections, buying signals) and a content idea per theme, plus 10 content ideas for the whole set. The model is told to use `[placeholders]` for facts it cannot know; review answers before posting |
| Only new comments | With a watchlist name, scheduled runs label and report only comments not seen before |

### Output

The dataset has three kinds of rows (`type`):

- **summary** (1 row): label counts, sentiment counts, per-post stats, and `contentIdeas` (10 ideas with title, hook, format and the theme they come from).
- **cluster**: `label`, `theme`, `count`, `totalLikes`, `avgIntentScore`, `quotes` (3, under 15 words each), `faqAnswer`, `contentIdea`, `postUrls`.
- **comment**: `platform`, `postUrl`, `commentId`, `commentUrl`, `text`, `likes`, `replies`, `postedAt`, `likedByCreator` (TikTok), `label`, `sentiment`, `intentScore`, `theme`, `clusterTheme`, `labelSource` (model, code or rules), `isNew`.

Commenter usernames are **not stored** by default. Turn on `includeAuthorHandles` only if you need to reply to people.

**REPORT.md**: label breakdown, top questions, top objections, buying signals (themes plus the strongest individual signals), complaints and requests, 10 content ideas, and a per-post table.

Example rows from a test run (a Glossier Instagram post plus Glossier's latest TikTok, trimmed):

```json
{
  "type": "cluster",
  "label": "request",
  "theme": "Bring back hot cocoa lip balm",
  "count": 3,
  "totalLikes": 5,
  "avgIntentScore": 48,
  "platforms": ["instagram", "tiktok"],
  "quotes": ["please for the love of god bring back my hot cocoa like i dont...",
             "Bring back the hot coco pls!!", "Bring back the hot cocoa lip balm!!"],
  "contentIdea": "Post: 'We heard you! Show us your love for [product name] in the comments, help us decide what comes back next.' Include a poll asking followers to vote on discontinued products they miss most, with hot cocoa lip balm as a featured option."
}
```

```json
{
  "type": "comment",
  "platform": "instagram",
  "postUrl": "https://www.instagram.com/p/DfuwCTnPzQ1/",
  "commentId": "18032929307886132",
  "text": "It hot cocoa coming back this year ???",
  "likes": 1,
  "label": "question",
  "sentiment": "neutral",
  "intentScore": 40,
  "theme": "hot cocoa return date",
  "clusterTheme": "Product Availability & Seasonal Releases",
  "labelSource": "model",
  "isNew": true
}
```

### How to use it

1. Paste post/reel/video URLs into **Post URLs**, or add handles to **Instagram creators** / **TikTok creators** (their latest 5 posts are read).
2. Optionally add one line about your **niche** so FAQ answers and ideas fit you.
3. Run it. Read REPORT.md, or filter the dataset by `type` and `label`.
4. For ongoing monitoring, set a **Watchlist name** and **schedule it daily or weekly**. With `onlyNew` (default on), each run labels and reports only comments that are new since the last run.

### Use it from Claude / ChatGPT (MCP)

Add `https://mcp.apify.com/?tools=samsocial/comment-intent-miner` as an MCP server, then ask:

> "Run comment-intent-miner on @competitor's last 5 TikToks and tell me the top 5 objections and the questions I should answer in my next video."

### Pricing

Pay per event (proposed):

| Event | Price | When |
|---|---|---|
| `post-scanned` | $0.01 per post | a post whose comments were read |
| `comment-labelled` | $0.001 per comment | each comment labelled by the model or by code (keyword fallbacks are free) |
| `cluster-summary` | $0.02 per theme | each theme with quotes, FAQ answer and content idea (the 10 content ideas are included) |

The AI labelling is included. The comment scrapers bill your Apify account at their own prices: `apify/instagram-comment-scraper` about $0.0026 per comment (less on higher plans), `clockworks/tiktok-comments-scraper` about $0.00125 per comment. Creator mode adds a small post lookup (`apify/instagram-reel-scraper` about $0.0026 per post, `clockworks/tiktok-scraper` about $0.004 per video).

#### What you get for the money

| Use | This Actor | Scrapers (est.) | Total |
|---|---|---|---|
| 1 Instagram post + 1 TikTok, 50 comments each, ~6 themes | about $0.24 | about $0.20 | **about $0.44** |
| Competitor watch: 5 TikToks x 100 comments, ~15 themes | about $0.85 | about $0.65 | **about $1.50** |
| Weekly schedule: 5 TikTok creators x 5 posts x 100 comments, ~100 of them new | about $0.45 | about $3.15 (all 2,500 comments are re-read) | **about $3.60 a week** |

Reading and sorting 500 comments by hand, then writing up the themes, takes a social media manager 2-3 hours.

On the Apify free plan the included model runs a preview: 2 posts, 50 comments per post, 6 themes. Note that `apify/instagram-comment-scraper` returns at most 15 comments per post for free Apify accounts.

### Limits and honesty

- Public posts only. Private, deleted or comments-off posts are listed in the report.
- Top-level comments only (no replies). The scrapers return the comments the platform shows; for posts with thousands of comments this is a sample, not all of them.
- Labels come from the comment text alone; sarcasm and inside jokes can be misread. `labelSource` says how each comment was labelled.
- The model knows nothing about your product. FAQ answers are outlines with `[placeholders]` for facts like prices, shipping or ingredients, but it can still word a guess as a fact: review and fill them in before posting.
- Scheduled runs with `onlyNew` save labelling cost, not scraper cost: every run re-reads up to `commentsPerPost` comments per post. Lower `commentsPerPost` for frequent schedules.
- The TikTok comment scraper does not return comments newest-first, so on busy videos new comments can fall outside the window that is read.
- Themes for a label with fewer than 4 comments may hold a single comment.
- Creator mode on Instagram reads the latest reels (via the reel scraper), not image posts. Paste image post URLs directly to include them.

### FAQ

**Can I run it on a competitor's posts?** Yes. Any public post works. That is the best way to find the objections and unanswered questions in your market.

**Does it store who commented?** Not by default. Rows hold the comment text, likes and labels. Turn on `includeAuthorHandles` only if you need to reply to leads, and handle that data under your privacy rules.

**What languages does it handle?** Comments in any language are labelled; themes are named in English and quotes stay in the original language.

# Actor input Schema

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

Instagram post/reel URLs and/or TikTok video URLs. Your own posts or a competitor's. Profile URLs are treated as creators.

## `instagramCreators` (type: `array`):

Instagram handles or profile URLs. Their latest posts (reels) are read. Use instead of, or as well as, post URLs.

## `tiktokCreators` (type: `array`):

TikTok handles or profile URLs. Their latest videos are read.

## `postsPerCreator` (type: `integer`):

How many of each creator's latest posts to read.

## `commentsPerPost` (type: `integer`):

How many top-level comments to read per post.

## `niche` (type: `string`):

One line about what you sell or post, e.g. 'natural men's soap'. Helps the FAQ answers and content ideas fit you.

## `onlyNew` (type: `boolean`):

For scheduled runs: label and report only comments not seen in an earlier run of this watchlist.

## `watchlistName` (type: `string`):

Name this watchlist so scheduled runs remember which comments they have already seen. Defaults to the list of posts and creators.

## `maxPosts` (type: `integer`):

Safety cap on posts per run.

## `maxClusters` (type: `integer`):

How many theme clusters (with quotes, FAQ answer and content idea) to write. 0 = labels only.

## `includeAuthorHandles` (type: `boolean`):

Off by default for privacy: rows hold the comment text, not who wrote it. Turn on only if you need to reply to people (e.g. leads).

## `anthropicApiKey` (type: `string`):

Use your own key for labelling and themes. Stored encrypted.

## `maxModelSpendUsd` (type: `number`):

Stop model calls after this much spend in one run; remaining comments get keyword labels (not charged).

## `maxSubActorSpendUsd` (type: `number`):

Cap on what the Instagram and TikTok scrapers may charge per call ($0.50 minimum each).

## `fastModel` (type: `string`):

Fast model for batch labelling and themes.

## Actor input object example

```json
{
  "postUrls": [
    "https://www.instagram.com/p/DfuwCTnPzQ1/",
    "https://www.tiktok.com/@glossier/video/7710367068201176333"
  ],
  "postsPerCreator": 5,
  "commentsPerPost": 100,
  "onlyNew": true,
  "maxPosts": 20,
  "maxClusters": 20,
  "includeAuthorHandles": false,
  "maxModelSpendUsd": 1,
  "maxSubActorSpendUsd": 3,
  "fastModel": "anthropic/claude-haiku-4.5"
}
```

# Actor output Schema

## `rows` (type: `string`):

No description

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

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

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

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "postUrls": [
        "https://www.instagram.com/p/DfuwCTnPzQ1/",
        "https://www.tiktok.com/@glossier/video/7710367068201176333"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("samsocial/comment-intent-miner").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.instagram.com/p/DfuwCTnPzQ1/",
        "https://www.tiktok.com/@glossier/video/7710367068201176333",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("samsocial/comment-intent-miner").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.instagram.com/p/DfuwCTnPzQ1/",
    "https://www.tiktok.com/@glossier/video/7710367068201176333"
  ]
}' |
apify call samsocial/comment-intent-miner --silent --output-dataset

```

## MCP server setup

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

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/CO0rhVGY7A4HYx6k1/builds/iuw8dGdgAN7pKd0n1/openapi.json
