# Reddit Scraper Pro (`webdatalabs/reddit-scraper-pro`) Actor

Reddit scraper for automation workflows. Track keywords across Reddit or inside chosen communities, monitor subreddits, score posts with AFINN sentiment and pull full comment threads. Flat JSON - title, body, author, subreddit, score, flair, timestamps, matched keywords - for n8n and Zapier.

- **URL**: https://apify.com/webdatalabs/reddit-scraper-pro.md
- **Developed by:** [WebDataLabs](https://apify.com/webdatalabs) (community)
- **Categories:** Social media, News, AI
- **Features:** Limited permissions
- **Stats:** 208 total users, 5 monthly users, 61.1% runs succeeded, 0 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $4.00 / 1,000 post ingesteds

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/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

## Reddit Scraper Pro - Posts, Comments & Sentiment Analysis

**Reddit scraper built for scheduled automation.** Monitor subreddits, track keywords with sentiment analysis, scrape comments, and integrate with n8n or Zapier.

[![Apify Actor](https://img.shields.io/badge/Apify-Actor-blue)](https://apify.com)
[![Automation](https://img.shields.io/badge/Automation-First-orange)]()

### ✨ Key Features

- **🎯 Rate limiting and backoff** - Request throttling with exponential backoff against Reddit's limits, with automatic Apify Unblocker routing
- **🔄 State Management** - No duplicate posts across scheduled runs (tracks 10k recent post IDs)
- **📊 Sentiment Analysis** - Built-in NLP using AFINN-165 (positive/negative/neutral classification)
- **🔔 Webhook Integration** - Direct n8n/Zapier support for real-time alerts
- **💬 Comment Scraping** - Configurable depth (0-5 levels) for deep analysis
- **💰 Predictable Pricing** - Transparent pay-per-post model (see current pricing in the Apify Console when starting a run)
- **⚡ Incremental Scraping** - Only fetch new posts since last run for efficient scheduled automation

### 🎯 Use Cases

#### Brand Monitoring with Sentiment Analysis

```json
{
  "searchMode": "keyword",
  "keywords": ["YourBrand", "YourProduct"],
  "subreddits": ["webdev", "SaaS"],
  "analyzeSentiment": true,
  "webhookUrl": "https://n8n.io/webhook/reddit-alerts",
  "maxAgeHours": 24
}
```

**Result:** Daily alerts when your brand is mentioned, with sentiment context (positive/negative/neutral).

#### Subreddit Monitoring for New Posts

```json
{
  "searchMode": "subreddit",
  "subreddits": ["webdev", "programming", "javascript"],
  "maxItemsPerSubreddit": 100,
  "minUpvotes": 10,
  "maxAgeHours": 24
}
```

**Result:** Daily scrape of high-quality posts (10+ upvotes) from last 24 hours. Schedule every 24 hours.

#### Competitor Tracking Across Reddit

```json
{
  "searchMode": "keyword",
  "keywords": ["Competitor1", "Competitor2"],
  "subreddits": ["webdev", "SaaS", "startups"],
  "minUpvotes": 5,
  "analyzeSentiment": true,
  "includeComments": true,
  "commentDepth": 1
}
```

**Result:** Track competitor mentions with engagement metrics, sentiment, and top-level comments.

#### Trend Analysis with Comments

```json
{
  "searchMode": "keyword",
  "keywords": ["AI", "ChatGPT", "GPT-4", "Claude"],
  "maxItemsPerSubreddit": 500,
  "analyzeSentiment": true,
  "includeComments": true,
  "commentDepth": 2
}
```

**Result:** Deep analysis of AI trends with comment discussions (2 levels deep).

### 📥 Input Configuration

#### Quick Start (Default Settings)

Just click "Start" to test with default configuration:

```json
{
  "searchMode": "keyword",
  "keywords": ["AI", "ChatGPT", "web scraping"],
  "subreddits": ["webdev", "programming", "technology"],
  "maxItemsPerSubreddit": 50
}
```

#### Search Modes

**1. Keyword Search** (recommended for automation)
Search all of Reddit (or specific subreddits) for keywords:

```json
{
  "searchMode": "keyword",
  "keywords": ["Apify", "web scraping"],
  "subreddits": ["webdev", "programming"]
}
```

Leave `subreddits` empty to search **all of Reddit**.

**2. Subreddit Monitoring** (`subreddits` is **required** in this mode)
Work inside specific communities:

```json
{
  "searchMode": "subreddit",
  "subreddits": ["webdev", "javascript"],
  "keywords": ["Apify"]
}
```

- **With keywords** - each community is searched for your keywords through Reddit's own search, which matches **post titles and post bodies**. Multi-word keywords are searched as a phrase. Results come back newest-first.
- **Without keywords** - you simply get the newest posts of each community.
- `keywords_matched` on every row tells you which of your keywords literally appear in that post; an empty list means Reddit's search returned it as a related match.

#### Which mode should I use?

Pick **Keyword Search** when you care about a *topic or brand wherever it appears*; pick **Subreddit Monitoring** when you care about *everything happening in specific communities*.

| Your goal | Mode | Example input |
|-----------|------|---------------|
| Every mention of your brand across Reddit | Keyword | `keywords: ["YourBrand"]`, `subreddits: []` |
| A keyword, but only inside certain subreddits | Keyword | `keywords: ["ChatGPT"]`, `subreddits: ["programming"]` |
| Posts about a phrase inside certain communities | Subreddit | `subreddits: ["webdev"]`, `keywords: ["dark mode bug"]` |
| Everything new in your communities | Subreddit | `subreddits: ["django", "flask"]` |

#### Essential Parameters

| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `searchMode` | enum | `"keyword"` | `keyword` or `subreddit` |
| `keywords` | array | `["AI", "ChatGPT", ...]` | Keywords to search/filter |
| `subreddits` | array | `["webdev", ...]` | Subreddits to monitor (without "r/") |
| `maxItemsPerSubreddit` | integer | `50` | Hard cap on posts fetched, saved **and charged** — per subreddit in subreddit mode, per keyword x subreddit in keyword mode (1-10,000) |
| `includeAuthorNames` | boolean | `true` | Include the `author` username on posts and comments. Turn off to leave usernames out. |
| `searchSort` | enum | `"relevance"` | Keyword-mode sort only; subreddit mode always fetches newest-first |
| `minUpvotes` | integer | `0` | Minimum upvotes filter (0 = keep everything) |
| `maxAgeHours` | integer | `0` | Max post age in hours (0 = no age limit; 168 = 7 days) |
| `includeComments` | boolean | `false` | Fetch comment threads and paginate replies up to `commentDepth`; large threads require extra requests |
| `commentDepth` | integer | `1` | Comment reply depth (0 = top-level only, up to 5) |
| `analyzeSentiment` | boolean | `true` | Enable sentiment analysis |
| `dedupeAcrossRuns` | boolean | `false` | Remember delivered posts between scheduled runs and never re-charge them |
| `webhookUrl` | string | - | POST results to this URL |

#### Advanced Filtering

Control data quality with filters:

```json
{
  "minUpvotes": 10,
  "maxAgeHours": 24,
  "includeComments": true,
  "commentDepth": 2
}
```

### 📤 Output Schema

Each post includes **comprehensive metadata**:

```json
{
  "id": "01HQZX9K3P2VQWE8RTGBNM4567",
  "platform": "reddit",
  "type": "post",
  "reddit_id": "abc123",
  "subreddit": "webdev",
  "subreddit_prefixed": "r/webdev",

  "title": "Amazing new web scraping tool",
  "body": "Just discovered Apify and it's incredible...",
  "author": "username",
  "url": "https://apify.com",
  "reddit_url": "https://www.reddit.com/r/webdev/comments/...",

  "score": 156,
  "upvotes": 180,
  "num_comments": 42,
  "gilded": 2,

  "sentiment_score": 5.2,
  "sentiment_comparative": 0.35,
  "sentiment_label": "positive",

  "keywords_matched": ["Apify"],
  "created_utc": "2025-10-16T10:00:00Z",
  "flair": "Discussion",

  "comments": [...],

  "ingest_meta": {
    "first_seen_at": "2025-10-16T11:00:00Z",
    "scrape_run_id": "...",
    "actor_run_id": "..."
  }
}
```

#### Leaving out author usernames

Author usernames are included by default. A Reddit username is personal data, so if you don't need
it, set `includeAuthorNames` to `false`: the `author` key is then left out of the post record and of
every comment and reply - it is not set to `null`. Everything else - the other fields, the number of
posts and the price per post - is the same either way.

#### Sentiment Analysis Fields

- **sentiment_score**: AFINN score (-5 to +5, 0 = neutral)
- **sentiment_comparative**: Normalized score per word
- **sentiment_label**: `positive`, `negative`, or `neutral`

**Example Sentiment Interpretation:**

- `sentiment_score: 5.2, label: "positive"` → Very positive post
- `sentiment_score: -3.8, label: "negative"` → Negative sentiment
- `sentiment_score: 0.5, label: "neutral"` → Neutral/mixed

### 📊 Dataset Views in Apify Console

The actor provides **3 optimized views**:

1. **Overview** - Main view with 8 key fields (title, subreddit, author, score, comments, sentiment, date, link)
2. **Engagement & Sentiment** - Combined metrics for deeper insights (score, upvote ratio, awards, sentiment)
3. **Full Details** - Complete dataset with all 43 fields for advanced analysis

### 🔗 Webhook Integration

#### n8n Workflow Example

1. **Create webhook trigger in n8n**
2. **Configure Reddit Scraper Pro:**

```json
{
  "searchMode": "keyword",
  "keywords": ["YourBrand"],
  "webhookUrl": "https://your-n8n.com/webhook/reddit",
  "analyzeSentiment": true
}
```

3. **Process in n8n:**
   - Filter by sentiment: `sentiment_label === "negative"`
   - Send negative mentions to Slack/email
   - Store all results in Airtable/Google Sheets
   - Create follow-up tasks in ClickUp/Asana

#### Zapier Workflow Example

Use Zapier's "Webhook by Zapier" trigger with the `webhookUrl` configuration.

#### Webhook Payload (Batch Mode)

Results are sent at the end of each run:

```json
{
  "type": "batch",
  "timestamp": "2025-10-16T11:00:00Z",
  "runId": "abc123",
  "posts": [
    { /* post 1 */ },
    { /* post 2 */ }
  ],
  "stats": {
    "totalPosts": 42,
    "totalComments": 180,
    "keywordMatches": 38,
    "sentimentDistribution": {
      "positive": 15,
      "negative": 8,
      "neutral": 19
    }
  }
}
```

### 🔄 Incremental Scraping (opt-in)

Set `dedupeAcrossRuns: true` to make scheduled monitoring incremental:

- **No duplicates** - posts already delivered by an earlier run are skipped and **not charged again**
- **Scoped per target** - state is keyed by your search mode + subreddits + keywords, so different monitors do not interfere
- **Bounded** - the last 10,000 post IDs are remembered

**How it works:**

1. First run: saves the delivered post IDs
2. Next run with the same subreddits/keywords: skips the ones already delivered
3. A repeat run can therefore legitimately return **zero new posts** — the run log and the `OUTPUT` record say so explicitly

Leave it off (the default) for one-off runs where you want the full result set every time.

### 🧾 Run outcome record (`OUTPUT`)

Every run writes an `OUTPUT` record to its key-value store with `status`
(`SUCCESS` / `PARTIAL` / `NO_RESULTS` / `FAILED`), how many posts were fetched vs
actually saved, per-target results, and exactly why anything was dropped
(too old, below the upvote floor, duplicate, not reached before the timeout). A run
that finds nothing says which input found nothing and why — it never reports success
over an empty dataset.

Posts are stored in small batches as they are read, so a run that reaches its timeout
keeps everything stored so far and ends as `PARTIAL` with a count of what it did not
reach. If the platform restarts a run midway, the restarted run skips the posts it
already stored and charged instead of delivering them twice.

### 💰 Pricing

**Pay-Per-Event Model:** Transparent pay-per-post pricing

You only pay for posts successfully scraped. See current pricing in the Apify Console when starting a run.

Platform compute and proxy traffic are included in the per-post price — nothing is billed on top.

**Cost Optimization Tips:**

- Use `maxItemsPerSubreddit` to limit scraping
- Set `maxAgeHours` to 24 for daily monitoring
- Use `minUpvotes` filter (focus on quality content)
- Disable `includeComments` unless needed (significantly reduces runtime)

### 🛡️ Built-in Anti-Blocking

The scraper uses Reddit's mobile GraphQL reads with an anonymous, short-lived app token and a matching mobile HTTP fingerprint. No Reddit account, login cookie or API app credentials are required. It uses Apify **Unblocker** by default.

Search and listings return post text, scores, comment counts and publication dates together. Comment threads retain their parent/reply structure and follow continuation cursors up to the requested depth. Failed API responses are retried and reported as errors.

**Cost:** Proxy traffic is included in the per-post price — there is no separate proxy bill.

### 🕐 Rate Limiting & Reliability

Built for hands-off scheduled automation:

- Request pacing tuned to Reddit's published rate limits
- Automatic retries with exponential backoff on transient errors
- Automatic proxy rotation and renewal of expired anonymous tokens

**Best Practices:**

- Don't run multiple instances simultaneously
- Schedule runs at least 10 minutes apart
- Use state management to avoid reprocessing

### 📅 Recommended Scheduling

#### Brand Monitoring

- **Frequency:** Every 6-12 hours
- **Config:** `maxAgeHours: 12`, `analyzeSentiment: true`, `webhookUrl: "..."`

#### Subreddit Monitoring

- **Frequency:** Daily (every 24 hours)
- **Config:** `maxAgeHours: 24`, `minUpvotes: 5`

#### Trend Analysis

- **Frequency:** Weekly
- **Config:** `maxAgeHours: 168`, `maxItemsPerSubreddit: 500`, `includeComments: true`

#### Competitor Tracking

- **Frequency:** Daily
- **Config:** `maxAgeHours: 24`, `analyzeSentiment: true`, `webhookUrl: "..."`

### ❓ FAQ

#### How do I scrape Reddit without an API key?

This scraper accesses public Reddit data directly — no authentication, API keys, or Reddit account required.

#### Can I use this with n8n or Zapier?

Yes! Enable the `webhookUrl` parameter to send results directly to n8n, Zapier, or Make. The scraper posts a JSON payload with all results and stats at the end of each run.

#### How accurate is the sentiment analysis?

The sentiment analysis uses AFINN-165, a lexicon of roughly 2,500 scored words. It is lexicon matching, not a language model, so it misses sarcasm, negation across clauses, and context-dependent meaning. Treat the score as a coarse positive/negative/neutral signal for spotting trends across many posts, not as ground truth on any single post.

#### What's the difference between keyword and subreddit mode?

- **Keyword mode** searches all of Reddit (or specific subreddits) for posts matching keywords
- **Subreddit mode** monitors specific subreddits and optionally filters by keywords

For brand monitoring, use keyword mode. For community monitoring, use subreddit mode.

#### Can I schedule this to run automatically?

Yes! Use Apify's built-in scheduler or integrate with n8n/Zapier for custom schedules. We recommend running every 6-12 hours for brand monitoring, or daily for subreddit monitoring.

#### Will I get duplicate posts across runs?

No! The state management system tracks the last 10,000 post IDs seen. On subsequent runs, already-seen posts are automatically skipped. This is critical for scheduled automation.

#### Do I need to configure proxies?

No — Apify Unblocker is configured automatically. Proxy traffic is included in the per-post price.

#### How many posts can I scrape per run?

Technically unlimited, but Reddit's API typically returns ~1,000 posts per subreddit. Use `maxItemsPerSubreddit` to control volume and cost.

#### Can I scrape private subreddits?

No, the unofficial JSON API only accesses public subreddits. Private/quarantined subreddits require authentication via Reddit's official API.

#### What format is the output?

JSON by default, but you can export to CSV, Excel, HTML, or XML. The output is flat (not deeply nested) for easy import to Google Sheets, databases, or automation tools.

### 🛠️ API Integration

#### Using Apify API (cURL)

```bash
curl -X POST https://api.apify.com/v2/acts/YOUR_USERNAME~reddit-scraper-pro/runs \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "searchMode": "keyword",
    "keywords": ["Apify"],
    "maxItemsPerSubreddit": 50
  }'
```

#### Using Apify JavaScript Client

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: 'YOUR_API_TOKEN' });

const run = await client.actor('YOUR_USERNAME/reddit-scraper-pro').call({
  searchMode: 'keyword',
  keywords: ['Apify'],
  maxItemsPerSubreddit: 50,
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

#### Using Apify Python Client

```python
from apify_client import ApifyClient

client = ApifyClient('YOUR_API_TOKEN')

run = client.actor('YOUR_USERNAME/reddit-scraper-pro').call(
    run_input={
        'searchMode': 'keyword',
        'keywords': ['Apify'],
        'maxItemsPerSubreddit': 50,
    }
)

items = client.dataset(run['defaultDatasetId']).list_items().items
print(items)
```

### 🧪 Testing & Development

#### Quick Test with Default Input

Just click "Start" or use `apify call` with no input:

```bash
apify call YOUR_USERNAME/reddit-scraper-pro
```

#### Local Development

```bash
cd reddit-scraper-pro
npm install
npm run build

## Test with pay-per-event billing
ACTOR_TEST_PAY_PER_EVENT=true ACTOR_USE_CHARGING_LOG_DATASET=true npm run dev
```

### 📝 Limitations

- **Rate Limits:** Reddit enforces ~60 requests/minute (handled automatically)
- **Historical Data:** Limited by Reddit's API (typically ~1,000 posts per subreddit)
- **Private Subreddits:** Cannot access private/quarantined subreddits
- **Deleted Content:** Cannot retrieve deleted posts/comments
- **Residential Proxies Required:** Datacenter IPs are blocked by Reddit
- **Public Data Only:** Accesses publicly available Reddit content; may need updates if Reddit changes its site

### 🤝 Support & Contact

- **Email:** via Apify
- **Issues:** Report bugs or request features via GitHub Issues
- **Documentation:** This README + inline code comments

### 💡 Success Story

**Use Case:** "Alert me when r/webdev mentions 'Apify'"

**Setup:**

```json
{
  "searchMode": "keyword",
  "keywords": ["Apify"],
  "subreddits": ["webdev"],
  "webhookUrl": "https://n8n.io/webhook/reddit-alerts",
  "analyzeSentiment": true,
  "maxAgeHours": 12
}
```

**Schedule:** Every 6 hours

**Result:** Instant Slack notifications when Apify is mentioned in r/webdev, with sentiment context (positive/negative/neutral). Perfect for brand monitoring and community engagement.

***

### 🔗 Explore More of Our Actors

#### 💬 Social Media & Community

The full catalogue is at [apify.com/webdatalabs](https://apify.com/webdatalabs).

#### 🛒 E-commerce & Brand Monitoring

| Actor | Description |
|-------|-------------|
| [Shopify Scraper Pro](https://apify.com/webdatalabs/shopify-product-scraper) | Extract Shopify product data for competitor and brand monitoring |
| [Etsy Scraper Pro](https://apify.com/webdatalabs/etsy-scraper-pro) | Fast Etsy product scraper with ratings and reviews |
| [Amazon Reviews Scraper](https://apify.com/webdatalabs/amazon-reviews-scraper) | Extract Amazon customer reviews for sentiment analysis |

#### 🏢 Business Intelligence

The full catalogue is at [apify.com/webdatalabs](https://apify.com/webdatalabs).

***

### 🏷️ SEO Keywords

Reddit scraper, Reddit data extraction, scrape Reddit posts, Reddit API alternative, Reddit comment scraper, Reddit sentiment analysis, Reddit brand monitoring, Reddit automation, extract Reddit data, Reddit web scraping, Reddit post scraper, Reddit data mining, Reddit competitor analysis, Reddit keyword tracking, Reddit subreddit monitor, how to scrape Reddit, Reddit market research, Reddit trend analysis, Reddit automation tool, n8n Reddit integration, Zapier Reddit scraper, Make Reddit automation

***

**Built with ❤️ by WebDataLabs** | Powered by Apify | [MIT License](LICENSE)

***

### Need this data as a managed feed?

If you would rather receive this data on a schedule than run the Actor yourself, we can build and operate the feed: the fields you specify, the cadence you set, delivered to a dataset, S3, a webhook, or your database. Every scheduled run is checked against an agreed shape rather than assumed to be fine, missing values are reported as null instead of filled with placeholders, and repairing the collector when the source changes is covered by the monthly rate. Priced as a one-time setup fee plus a monthly rate, scoped in writing before anything is built.

**Contact:** support@webdatalabs.net

### Support

Found a bug, or need a field that is missing? Open an issue on the **Issues** tab of this Actor and
it will be picked up there. You can also reach WebDataLabs through the support channel on our
[Store profile](https://apify.com/webdatalabs).

### Leave a review

Is this actor saving you time? A quick review on the Store helps other people find it — and tells us which fields to add next. **[Rate this actor →](https://apify.com/webdatalabs/reddit-scraper-pro)**

### Legal Disclaimer

This actor is a general-purpose tool for analyzing publicly accessible web data. The user bears sole responsibility for ensuring their specific use complies with:

- Applicable laws (GDPR/DSGVO, copyright law)
- The target website's Terms of Service
- Apify's Terms of Service

The provider (webdatalabs) expressly disclaims liability for any unauthorized or unlawful use. By using this actor, the user agrees to indemnify the provider against any third-party claims arising from their use of the data.

***

*This tool is not affiliated with Reddit. All trademarks belong to their respective owners.*

### Related actors

- [Meta Threads Scraper](https://apify.com/webdatalabs/meta-threads-scraper) — public Threads posts, replies, profiles and keyword search, no login
- [Meta Ad Library Scraper](https://apify.com/webdatalabs/meta-ad-library-scraper) — Facebook and Instagram ads, days running and creative changes
- [YouTube Shorts Scraper](https://apify.com/webdatalabs/youtube-shorts-scraper) — Shorts metadata and engagement

# Actor input Schema

## `searchMode` (type: `string`):

Keyword Search looks across all of Reddit (or inside the subreddits you list) using Reddit's search engine. Subreddit Monitoring works inside specific communities and REQUIRES at least one subreddit below.

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

What to search for. Required in Keyword Search mode. In Subreddit Monitoring mode: leave empty to get the newest posts of each community, or add keywords to search each community for them (multi-word keywords are searched as a phrase, matching post titles and post bodies). Reddit's search engine decides what matches; the keywords_matched output field tells you which keywords literally appear in each post.

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

Communities to scrape, with or without the 'r/' prefix (e.g. 'webdev' or 'r/webdev'). REQUIRED when Search Mode is Subreddit Monitoring. In Keyword Search mode this is optional: leave it empty to search all of Reddit, or list subreddits to restrict the search to them.

## `maxItemsPerSubreddit` (type: `integer`):

Hard cap on how many posts are fetched, saved and charged. In Subreddit Monitoring mode this is the budget per subreddit (shared across your keywords). In Keyword Search mode it is the budget per keyword per subreddit. Filters below can reduce the final count further, never increase it.

## `includeAuthorNames` (type: `boolean`):

Includes the Reddit username of each post's author (and of each comment's author when Scrape Comments is on) in the author field. On by default. Turn it off to leave usernames out - they are personal data, so skip them if you don't need them.

## `searchSort` (type: `string`):

How Reddit sorts keyword-search results. Applies to Keyword Search mode only - Subreddit Monitoring always fetches the newest matching posts first.

## `maxAgeHours` (type: `integer`):

Only keep posts newer than this. 0 = no age limit. Posts older than the limit are fetched and then dropped, so a tight limit combined with a large Max Posts value can return far fewer rows than the cap - the run log reports exactly how many were dropped for being too old.

## `minUpvotes` (type: `integer`):

Only keep posts with at least this many upvotes. 0 captures every mention (best for brand monitoring); raise it to filter noise.

## `includePostText` (type: `boolean`):

Full post text is now included automatically when Reddit provides it. This setting is retained for compatibility with saved tasks.

## `includeComments` (type: `boolean`):

Fetch the comment thread of every saved post, including replies up to Comment Depth. Large threads require additional pages, so runs take longer. Keep off unless you need comment data.

## `commentDepth` (type: `integer`):

Levels of nested replies to fetch (0 = top-level comments only, 2 = replies to replies). Ignored when Scrape Comments is off.

## `analyzeSentiment` (type: `boolean`):

Score each post with AFINN-165 sentiment analysis, adding sentiment_score and sentiment_label (positive/negative/neutral). Useful for brand monitoring.

## `dedupeAcrossRuns` (type: `boolean`):

For scheduled monitoring: remember which posts were already delivered and skip (and never re-charge) them on the next run with the same subreddits and keywords. Leave off for one-off runs - with it on, a repeated run can legitimately return zero new posts.

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

Send the results to n8n, Zapier or a custom endpoint. The batch is POSTed as JSON when the run completes. Example: https://your-n8n.com/webhook/reddit-alerts

## Actor input object example

```json
{
  "searchMode": "keyword",
  "keywords": [
    "ChatGPT"
  ],
  "subreddits": [
    "webdev"
  ],
  "maxItemsPerSubreddit": 10,
  "includeAuthorNames": true,
  "searchSort": "relevance",
  "maxAgeHours": 0,
  "minUpvotes": 0,
  "includePostText": false,
  "includeComments": false,
  "commentDepth": 1,
  "analyzeSentiment": true,
  "dedupeAcrossRuns": false
}
```

# Actor output Schema

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

No description

## `engagement_analysis` (type: `string`):

No description

## `full_data` (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 = {
    "keywords": [
        "ChatGPT"
    ],
    "subreddits": [
        "webdev"
    ],
    "maxItemsPerSubreddit": 10,
    "includeAuthorNames": true
};

// Run the Actor and wait for it to finish
const run = await client.actor("webdatalabs/reddit-scraper-pro").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 = {
    "keywords": ["ChatGPT"],
    "subreddits": ["webdev"],
    "maxItemsPerSubreddit": 10,
    "includeAuthorNames": True,
}

# Run the Actor and wait for it to finish
run = client.actor("webdatalabs/reddit-scraper-pro").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 '{
  "keywords": [
    "ChatGPT"
  ],
  "subreddits": [
    "webdev"
  ],
  "maxItemsPerSubreddit": 10,
  "includeAuthorNames": true
}' |
apify call webdatalabs/reddit-scraper-pro --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,webdatalabs/reddit-scraper-pro"
        }
    }
}
```

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/fHB0Fyn0WFjnvzKpf/builds/E8mdfKjdeOjLNut2S/openapi.json
