# Reddit Keyword Monitor & Scraper (`realistic_jackpot/subreddit-monitor-real-time-reddit-post-keyword-tracker`) Actor

Monitor new Reddit posts for keywords and get instant email or webhook alerts. Track any subreddit automatically on a schedule and send matching posts to n8n, Make, CRMs, or custom workflows.

- **URL**: https://apify.com/realistic\_jackpot/subreddit-monitor-real-time-reddit-post-keyword-tracker.md
- **Developed by:** [Hunch](https://apify.com/realistic_jackpot) (community)
- **Categories:** Social media, Automation, News
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.005 / actor start

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — 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 Monitor - Real-Time Reddit Post & Keyword Tracker

A lightweight, reliable Apify Store Actor to monitor **one subreddit** for **new posts** containing specified keywords, with instant **Email** and **Webhook** alert notifications.

Unlike heavy scrapers designed for extracting historical data, **Reddit Post Monitor** is specifically built for low request volume, cost efficiency, human-paced stealth navigation, and continuous automated execution using **Apify Schedules**.

***

### 🚀 Key Features

- **Subreddit Monitoring**: Monitors new posts in real-time from any public subreddit.
- **Human-Paced Sequential Inspection**: Visits new posts individually in the browser with realistic delays (1.2s – 2.5s) to read full body content without triggering bot blocks.
- **Flexible Input Normalization**: Accepts plain names (`webscraping`), prefixed names (`r/webscraping`), or full Reddit URLs (`https://www.reddit.com/r/webscraping`).
- **Strict Whole-Word Matching**: Case-insensitive matching with strict word boundaries to eliminate false positives (e.g. matching `cat` will **not** trigger on `category` or `concatenate`).
- **Stealth & Anti-Bot Bypassing**: Integrates Crawlee browser fingerprints, Apify Residential Proxies, and multi-endpoint fallbacks (`www.reddit.com` -> `old.reddit.com` -> JSON feeds).
- **Built-in Notifications**:
  - **Email Alerts**: Automatic email notifications delivered via Apify's official `apify/send-mail` Actor.
  - **Webhook Integration**: HTTP `POST` JSON payloads sent directly to your custom webhook endpoint or automation server (n8n, Make, Zapier).
- **Persistent Checkpoint Management**: Uses named Key-Value Stores (`reddit-monitor-sub-{subreddit}`) to guarantee state persistence across separate scheduled runs with zero duplicate alerts.
- **24-Hour Expiration & Safety**: Automatic state recovery if a checkpoint post is deleted, or if the schedule has been paused for more than 24 hours.

***

### 📋 Input Configuration

Configure the Actor via the Apify console UI or JSON payload:

| Parameter | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| `subreddit` | String | **Yes** | Subreddit to monitor (e.g. `webscraping`, `r/webscraping`, or full URL). |
| `keywords` | Array | **Yes** | List of keywords to search for in post titles and body text. |
| `notificationEmail` | String | **Yes** | Target email address to receive alert notifications. *(See Email Policy Note below)* |
| `webhookUrl` | String | No | HTTP POST URL endpoint to receive JSON alert payloads. |

> \[!IMPORTANT]
> **Apify Email Delivery Policy:**
>
> - **Free / Trial Apify Accounts**: Apify's security policy restricts email sending **only to the email address registered with your Apify account**.
> - **Paid Apify Plans**: Full capability to send email notifications to **any external email address** or team address.

#### Example Input JSON

```json
{
  "subreddit": "r/webscraping",
  "keywords": ["apify", "playwright", "crawlee"],
  "notificationEmail": "your-registered-email@example.com",
  "webhookUrl": "https://example.com/api/webhooks/reddit"
}
```

***

### 🔄 Monitoring Workflow & Checkpoint Rules

#### 1. First-Run Initialization

On its very first run, the Actor fetches the subreddit `/new` listing, identifies the newest visible post, and saves its ID as the baseline checkpoint in the persistent Key-Value Store. **No notifications are sent during initialization** to avoid flooding you with historical alerts.

#### 2. Normal Scheduled Runs

On subsequent runs:

1. The Actor loads the stored `lastPostId` from the persistent store and checks its age (`lastRunAt`).
2. If `lastRunAt` is **under 24 hours old**, the Actor identifies all posts published after `lastPostId`.
3. The Actor opens each new post individually in the browser with human-like pacing (1.2s - 2.5s delay) to extract the full body text.
4. Each post is evaluated against your target keywords (title and full body text).
5. If matching keywords are found, Email and/or Webhook notifications are triggered immediately.
6. The persistent checkpoint is updated with the newest post ID visible at the start of the run.

#### 3. 24-Hour Checkpoint Expiration

If the Actor has not executed for more than **24 hours** (e.g., if a schedule was paused or interrupted), the old checkpoint is safely expired. The Actor sets a new baseline checkpoint from the current newest post and exits without sending historical notifications.

#### 4. Deleted Post Recovery

If a previously checkpointed post was deleted or removed by Reddit moderators, the Actor logs a warning, processes all visible posts safely, and updates the checkpoint without crashing.

***

### 📩 Notification Formats

#### Email Alerts

Sent directly to your `notificationEmail` using `apify/send-mail`. Includes post title, subreddit name, matched keywords, post excerpt, and a direct link to the post.

#### Webhook JSON Payload

Sent as an HTTP `POST` request to `webhookUrl`:

```json
{
  "event": "REDDIT_POST_MATCH",
  "subreddit": "webscraping",
  "matchedKeywords": ["apify"],
  "post": {
    "id": "1v65ksd",
    "title": "How to build an Apify Actor with Playwright",
    "url": "https://www.reddit.com/r/webscraping/comments/1v65ksd/how_to_build_an_apify_actor_with_playwright/",
    "createdAt": "2026-07-25T11:13:45.985Z"
  }
}
```

***

### ⏰ Setting Up an Automated Schedule

To monitor subreddits continuously:

1. **Save an Apify Task**: Save your input settings as a Task in the Apify Console.
2. **Create a Schedule**: Navigate to **Schedules** in the Apify Console menu.
3. **Add Task to Schedule**: Select your saved Task and set your desired frequency (e.g., every 15 minutes, every hour).

***

### ⚙️ Technical Specifications & Permissions

- **Tech Stack**: Built with TypeScript, Apify SDK v3, Crawlee, and Playwright.
- **Permissions**: Requires standard **Limited Permissions**. Does not require full account access.
- **State Storage**: Uses persistent named Key-Value Stores (`reddit-monitor-sub-{subreddit}`) to preserve checkpoint state across scheduled runs.

***

### ❌ Out of Scope / Limitations

To maintain high speed, low cost, and stability, this Actor does **NOT**:

- Monitor post comments or comment threads.
- Support multiple subreddits simultaneously (create multiple Apify Tasks for multiple subreddits).
- Perform historical catch-up scraping.
- Use AI, regex syntax in input keywords, or semantic search.

# Actor input Schema

## `subreddit` (type: `string`):

The subreddit to monitor. Accepts raw name (e.g. 'webscraping'), r/ format ('r/webscraping'), or full URL ('https://www.reddit.com/r/webscraping').

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

List of keywords to search for in post titles and body text. Whole-word matching is enforced (case-insensitive).

## `notificationEmail` (type: `string`):

Required email address to receive alert notifications. NOTE: Free Apify accounts can ONLY send emails to their registered Apify account email address. Paid accounts can send to any external email address.

## `webhookUrl` (type: `string`):

Optional HTTP endpoint to receive a JSON POST payload whenever a matching post is found.

## Actor input object example

```json
{
  "subreddit": "webscraping",
  "keywords": [
    "apify",
    "crawlee",
    "playwright"
  ]
}
```

# Actor output Schema

## `title` (type: `string`):

The title of the Reddit post.

## `matchedKeywords` (type: `string`):

Keywords that matched in this post.

## `url` (type: `string`):

Direct link to the Reddit post discussion thread.

## `createdAt` (type: `string`):

ISO 8601 timestamp when the post was created on Reddit.

## `id` (type: `string`):

Unique Reddit post identifier.

## `selfText` (type: `string`):

Full self-text content of the post.

# 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 = {
    "subreddit": "webscraping",
    "keywords": [
        "apify",
        "crawlee",
        "playwright"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("realistic_jackpot/subreddit-monitor-real-time-reddit-post-keyword-tracker").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 = {
    "subreddit": "webscraping",
    "keywords": [
        "apify",
        "crawlee",
        "playwright",
    ],
}

# Run the Actor and wait for it to finish
run = client.actor("realistic_jackpot/subreddit-monitor-real-time-reddit-post-keyword-tracker").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 '{
  "subreddit": "webscraping",
  "keywords": [
    "apify",
    "crawlee",
    "playwright"
  ]
}' |
apify call realistic_jackpot/subreddit-monitor-real-time-reddit-post-keyword-tracker --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/acts/j0Bw8Q1h9gmZCIn0A/builds/nXorL6wEkzeeWrkXb/openapi.json
