# Social Comment Buyer Signal Filter (`rorirooo/social-comment-buyer-signal-filter`) Actor

Find buying, price, shipping, product, complaint and refund signals in existing Instagram, TikTok, YouTube and Threads comments. Import Apify Datasets or JSON. Get matched phrases, platform evidence and deduplicated results. English/Korean rules; no scraping or AI API key.

- **URL**: https://apify.com/rorirooo/social-comment-buyer-signal-filter.md
- **Developed by:** [로릴리루](https://apify.com/rorirooo) (community)
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.50 / 1,000 classified comments

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

## Social Comment Buyer Signal Filter

Turn already-collected Instagram, TikTok, YouTube and Threads comments into auditable buyer and customer-service signals. Import an existing Apify Dataset or supply JSON. Get purchase-location questions, price inquiries, shipping questions, product questions, complaints, refund/return requests and general comments.

### What it does

- Normalizes common comment fields and preserves explicit platform values.
- Returns matched phrases, all matching categories, a primary label and a readable reason.
- Skips empty/invalid comments and deduplicates within a run.
- Optionally outputs only signals or omits raw text.
- Uses deterministic English/Korean phrase rules. No external AI, scraping, proxy or API key is required for inline input.

This is a triage tool, not a prediction of purchases. It does not contact commenters, verify demand, or scrape any social network. Sarcasm, short context-dependent comments and unsupported languages may need review. It is not a general multilingual sentiment model.

### Quick start

Set `items` to an array of objects or strings, then Start. The example in `example-input.json` produces four rows: Instagram/BUY_QUESTION, TikTok/SHIPPING_QUESTION, YouTube/PRODUCT_COMPLAINT, Threads/GENERAL_COMMENT.

For a previously collected dataset, set `sourceDataset` to its ID. The run's Apify identity must have read access. Dataset input replaces inline input, preventing accidental mixing of demonstration rows. `maxItems` limits scanned rows, including duplicates and empty rows; maximum 100,000.

### Input

| Field | Default | Meaning |
|---|---|---|
| items | No runtime default | Array of comments or strings |
| sourceDataset | Empty | Existing Dataset ID; takes priority |
| maxItems | 1000 | Maximum source rows, 1–100000 |
| platformHint | auto | Explicit manual override or auto |
| signalsOnly | false | Omit GENERAL_COMMENT rows |
| includeText | true | False omits raw text; matched phrases remain |
| trackedTerms | Empty | Comma-separated optional tags, maximum 25 |

Text keys: text, comment, text_content, commentText, textOriginal, textDisplay, body, message. YouTube API snippet/topLevelComment.snippet text fields are also supported. Each input row represents one comment; nested reply arrays are not expanded.

Platform precedence: manual override, explicit platform/sourcePlatform, recognized URL hostname, platform-specific field combinations, unknown. Generic comment/commentUrl fields do not prove a platform. Conflicting explicit/URL evidence is flagged. Platform unknown does not itself make an otherwise clear text classification ambiguous.

### Output

| Field | Meaning |
|---|---|
| id | Source ID, or stable hash when absent |
| platform / platformReason / platformConflict | Platform and its evidence |
| text / textTruncated | First 5000 characters or empty when omitted |
| sourceUrl | First available source link |
| label / labels | Primary and all detected categories |
| matchedTerms / reason | Phrase evidence and explanation |
| needsReview | Ambiguous unmatched text, negation, truncation or platform conflict |
| ruleStrength | PHRASE_MATCH or NONE; not a calibrated probability |
| trackedTerms | Matching optional product tags |
| method / modelVersion | RULE_BASED / 3.0.0 |

Categories: BUY_QUESTION, PRICE_QUESTION, SHIPPING_QUESTION, PRODUCT_QUESTION, PRODUCT_COMPLAINT, RETURN_REFUND_QUESTION, GENERAL_COMMENT. Primary priority: return/refund, complaint, buying, price, shipping, product. Multiple matches remain in `labels`; they do not automatically require review. Familiar general engagement such as “Great video!” does not automatically require review.

Deduplication key is platform + source URL + source ID. Without ID, a hash of platform, URL and full text is used. Distinct people posting identical text without IDs cannot be distinguished. Supply original IDs where possible.

`SUMMARY` in key-value storage reports scanned, invalid, empty, duplicate, processed, filtered and output counts, primary-category counts and spending-limit state. An input with no data raises an error. An input containing only empty, duplicate or filtered comments may legitimately produce zero results; inspect SUMMARY.

### Privacy and reliability

Only normalized output fields are stored; author profiles are not copied. Input text and matched phrases may still contain personal data. Use only data you are authorized to process and manage source/input storage retention separately. No external text-analysis service receives comments.

The entry point is `python -m social_filter`; `__main__.py` explicitly runs the async main function. The SDK version is pinned. Every release should pass entry-point, classification, deduplication, cloud Dataset and spend-limit checks.

### Pricing

Pay per event: **$0.50 per 1,000 delivered comments** ($0.0005 each), plus **$0.001 per run** for the Actor-start event at the allowed memory sizes. Platform usage is included. No subscription is required by this Actor.

The custom `comment-analyzed` event is charged once per delivered output row. Empty, invalid, duplicate and signal-filtered rows do not incur a result event. The start fee still applies when no results are produced. The automatic dataset-item event is disabled to prevent double billing.

Examples: four output rows cost $0.003 including startup; 1,000 output rows cost $0.501. A run limit of $0.002 allows startup plus two rows. The minimum selectable run limit is $0.0015 (startup plus one row). Set your own maximum charge before starting; the Actor stops output when the remaining budget cannot cover another row.

Cloud validation on 2026-11-03 verified two delivered rows at a $0.002 limit and four at a $0.01 limit with PPE enabled. These were developer-owned runs, not independent customer payment or payout validation.

### Example input

```json
{
  "items": [
    {"id": "sample-1", "platform": "instagram", "text": "Where can I buy this?"},
    {"id": "sample-2", "platform": "tiktok", "text": "Do you ship to Canada?"},
    {"id": "sample-3", "platform": "youtube", "text": "Mine broke after a week."},
    {"id": "sample-4", "platform": "threads", "text": "Great video!"}
  ],
  "maxItems": 1000,
  "signalsOnly": false
}
```

The four rows produce BUY_QUESTION, SHIPPING_QUESTION, PRODUCT_COMPLAINT and GENERAL_COMMENT respectively, with `needsReview: false` for these explicit examples. For MCP clients, use comment objects rather than raw strings because generated client schemas may require objects.

# Actor input Schema

## `items` (type: `array`):

Already-collected comments as objects or strings. Ignored if sourceDataset is set.

## `sourceDataset` (type: `string`):

Readable Apify Dataset ID. Takes priority over inline comments.

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

Includes empty and duplicate source rows; caps work.

## `platformHint` (type: `string`):

Auto uses explicit platform, URL hostnames, then specific field combinations.

## `signalsOnly` (type: `boolean`):

Exclude general comments from output and future result billing.

## `includeText` (type: `boolean`):

Keep up to 5000 characters. False returns an empty text field; matched phrases remain.

## `trackedTerms` (type: `string`):

Comma-separated optional tags, up to 25. Tags do not establish purchase intent.

## Actor input object example

```json
{
  "items": [
    {
      "id": "sample-1",
      "platform": "instagram",
      "text": "Where can I buy this?"
    },
    {
      "id": "sample-2",
      "platform": "tiktok",
      "text": "Do you ship to Canada?"
    },
    {
      "id": "sample-3",
      "platform": "youtube",
      "text": "Mine broke after a week."
    },
    {
      "id": "sample-4",
      "platform": "threads",
      "text": "Great video!"
    }
  ],
  "maxItems": 1000,
  "platformHint": "auto",
  "signalsOnly": false,
  "includeText": true,
  "trackedTerms": ""
}
```

# Actor output Schema

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

No description

## `summary` (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 = {
    "items": [
        {
            "id": "sample-1",
            "platform": "instagram",
            "text": "Where can I buy this?"
        },
        {
            "id": "sample-2",
            "platform": "tiktok",
            "text": "Do you ship to Canada?"
        },
        {
            "id": "sample-3",
            "platform": "youtube",
            "text": "Mine broke after a week."
        },
        {
            "id": "sample-4",
            "platform": "threads",
            "text": "Great video!"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("rorirooo/social-comment-buyer-signal-filter").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 = { "items": [
        {
            "id": "sample-1",
            "platform": "instagram",
            "text": "Where can I buy this?",
        },
        {
            "id": "sample-2",
            "platform": "tiktok",
            "text": "Do you ship to Canada?",
        },
        {
            "id": "sample-3",
            "platform": "youtube",
            "text": "Mine broke after a week.",
        },
        {
            "id": "sample-4",
            "platform": "threads",
            "text": "Great video!",
        },
    ] }

# Run the Actor and wait for it to finish
run = client.actor("rorirooo/social-comment-buyer-signal-filter").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 '{
  "items": [
    {
      "id": "sample-1",
      "platform": "instagram",
      "text": "Where can I buy this?"
    },
    {
      "id": "sample-2",
      "platform": "tiktok",
      "text": "Do you ship to Canada?"
    },
    {
      "id": "sample-3",
      "platform": "youtube",
      "text": "Mine broke after a week."
    },
    {
      "id": "sample-4",
      "platform": "threads",
      "text": "Great video!"
    }
  ]
}' |
apify call rorirooo/social-comment-buyer-signal-filter --silent --output-dataset

```

## MCP server setup

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

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/Shw8hRucb1JSxhKXU/builds/aYFgxsYpgDUiCM7Qu/openapi.json
