# Reddit Keyword + Comment Thread Monitor (`automly/reddit-keyword-comment-monitor`) Actor

Monitor Reddit for fresh posts and comments matching your keywords across selected subreddits for research, brand tracking, and lead-signal discovery.

- **URL**: https://apify.com/automly/reddit-keyword-comment-monitor.md
- **Developed by:** [Automly](https://apify.com/automly) (community)
- **Categories:** Social media
- **Stats:** 3 total users, 1 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

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

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## Reddit Keyword + Comment Thread Monitor

Monitor Reddit for fresh **posts and comments** that match your keywords across
any set of subreddits. Built for recurring research, brand-mention tracking, and
lead-signal discovery — point it at the communities you care about, give it a
list of terms, and get a clean, structured feed of every match.

### What it does

- Scans one or more subreddits for posts (sorted by **new**, **hot**, or **top**).
- Reads the comment threads under matching posts and surfaces comments that hit
  your keywords too — not just the top-level posts.
- Matches keywords **case-insensitively** with **whole-word boundaries**, so
  short terms like `AI`, `Go`, or `R` match only as standalone words and never
  inside unrelated text such as "again" or "goes".
- De-duplicates results within a run, so you never get the same post or comment
  twice.
- Optionally keeps or skips deleted/removed content.

Run it on a schedule (e.g. every hour) to keep an always-fresh dataset of
mentions, or run it ad hoc to research a topic.

### Input

| Field | Type | Description |
|-------|------|-------------|
| `subreddits` | array of strings | **Required.** Subreddits to monitor, without the `r/` prefix (e.g. `python`, `marketing`). |
| `keywords` | array of strings | Keywords or phrases to match in titles, post text, and comments. Leave empty to capture every post and comment. |
| `sort` | string | Post ordering per subreddit: `new`, `hot`, or `top`. Default `new`. |
| `timeRange` | string | Time window when `sort` is `top`: `day`, `week`, `month`, `year`, `all`. Default `week`. |
| `maxPosts` | integer | Max matching posts to collect per subreddit (1–200). Default `25`. |
| `maxCommentsPerPost` | integer | Max matching comments per post (0–500). Set `0` to track posts only. Default `20`. |
| `includeDeleted` | boolean | Keep deleted/removed posts and comments. Default `false`. |
| `proxyConfiguration` | object | Optional proxy configuration. Recommended for large or frequent runs to keep results reliable. |

#### Example input

```json
{
  "subreddits": ["MachineLearning", "technology"],
  "keywords": ["ai", "llm", "open source"],
  "sort": "new",
  "maxPosts": 25,
  "maxCommentsPerPost": 20
}
````

### Output

Every matched post and comment is pushed to the dataset as a flat record:

```json
{
  "recordType": "comment",
  "postId": "1abc234",
  "commentId": "kx9y8z7",
  "subreddit": "MachineLearning",
  "author": "some_user",
  "title": null,
  "body": "This new open source LLM is impressive…",
  "score": 42,
  "createdUtc": 1716800000,
  "permalink": "https://www.reddit.com/r/MachineLearning/comments/1abc234/_/kx9y8z7/",
  "matchedKeywords": ["open source", "llm"]
}
```

| Field | Description |
|-------|-------------|
| `recordType` | `post` or `comment`. |
| `postId` | Reddit ID of the post. |
| `commentId` | Reddit ID of the comment (empty for posts). |
| `subreddit` | Subreddit the record belongs to. |
| `author` | Reddit username of the author. |
| `title` | Post title (empty for comments). |
| `body` | Post text or comment text. |
| `score` | Net upvote score. |
| `createdUtc` | Unix timestamp of creation. |
| `permalink` | Full Reddit URL to the post or comment. |
| `matchedKeywords` | Keywords that matched this record. |

### Pricing

This actor uses a **pay-per-event** model:

- **Result item produced** — charged for each post or comment saved.
- **Comment enriched** — charged for each comment record enriched with its
  thread context.

You only pay for the matches you actually receive.

### Tips

- Start with a low `maxPosts` / `maxCommentsPerPost` to gauge volume, then scale up.
- Use `sort: top` with a `timeRange` for digests; use `sort: new` for live monitoring.
- Leave `keywords` empty to ingest an entire subreddit feed.
- For large or frequent runs, enable proxy configuration for more reliable results.

# Actor input Schema

## `subreddits` (type: `array`):

Subreddits to monitor, without the 'r/' prefix (e.g. 'python', 'marketing'). At least one is required.

## `keywords` (type: `array`):

Keywords or phrases to match in post titles, post text, and comments. Matching is case-insensitive and uses whole-word boundaries, so short terms like 'AI' will not match inside other words. Leave empty to capture every post and comment.

## `sort` (type: `string`):

How to order the posts pulled from each subreddit. One of: new, hot, top.

## `timeRange` (type: `string`):

Time window applied when sort is 'top'. One of: day, week, month, year, all.

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

Maximum number of matching posts to collect from each subreddit (1-200).

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

Maximum number of matching comments to collect from each post (0-500). Set to 0 to skip comments and track posts only.

## `includeDeleted` (type: `boolean`):

When enabled, posts and comments that have been deleted or removed are kept in the results.

## `proxyConfiguration` (type: `object`):

Optional proxy configuration. Recommended for large or frequent runs to keep results reliable.

## Actor input object example

```json
{
  "subreddits": [
    "python"
  ],
  "keywords": [
    "release",
    "launch"
  ],
  "sort": "new",
  "timeRange": "week",
  "maxPosts": 25,
  "maxCommentsPerPost": 20,
  "includeDeleted": false,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

## `records` (type: `string`):

All matched posts and comments produced by this run.

## `overview` (type: `string`):

Dataset presented using the dataset schema overview view.

# 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 = {
    "subreddits": [
        "python"
    ],
    "keywords": [
        "release",
        "launch"
    ],
    "sort": "new",
    "timeRange": "week",
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("automly/reddit-keyword-comment-monitor").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 = {
    "subreddits": ["python"],
    "keywords": [
        "release",
        "launch",
    ],
    "sort": "new",
    "timeRange": "week",
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("automly/reddit-keyword-comment-monitor").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "subreddits": [
    "python"
  ],
  "keywords": [
    "release",
    "launch"
  ],
  "sort": "new",
  "timeRange": "week",
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call automly/reddit-keyword-comment-monitor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=automly/reddit-keyword-comment-monitor",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Reddit Keyword + Comment Thread Monitor",
        "description": "Monitor Reddit for fresh posts and comments matching your keywords across selected subreddits for research, brand tracking, and lead-signal discovery.",
        "version": "1.0",
        "x-build-id": "XV0T0k5iSPzlzYxro"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/automly~reddit-keyword-comment-monitor/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-automly-reddit-keyword-comment-monitor",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/automly~reddit-keyword-comment-monitor/runs": {
            "post": {
                "operationId": "runs-sync-automly-reddit-keyword-comment-monitor",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/automly~reddit-keyword-comment-monitor/run-sync": {
            "post": {
                "operationId": "run-sync-automly-reddit-keyword-comment-monitor",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "subreddits"
                ],
                "properties": {
                    "subreddits": {
                        "title": "Subreddits",
                        "type": "array",
                        "description": "Subreddits to monitor, without the 'r/' prefix (e.g. 'python', 'marketing'). At least one is required.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "keywords": {
                        "title": "Keywords",
                        "type": "array",
                        "description": "Keywords or phrases to match in post titles, post text, and comments. Matching is case-insensitive and uses whole-word boundaries, so short terms like 'AI' will not match inside other words. Leave empty to capture every post and comment.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "sort": {
                        "title": "Sort",
                        "type": "string",
                        "description": "How to order the posts pulled from each subreddit. One of: new, hot, top.",
                        "default": "new"
                    },
                    "timeRange": {
                        "title": "Time range",
                        "type": "string",
                        "description": "Time window applied when sort is 'top'. One of: day, week, month, year, all.",
                        "default": "week"
                    },
                    "maxPosts": {
                        "title": "Max posts per subreddit",
                        "minimum": 1,
                        "maximum": 200,
                        "type": "integer",
                        "description": "Maximum number of matching posts to collect from each subreddit (1-200).",
                        "default": 25
                    },
                    "maxCommentsPerPost": {
                        "title": "Max comments per post",
                        "minimum": 0,
                        "maximum": 500,
                        "type": "integer",
                        "description": "Maximum number of matching comments to collect from each post (0-500). Set to 0 to skip comments and track posts only.",
                        "default": 20
                    },
                    "includeDeleted": {
                        "title": "Include deleted / removed content",
                        "type": "boolean",
                        "description": "When enabled, posts and comments that have been deleted or removed are kept in the results.",
                        "default": false
                    },
                    "proxyConfiguration": {
                        "title": "Proxy configuration",
                        "type": "object",
                        "description": "Optional proxy configuration. Recommended for large or frequent runs to keep results reliable."
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
