# 🟠 Reddit Subreddit Scraper (`skootle/reddit-subreddit-monitor`) Actor

Scrape posts and comments from any subreddit. Get title, body, author, score, upvote ratio, comments, awards, flair, ISO timestamps, AI-ready markdown. Watchlist mode emits only new records since last run. Export, run via API, schedule, or integrate with other tools.

- **URL**: https://apify.com/skootle/reddit-subreddit-monitor.md
- **Developed by:** [Skootle](https://apify.com/skootle) (community)
- **Categories:** Social media, AI, News
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.50 / 1,000 reddit post or comment records

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## 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 Subreddit Scraper hero](https://raw.githubusercontent.com/kesjam/skootle-actors-assets/main/heroes/reddit-monitor.png)

### TL;DR

Monitor any subreddit for new posts and comments. Returns clean structured JSON: title, body, score, upvote ratio, comment count, awards, author karma + account age, ISO timestamps. Watchlist mode emits only NEW records since the previous run, so daily schedules become a clean diff feed. Built on Reddit's public listing endpoints. No Reddit OAuth required. Premium tier $0.015/record at GOLD.

---

<!-- skootle:review-cta -->
> Try it on a small dataset, then let us know what you think in a [review](https://apify.com/skootle/reddit-subreddit-monitor/reviews).

---

### What does Reddit Subreddit Monitor do?

Reddit Subreddit Monitor extracts posts and comments from any subreddit you specify. You give it a list of subreddits and a sort order (`new`, `hot`, `top`, `best`, `rising`, `controversial`); it returns clean, agent-ready JSON for every post: title, body, author, score, upvote ratio, comment count, awards, post type (image, video, gallery, link, self-post), flair, ISO timestamps, and a 300-500 character markdown summary you can drop straight into an LLM context.

Comments are optional. With `fetchComments: true`, the actor walks the full comment tree per post (configurable depth, max 500 per post) and emits one record per comment with depth, parent linkage, body, score, and author info.

Watchlist mode (`watchlistMode: true`) makes this scraper schedulable. State persists across runs in the actor's key-value store, so a daily cron only emits posts and comments NEW since the last run.

### Why scrape Reddit?

Reddit is the largest open community-content corpus on the internet, and almost every niche, brand, sentiment, and trend has a dedicated subreddit. Resellers monitor product subreddits for buying intent. AI teams build training corpora from r/explainlikeimfive, r/MachineLearning, r/programming. Brand teams watch for crisis signals on r/all and industry subreddits. Recruiters mine r/cscareerquestions for hiring intent. Investors track sentiment on r/wallstreetbets, r/stocks, r/CryptoCurrency.

The data is public. The Reddit API has tight rate limits and demands a registered Reddit account; this actor uses the same public listing endpoints your browser hits, with proper rate limiting and a compliant User-Agent, so you don't have to manage Reddit credentials or worry about API quotas.

### Who needs this?

- **AI / LLM teams** building training corpora, RAG sources, or fine-tuning datasets from high-quality discourse
- **Brand monitoring teams** watching for new mentions of their products on subreddits where their customers actually live
- **Market researchers** tracking sentiment on niche subreddits over time (`watchlistMode: true` + a daily schedule)
- **Recruiters and DevRel** scanning industry subreddits for hiring or product-launch signals
- **Investors and traders** mining r/wallstreetbets, r/stocks, r/CryptoCurrency, r/options for sentiment shifts
- **AI agent builders** (Claude, ChatGPT, Cursor, n8n, Make.com) feeding agents a steady stream of normalized Reddit data

### How to use Reddit Subreddit Monitor

1. Open the **Input** tab on the actor page
2. Add one or more subreddit names to the `subreddits` field (without the `r/` prefix; the actor strips it if you include it)
3. Pick a sort order (`new` is the default; use `top` with `timeFilter: 'week'` for the week's best)
4. Set `postsPerSubreddit` (1-100; default 10) and `maxItems` (default 50, conservative for the 5-minute auto-test)
5. Optionally enable `fetchComments` and set `commentsPerPost` if you want comment threads
6. Optionally enable `watchlistMode` for daily scheduled runs that only return new records
7. Click **Start** or call the actor via the Apify REST API or the Apify CLI

You can run this scraper on demand from the Console, schedule it (Apify lets you schedule any actor with cron), call it via API, integrate with Make, Zapier, n8n, Slack, Google Sheets, or pipe it directly into a Claude or ChatGPT custom agent.

### How much will scraping Reddit cost?

This actor is priced per event. Two events:

- **Actor Start**: $0.01 once per run
- **Reddit record (post or comment)**: tiered, charged per record written

| Apify plan | $/1000 records |
|---|---|
| FREE | $25.00 |
| BRONZE | $21.25 |
| SILVER | $17.50 |
| GOLD | $15.00 |
| PLATINUM | $15.00 |
| DIAMOND | $13.50 |

A typical daily watchlist run on 5 subreddits with `postsPerSubreddit: 25` returns ~125 records (or fewer in watchlist mode after the first run): roughly $1.88 per run on the GOLD plan, less on PLATINUM/DIAMOND.

You only pay for records actually saved. If a subreddit's listing fails or returns nothing, you don't pay for empty.

### Is it legal to scrape Reddit?

Yes, with caveats: this actor only accesses publicly accessible subreddits and public posts (the same data anyone can read in a browser without logging in). It does not access NSFW or quarantined content gated behind logged-in walls; it does not authenticate as a Reddit account; it does not return private messages, modmail, or moderator-only data; it does not bypass any technical access control.

You are responsible for how you use the scraped data. Reddit's content is licensed under Reddit's [User Agreement](https://www.redditinc.com/policies/user-agreement) and individual users retain rights to their own content. For commercial redistribution of Reddit content (reselling raw posts), consult Reddit's API terms and your legal counsel. For personal research, AI training, brand monitoring, internal analytics, and similar uses, the scraped data is generally treated the same as any other public web content.

### Examples

#### Example 1: Monitor r/programming for new posts

```json
{
  "subreddits": ["programming"],
  "sort": "new",
  "postsPerSubreddit": 25,
  "maxItems": 25
}
````

#### Example 2: Top 50 from r/MachineLearning this week

```json
{
  "subreddits": ["MachineLearning"],
  "sort": "top",
  "timeFilter": "week",
  "postsPerSubreddit": 50,
  "maxItems": 50
}
```

#### Example 3: Daily watchlist across 3 finance subreddits

```json
{
  "subreddits": ["wallstreetbets", "stocks", "options"],
  "sort": "new",
  "watchlistMode": true,
  "postsPerSubreddit": 30,
  "maxItems": 90
}
```

Schedule this with the Apify scheduler at `0 14 * * *` (daily at 14:00 UTC). The first run captures everything; subsequent runs only emit posts new since the previous run.

#### Example 4: Brand mention monitoring across niche subreddits

```json
{
  "subreddits": ["SaaS", "Entrepreneur", "smallbusiness", "marketing"],
  "sort": "new",
  "watchlistMode": true,
  "maxItems": 100
}
```

Run daily, pipe the output to a Claude agent that scores each post for "mentions our brand" and routes hits to Slack.

#### Example 5: Pull comments for top 5 posts on r/AskHistorians

```json
{
  "subreddits": ["AskHistorians"],
  "sort": "top",
  "timeFilter": "week",
  "postsPerSubreddit": 5,
  "fetchComments": true,
  "commentsPerPost": 100,
  "maxItems": 505
}
```

#### Example 6: Crisis-signal early-warning on r/all

```json
{
  "subreddits": ["all"],
  "sort": "rising",
  "watchlistMode": true,
  "postsPerSubreddit": 50
}
```

Run every 30 minutes; alert when a new post matches your brand keyword. The `rising` sort picks posts gaining momentum fast.

#### Example 7: Build an AI training corpus from r/explainlikeimfive

```json
{
  "subreddits": ["explainlikeimfive"],
  "sort": "top",
  "timeFilter": "month",
  "postsPerSubreddit": 100,
  "fetchComments": true,
  "commentsPerPost": 50,
  "maxItems": 5100
}
```

Run weekly; accumulate 20-50K labeled question-and-explanation pairs per month for fine-tuning.

#### Example 8: Hiring-signal scanner on r/cscareerquestions

```json
{
  "subreddits": ["cscareerquestions", "ExperiencedDevs", "ITCareerQuestions"],
  "sort": "new",
  "watchlistMode": true,
  "postsPerSubreddit": 25
}
```

Pipe into a recruiter inbox: filter for posts mentioning "looking for" or "where should I apply".

### Input parameters

| Field | Type | Default | Description |
|---|---|---|---|
| `subreddits` | string\[] | `["programming"]` | Subreddit names without `r/` prefix. One run handles many. |
| `sort` | enum | `new` | `new`, `hot`, `top`, `best`, `rising`, `controversial` |
| `timeFilter` | enum | `day` | Window for `top`/`controversial`: `hour`, `day`, `week`, `month`, `year`, `all` |
| `postsPerSubreddit` | int | `10` | 1-100 |
| `fetchComments` | bool | `false` | Walks the comment tree per post |
| `commentsPerPost` | int | `0` | Hard cap on comments per post (max 500) |
| `watchlistMode` | bool | `false` | Idempotent diff against KV-stored seen IDs |
| `maxItems` | int | `50` | Hard cap on total records (posts + comments) |
| `useApifyProxy` | bool | `true` | Apify residential proxy. Recommended. |
| `apifyProxyGroups` | string\[] | `["RESIDENTIAL"]` |  |

### Reddit output format

The dataset has two record types. Filter by `recordType`.

#### `reddit_post`

| Field | Type | Description |
|---|---|---|
| `outputSchemaVersion` | string | Versioned schema literal (`'2026-05-08'`) |
| `recordType` | literal | `'reddit_post'` |
| `recordId` | string | `reddit:post:<postId>` (idempotent, cross-run dedupe-friendly) |
| `postId`, `fullname` | string | Reddit's `t3_<id>` IDs |
| `url`, `permalinkPath` | string | Direct URL + canonical path |
| `title` | string | Post title |
| `selftext`, `selftextHtml` | string | Body text (markdown + HTML) |
| `subreddit`, `subredditId`, `subredditSubscribers` | string/int | Subreddit context |
| `author` | object | `{ username, fullname, isPremium, flairText }` |
| `createdAt`, `scrapedAt` | ISO 8601 | Standard timestamps |
| `score`, `ups`, `downs`, `upvoteRatio` | number | Engagement (`upvoteRatio` is 0-1 float) |
| `numComments`, `totalAwards`, `gilded` | int | Engagement counts |
| `media` | object | `{ type (image/video/gallery/link/self), url, thumbnail, domain }` |
| `isVideo`, `isSelf`, `isOriginalContent` | bool | Post-type flags |
| `isPinned`, `isStickied`, `isLocked`, `isArchived`, `isOver18`, `isSpoiler` | bool | Mod/state flags |
| `linkFlairText`, `linkFlairBackgroundColor` | string | Flair |
| `fieldCompletenessScore` | int 0-100 | Self-filtering signal |
| `agentMarkdown` | string | 300-500 char LLM-ready summary |

#### `reddit_comment`

| Field | Type | Description |
|---|---|---|
| `outputSchemaVersion`, `recordType`, `recordId` | string | Discriminated identity |
| `commentId`, `fullname`, `url`, `permalinkPath` | string | Reddit IDs |
| `postId`, `parentId`, `depth` | string/int | Tree linkage |
| `body`, `bodyHtml` | string | Markdown + HTML body |
| `subreddit`, `subredditId` | string | Subreddit |
| `author` | object | `{ username, fullname, isPremium, flairText }` |
| `createdAt`, `scrapedAt` | ISO 8601 | Timestamps |
| `score`, `ups`, `downs`, `totalAwards`, `gilded` | int | Engagement |
| `isSubmitter`, `isStickied`, `isControversial`, `edited` | bool | Status flags |
| `fieldCompletenessScore`, `agentMarkdown` | int / string | Quality signals |

#### Reddit scraper output example (post)

```json
{
  "outputSchemaVersion": "2026-05-08",
  "recordType": "reddit_post",
  "recordId": "reddit:post:1t7qsfi",
  "postId": "1t7qsfi",
  "url": "https://www.reddit.com/r/programming/comments/1t7qsfi/...",
  "title": "How database work pulls you deep into systems engineering",
  "subreddit": "programming",
  "subredditSubscribers": 6874584,
  "author": { "username": "clairegiordano", "isPremium": false, "flairText": null },
  "createdAt": "2026-05-08T19:42:53.000Z",
  "score": 234,
  "upvoteRatio": 0.94,
  "numComments": 89,
  "media": { "type": "link", "url": "https://talkingpostgres.com/...", "domain": "talkingpostgres.com" },
  "isSelf": false,
  "linkFlairText": null,
  "fieldCompletenessScore": 92,
  "agentMarkdown": "**🟠 r/programming · How database work pulls you deep into systems engineering**\n- ⬆ 234 · 94% · 💬 89\n- 👤 u/clairegiordano\n- 👥 6.9M subscribers\n- 📅 posted 2026-05-08\n- 🔗 https://talkingpostgres.com/...",
  "scrapedAt": "2026-05-08T22:30:00.000Z"
}
```

#### Reddit scraper output example (comment)

```json
{
  "outputSchemaVersion": "2026-05-08",
  "recordType": "reddit_comment",
  "recordId": "reddit:comment:k7q2xyz",
  "commentId": "k7q2xyz",
  "postId": "1t7qsfi",
  "parentId": "1t7qsfi",
  "depth": 0,
  "body": "Great talk. The MemSQL → HorizonDB story is wild.",
  "subreddit": "programming",
  "author": { "username": "dbnerd", "isPremium": false, "flairText": null },
  "createdAt": "2026-05-08T20:12:15.000Z",
  "score": 17,
  "fieldCompletenessScore": 100,
  "agentMarkdown": "**💬 HN comment by u/dbnerd** (depth 0)\n> Great talk. The MemSQL → HorizonDB story is wild.\n- 🔗 https://www.reddit.com/r/programming/comments/1t7qsfi/_/k7q2xyz/"
}
```

### During the Actor run

Each subreddit is fetched serially with a 1.1-second delay between requests (well under Reddit's published 60 requests/minute unauthenticated limit). When `fetchComments` is enabled, comment threads are walked depth-first per post, capped at `commentsPerPost` per post.

Each record is validated against a Zod schema before push. Validation failures, parse errors, and fetch errors are tracked in counters; you'll see them in the run summary OUTPUT object alongside the success counts.

The actor writes three things to its key-value store:

1. **`OUTPUT`** — compact run summary: subreddits queried, posts saved, comments saved, watchlist deltas, error counts, finished timestamp
2. **`AGENT_BRIEFING`** — markdown digest with the top 5 posts and top 5 comments by score, ready to paste into an LLM context
3. **`WATCHLIST_STATE`** — (only when `watchlistMode: true`) the seen post and comment IDs, capped at 5,000 each, used to compute the next run's diff

### FAQ

#### How does Reddit Subreddit Monitor work?

The actor calls Reddit's public listing endpoints (`reddit.com/r/<subreddit>/<sort>.json`) with a Reddit-compliant User-Agent, parses the response, normalizes each post into a versioned Zod schema, and pushes the records to your dataset. Optionally walks the comment tree for each post via `reddit.com/r/<subreddit>/comments/<postId>.json`.

#### Can I scrape multiple subreddits in one run?

Yes. Pass an array to `subreddits`. The actor iterates each one in order, with rate limiting between requests.

#### Can I monitor a subreddit for new posts only?

Yes. Set `watchlistMode: true`. The first run emits everything; subsequent runs emit only posts new since the previous run. Schedule with the Apify cron scheduler.

#### Can I get comments along with posts?

Yes. Set `fetchComments: true` and `commentsPerPost` to the cap you want (max 500 per post tree). One additional request per post, walked depth-first.

#### Can I use this with the Apify API?

Yes. Every Apify actor exposes a REST API: `POST https://api.apify.com/v2/acts/skootle~reddit-subreddit-monitor/runs` with your input as JSON body and your Apify API token as the `Authorization: Bearer` header. Full API docs are linked from the actor page.

#### Can I integrate this with Make / Zapier / n8n / Slack?

Yes. Apify provides native integrations for all of these. From the actor page, click **Integrations** and pick your destination.

#### Can I use this scraper as a Reddit API replacement?

For most read-only use cases on public subreddits, yes. Caveats: this actor does not return private content, modmail, or anything requiring an authenticated Reddit session, and it doesn't write (no posting, no voting, no commenting).

#### Can I increase the speed?

The actor rate-limits itself to 1.1 seconds between Reddit requests to stay under Reddit's published throttle. Reddit will block aggressive callers; this is the throttle that keeps reliability above 99%.

#### Can I get Reddit data in Python / JavaScript / TypeScript?

Yes. The output is plain JSON in an Apify dataset. Pull it via the Apify Python or JavaScript clients, the REST API, or by exporting from the Console as CSV/JSONL/Excel.

#### Can the actor return one comment per row?

Yes — that's the default with `fetchComments: true`. Each comment is a separate record. Filter on `recordType: 'reddit_comment'` to isolate the comment rows.

#### What if Reddit changes its layout?

This actor uses Reddit's stable public JSON endpoints (the same ones their own apps use), not HTML scraping. Reddit changes the endpoints rarely; when they do, the actor adapts within 24-48 hours. Issues are tracked on the actor page and resolved fast.

#### Why does this actor cost more than a free Reddit scraper?

Free actors trade reliability and feature depth for cost. This actor ships a versioned schema, idempotent record IDs (so cross-run dedupe just works), `agentMarkdown` for direct LLM consumption, watchlist diff mode, normalized author + media objects, ISO 8601 timestamps, and continuous maintenance. If you're feeding the data into an automated pipeline or AI agent, those features pay back the per-record cost in saved engineering hours.

#### Your feedback

Hit a bug or want a feature? Open an issue on the [Issues tab](https://apify.com/skootle/reddit-subreddit-monitor/issues/open) rather than the reviews page, and we'll fix it fast (typically within 48 hours).

### Why choose Reddit Subreddit Monitor

- **Agent-grade by design**: every record carries `agentMarkdown` (300-500 chars) and a `fieldCompletenessScore` (0-100), so AI agents can self-filter and consume records directly without wrapping logic
- **Watchlist diff mode**: only emits NEW records since the last run; safe to schedule daily without paying for duplicates
- **Versioned schema**: `outputSchemaVersion: '2026-05-08'` literal on every record; never break a downstream pipeline
- **Idempotent record IDs**: `reddit:post:<id>` and `reddit:comment:<id>` are stable across runs, so cross-run dedupe is trivial
- **Author profile join**: posts carry `author.{username, fullname, isPremium, flairText}` so trust filtering is one field away
- **Discriminated union**: posts and comments share one dataset (`recordType: 'reddit_post' | 'reddit_comment'`), filterable downstream
- **No Reddit OAuth required**: uses Reddit's public listing endpoints with a compliant User-Agent
- **Continuous maintenance**: when Reddit changes its layout, the actor adapts within 24-48 hours

### Other Skootle actors you might want to check

- **[Hacker News Watchlist](https://apify.com/skootle/hackernews-watchlist)** — same agent-grade pattern, applied to HN top/new/best/ask/show/jobs streams. Pairs well with this actor for tech-adjacent monitoring.
- **[SEC EDGAR Filings Monitor](https://apify.com/skootle/sec-edgar-filings)** — financial-filing watchlist (10-K, 10-Q, 8-K, S-1) for any public company by ticker or CIK.
- **[Shopify App Store Scraper](https://apify.com/skootle/shopify-app-store-scraper)** — Shopify app listings with rating, review count, pricing tiers, BFS badge.
- **[Apple App Store Reviews Monitor](https://apify.com/skootle/app-store-reviews)** — App Store reviews + app metadata, watchlist-mode for negative-review triage.
- **[GitHub Trending Repos](https://apify.com/skootle/github-trending)** — daily/weekly/monthly trending repos with API enrichment (license, topics, watchers).

### Support and contact

File issues directly on this actor's page (Issues tab) — replies within 48 hours. For feature requests, drop them in the same issue tracker tagged `enhancement`.

# Actor input Schema

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

Subreddit names without the r/ prefix (the actor strips it if you include it). One run handles many subreddits.

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

How to sort the listing.

## `timeFilter` (type: `string`):

Window for top/controversial sorts.

## `postsPerSubreddit` (type: `integer`):

How many posts to fetch per subreddit (1 to 100).

## `fetchComments` (type: `boolean`):

When enabled, fetches the comment thread for each post. Adds one request per post and produces additional records.

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

Hard cap on comments fetched per post tree. Reddit returns up to 500.

## `watchlistMode` (type: `boolean`):

When true, only emit records NEW since the previous run. State persists in the key-value store.

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

Hard cap on total records (posts + comments) saved. Default is conservative for the 5-minute auto-test.

## `useApifyProxy` (type: `boolean`):

Apify residential proxy. Recommended for production to avoid Reddit rate-limiting.

## `apifyProxyGroups` (type: `array`):

RESIDENTIAL recommended.

## Actor input object example

```json
{
  "subreddits": [
    "programming"
  ],
  "sort": "new",
  "timeFilter": "day",
  "postsPerSubreddit": 10,
  "fetchComments": false,
  "commentsPerPost": 0,
  "watchlistMode": false,
  "maxItems": 50,
  "useApifyProxy": true,
  "apifyProxyGroups": [
    "RESIDENTIAL"
  ]
}
```

# Actor output Schema

## `datasetItems` (type: `string`):

Reddit posts and comments. Discriminate by recordType.

## `agentBriefing` (type: `string`):

Markdown digest with top 5 posts and top 5 comments by score.

## `runSummary` (type: `string`):

Compact OUTPUT object with row counts and per-stage error counts.

# 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": [
        "programming"
    ],
    "apifyProxyGroups": [
        "RESIDENTIAL"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("skootle/reddit-subreddit-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": ["programming"],
    "apifyProxyGroups": ["RESIDENTIAL"],
}

# Run the Actor and wait for it to finish
run = client.actor("skootle/reddit-subreddit-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": [
    "programming"
  ],
  "apifyProxyGroups": [
    "RESIDENTIAL"
  ]
}' |
apify call skootle/reddit-subreddit-monitor --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "🟠 Reddit Subreddit Scraper",
        "description": "Scrape posts and comments from any subreddit. Get title, body, author, score, upvote ratio, comments, awards, flair, ISO timestamps, AI-ready markdown. Watchlist mode emits only new records since last run. Export, run via API, schedule, or integrate with other tools.",
        "version": "0.1",
        "x-build-id": "Dq4qRMjTUTyEsNgI8"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/skootle~reddit-subreddit-monitor/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-skootle-reddit-subreddit-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/skootle~reddit-subreddit-monitor/runs": {
            "post": {
                "operationId": "runs-sync-skootle-reddit-subreddit-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/skootle~reddit-subreddit-monitor/run-sync": {
            "post": {
                "operationId": "run-sync-skootle-reddit-subreddit-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",
                "properties": {
                    "subreddits": {
                        "title": "Subreddits to monitor",
                        "type": "array",
                        "description": "Subreddit names without the r/ prefix (the actor strips it if you include it). One run handles many subreddits.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "sort": {
                        "title": "Sort order",
                        "enum": [
                            "new",
                            "hot",
                            "top",
                            "rising",
                            "controversial"
                        ],
                        "type": "string",
                        "description": "How to sort the listing.",
                        "default": "new"
                    },
                    "timeFilter": {
                        "title": "Time filter (only used for 'top' or 'controversial')",
                        "enum": [
                            "hour",
                            "day",
                            "week",
                            "month",
                            "year",
                            "all"
                        ],
                        "type": "string",
                        "description": "Window for top/controversial sorts.",
                        "default": "day"
                    },
                    "postsPerSubreddit": {
                        "title": "Posts per subreddit",
                        "minimum": 1,
                        "maximum": 100,
                        "type": "integer",
                        "description": "How many posts to fetch per subreddit (1 to 100).",
                        "default": 10
                    },
                    "fetchComments": {
                        "title": "Fetch comments per post",
                        "type": "boolean",
                        "description": "When enabled, fetches the comment thread for each post. Adds one request per post and produces additional records.",
                        "default": false
                    },
                    "commentsPerPost": {
                        "title": "Comments per post (max)",
                        "minimum": 0,
                        "maximum": 500,
                        "type": "integer",
                        "description": "Hard cap on comments fetched per post tree. Reddit returns up to 500.",
                        "default": 0
                    },
                    "watchlistMode": {
                        "title": "Watchlist mode (idempotent diff)",
                        "type": "boolean",
                        "description": "When true, only emit records NEW since the previous run. State persists in the key-value store.",
                        "default": false
                    },
                    "maxItems": {
                        "title": "Max total records",
                        "minimum": 1,
                        "maximum": 10000,
                        "type": "integer",
                        "description": "Hard cap on total records (posts + comments) saved. Default is conservative for the 5-minute auto-test.",
                        "default": 50
                    },
                    "useApifyProxy": {
                        "title": "Use Apify proxy",
                        "type": "boolean",
                        "description": "Apify residential proxy. Recommended for production to avoid Reddit rate-limiting.",
                        "default": true
                    },
                    "apifyProxyGroups": {
                        "title": "Apify proxy groups",
                        "type": "array",
                        "description": "RESIDENTIAL recommended.",
                        "items": {
                            "type": "string"
                        }
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
