# YouTube Comment Filter: Spam & Scam Detector (`dead00/youtube-comment-filter-spam-scam-detector`) Actor

Find spam and scam comments on any YouTube video or channel, with a clear reason for every flag, in 5 languages. No API key needed. On your own channel, it can also hold or remove spam automatically, clean YouTube's own spam folders, approve real fans YouTube wrongly hid, and ban repeat offenders.

- **URL**: https://apify.com/dead00/youtube-comment-filter-spam-scam-detector.md
- **Developed by:** [Dead](https://apify.com/dead00) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.40 / 1,000 comment scanneds

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

### YouTube Comment Filter: Spam & Scam Detector

Find spam and scam comments on any YouTube video or channel, with a clear reason for every flag, in 5 languages. **No API key needed.** On your own channel, it can also hold or remove spam automatically, clean YouTube's own spam folders, approve real fans YouTube wrongly hid, and ban repeat offenders.

### What it catches

- **Impersonators:** accounts copying your channel name, including look-alike letters and "+ Support / Official" names
- **Contact bait:** "message me on WhatsApp/Telegram", phone numbers
- **Investment and crypto scams,** including fake reply chains ("she helped me too! Mrs. … is legit")
- **Fake prizes:** "you are one of the lucky winners, claim on Telegram"
- **Copy-paste bots:** the same comment from several accounts
- **Disguised text:** 𝐟𝐚𝐧𝐜𝐲 letters and Cyrillic look-alikes used to dodge filters (detected and decoded)
- **Adult and dating bots, suspicious and shortened links, self-promotion**
- **Your own blocked words**

**Languages:** English, Hindi (Devanagari and Hinglish, e.g. "ghar baithe paise kamao"), Spanish, Portuguese and Indonesian, detected automatically.

Every flagged comment gets a `spamScore`, a level (`likely spam` or `possible spam`) and plain `reasons`. It's tuned to avoid flagging real fans: normal talk about money, investing or crypto is not treated as a scam. Your own comments and your trusted authors are never flagged.

### How to use

1. Add **videos or channels**: a video link, a channel link or an `@handle`. For channels, the newest videos are scanned.
2. Run it. That's all you need to scan and flag.

Useful options:

- **Which comments first:** **Top comments** (default) is where most scam replies hide; **Newest** shows the latest activity.
- **Include replies:** on by default. Many scams hide in replies.
- **Output all comments:** off by default, so only flagged comments are saved. Turn it on to see every comment and reply with its score.
- **Sensitivity:** Low (only obvious spam), Medium (recommended) or High (also mild self-promotion).
- **Blocked words, trusted authors, allowed links:** tune it to your channel.

### On your own channel

Connect your channel (setup below) to unlock:

| Feature | What it does |
|---|---|
| **Hold for review** | Flagged comments wait in YouTube Studio for you to approve or delete. The safest start. |
| **Remove** | Flagged comments are removed. |
| **Remove and ban** | Flagged comments are removed and their authors banned from your channel. |
| **Review YouTube's spam folders** | Checks the comments YouTube already put in **Likely spam** and **Held for review**. Real spam gets your chosen action. Works with no videos listed, so you can schedule a daily folder cleanup on its own. |
| **Approve real comments** | Publishes comments from those folders that are clearly clean, so real fans aren't hidden. Borderline comments are never approved. |
| **Ban repeat offenders** | Bans accounts flagged on 2+ videos (or 3+ times) in the run. |

**Repeat offenders** are always listed in the results, even without banning, so you can review them first.

**Scheduled moderation:** turn on **Only new comments since the last run** and schedule the actor, for example every hour. Each run checks only new comments, so it's fast and cheap.

### Output

Flagged comment:

```json
{
  "type": "comment",
  "videoTitle": "How I Invest My Money",
  "commentUrl": "https://www.youtube.com/watch?v=abc123xyz00&lc=Ugx...",
  "authorName": "Grahamm Stephan",
  "text": "Congratulations you have been selected, text me on WhatsApp +1 (650) 555-0198",
  "isReply": false,
  "spamScore": 12,
  "spamLevel": "likely spam",
  "reasons": ["impersonates the channel name", "asks to be contacted on WhatsApp/Telegram", "fake prize / \"you are a winner\" message"],
  "action": "held for review"
}
```

Also in the results:

- **One summary row per video:** comments scanned, split into `topLevelComments` and `replies`, plus flagged and moderated counts.
- **Spam-folder comments,** marked `"folder": "Likely spam"` or `"Held for review"`.
- **Repeat offenders:**

```json
{ "type": "offender", "authorName": "Grahamm Stephan", "flaggedComments": 4, "videos": 3,
  "topReasons": ["impersonates the channel name", "asks to be contacted on WhatsApp/Telegram"], "banned": true }
```

### Pricing

You pay only for what the actor does. Platform costs are included.

| Event | When it's charged | Price per 1,000 |
|---|---|---|
| Comment scanned | Each comment or reply checked, on videos or in YouTube's spam folders | $0.40 |
| Comment held | Each comment moved to Held for review | $1.50 |
| Comment removed | Each comment removed (banning the author is included at no extra cost) | $2.50 |
| Comment approved | Each real comment published back from YouTube's spam folders | $1.50 |
| Actor start | Once per run | $0.00005 |

Repeat-offender lists, video summaries and problem rows are free. A comment is never charged twice for removal, even if it's removed first and its author banned later in the same run.

Set a **Maximum cost per run** in Run options. When it's reached, the actor stops and keeps its results; comments it couldn't moderate in time are marked `skipped: maximum cost per run reached`.

### Setup for your own channel

Scanning needs no setup. To hold, remove, approve or ban on your channel, connect it once:

1. Open console.cloud.google.com and create a project. In **APIs & Services → Library**, enable **YouTube Data API v3**.
2. Open **OAuth consent screen**. Choose **External** and add your own Google account as a test user.
3. Go to **Credentials → Create credentials → OAuth client ID** and choose **Desktop app**. Copy the client ID and secret.
4. Open Google's **OAuth Playground** (developers.google.com/oauthplayground). Click the ⚙️ gear, tick **Use your own OAuth credentials**, and paste the client ID and secret.
5. In Step 1, enter the scope `https://www.googleapis.com/auth/youtube.force-ssl`, click **Authorize APIs**, and sign in **as the channel owner**.
6. Click **Exchange authorization code for tokens**, copy the **refresh token**, and paste all three values into the actor.

**Important:** while your OAuth app is in "Testing" mode, Google expires refresh tokens after **7 days**. For long-running schedules, click **Publish app** on the OAuth consent screen. For your own use, you can continue past Google's "unverified app" warning.

Your tokens are stored encrypted and never written to the output.

#### Your own API key (optional)

Not needed for normal use. Scanning runs on a built-in daily quota shared by all users. If it's used up, the run stops, keeps its results and asks you to add your own key: in the Google Cloud project above, go to **Credentials → Create credentials → API key** and paste it into **Your own YouTube API key**.

### Good to know

- **Why public videos often show little spam:** YouTube's own filter hides most spam before it's public, in the **Likely spam** folder. On your own channel, **Review YouTube's spam folders** is where most spam actually is.
- **Start with Hold for review** to see what gets flagged before switching to automatic removal.
- **Moderation works only on your own channel's videos.** Scanning works on any public video.
- **Quota:** moderation uses your own channel connection's quota, about 50 units per batch of up to 50 comments, out of 10,000 free per day.
- **Detection is pattern-based.** Use Blocked words for anything specific to your channel.
- **Repeat offenders** are counted within one run. Scan several videos together to catch accounts that spread spam across your channel.
- In **Only new comments** mode, new replies under older comments may be missed. Run a full scan now and then.
- **Not possible through YouTube's API:** comments on Community posts, hearting or pinning comments, syncing YouTube Studio's blocked-word list, and unbanning users.

# Actor input Schema

## `targets` (type: `array`):

One per line: a video link, a channel link, or an @handle. For channels, the newest videos are scanned. Can be left empty when reviewing YouTube's spam folders.

## `maxVideosPerChannel` (type: `integer`):

How many of a channel's newest videos to scan.

## `maxCommentsPerVideo` (type: `integer`):

Comments and replies together, per video.

## `commentOrder` (type: `string`):

Scammers mostly reply under top comments, where the most people see them. 'Only new comments' always reads newest first.

## `includeReplies` (type: `boolean`):

Also check replies. Many scams hide in replies ("she helped me too!").

## `onlyNewComments` (type: `boolean`):

Ideal for a scheduled run: each run checks only comments posted since the previous one.

## `sensitivity` (type: `string`):

How strict spam detection is. Works for English, Hindi (and Hinglish), Spanish, Portuguese and Indonesian.

## `blockedWords` (type: `array`):

Always flag comments containing these words or phrases (works through fancy Unicode tricks too).

## `trustedAuthors` (type: `array`):

Never flag these people: their @handle, display name or channel ID. Your own comments are never flagged.

## `allowedDomains` (type: `array`):

Links to these domains are not counted as suspicious, e.g. your own website.

## `outputAllComments` (type: `boolean`):

Off = only flagged comments are saved. On = every comment and reply, each with its spam score.

## `apiKey` (type: `string`):

Not needed: scanning works out of the box. On the free Apify plan, the built-in key includes a free allowance of 3 videos and 300 comments in total; adding your own free key (or a paid plan) removes the limit.

## `action` (type: `string`):

Anything other than Report only needs your channel connected below, and works only on your own channel's videos. Hold for review is the safest choice.

## `oauthClientId` (type: `string`):

From your Google Cloud OAuth client (Desktop app type).

## `oauthClientSecret` (type: `string`):

From the same OAuth client.

## `oauthRefreshToken` (type: `string`):

Created in Google's OAuth Playground while signed in as the channel owner (scope: youtube.force-ssl).

## `reviewSpamFolders` (type: `boolean`):

Also check the comments YouTube already put in 'Likely spam' and 'Held for review' on your channel. Real spam gets the action above. Works even with no videos listed.

## `approveRealComments` (type: `boolean`):

Publish comments in those folders that are clearly clean, so real fans aren't hidden. Borderline comments are never approved.

## `maxFolderComments` (type: `integer`):

How many comments to review in each spam folder.

## `banRepeatOffenders` (type: `boolean`):

Ban accounts flagged on 2 or more videos (or 3+ times) in this run, and remove their flagged comments. Repeat offenders are always listed in the results, even when this is off.

## `memoryName` (type: `string`):

Where 'Only new comments' remembers progress. Use different names for separate channels or projects.

## `resetMemory` (type: `boolean`):

Forget progress for these videos and check all comments again.

## Actor input object example

```json
{
  "targets": [
    "https://www.youtube.com/@GrahamStephan"
  ],
  "maxVideosPerChannel": 10,
  "maxCommentsPerVideo": 1000,
  "commentOrder": "top",
  "includeReplies": true,
  "onlyNewComments": false,
  "sensitivity": "medium",
  "outputAllComments": false,
  "action": "report",
  "reviewSpamFolders": false,
  "approveRealComments": false,
  "maxFolderComments": 500,
  "banRepeatOffenders": false,
  "memoryName": "youtube-comment-filter",
  "resetMemory": false
}
```

# Actor output Schema

## `results` (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 = {
    "targets": [
        "https://www.youtube.com/@GrahamStephan"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("dead00/youtube-comment-filter-spam-scam-detector").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 = { "targets": ["https://www.youtube.com/@GrahamStephan"] }

# Run the Actor and wait for it to finish
run = client.actor("dead00/youtube-comment-filter-spam-scam-detector").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 '{
  "targets": [
    "https://www.youtube.com/@GrahamStephan"
  ]
}' |
apify call dead00/youtube-comment-filter-spam-scam-detector --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,dead00/youtube-comment-filter-spam-scam-detector"
        }
    }
}
```

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/DJoBXrGNYygTL9ANi/builds/CngWQEAD3fAwNaNoW/openapi.json
