# Reddit Keyword Scraper (`mighty_monk/reddit-keyword-scraper`) Actor

Scrape Reddit posts and optional comments by keywords across Reddit or specific subreddits. Fast public JSON endpoints for pain-point mining, lead generation, and market research — an f5bot-style alternative with structured dataset output.

- **URL**: https://apify.com/mighty\_monk/reddit-keyword-scraper.md
- **Developed by:** [Harsh](https://apify.com/mighty_monk) (community)
- **Categories:** Social media, Lead generation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 post or comments

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/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

### What does Reddit Keyword Scraper do?

**Reddit Keyword Scraper** finds **Reddit posts** (and optionally **comments**) that match your **keywords**, either site-wide or inside specific **subreddits**. It uses Reddit’s public JSON endpoints (`search.json` / `r/{sub}/search.json`) — no browser, no login — and writes clean, structured results to an Apify dataset.

Use it as an **f5bot-style** signal source for pain-point mining, outbound lead research, competitor mentions, and product discovery. Run it on the [Apify platform](https://apify.com) for **API access**, **scheduling**, **proxy rotation**, integrations (Make, Zapier, n8n), and monitoring.

### Why use Reddit Keyword Scraper?

- **Outbound & lead gen** — Discover people actively complaining about tools, asking for alternatives, or hiring for problems you solve.
- **Market research** — Track keyword conversations across SaaS, startup, and niche communities over time.
- **Product feedback** — Capture authentic language for ads, landing pages, and feature prioritization.
- **Monitoring** — Schedule runs for brand, competitor, or category keywords and pipe results into CRM / Slack / sheets.
- **Cheap high volume** — Pay-per-event pricing at **$0.002 per post or comment** written to the dataset.

### How to use Reddit Keyword Scraper

1. Open the Actor in [Apify Console](https://console.apify.com) or via API.
2. Enter one or more **keywords** (required), e.g. `looking for alternative`, `hate my CRM`.
3. Optionally restrict to **subreddits** (without `r/`), e.g. `SaaS`, `startups`.
4. Choose **sort** (`new`, `hot`, or `relevance`) and **max posts per keyword**.
5. Toggle **include comments** if you need full thread context (extra dataset items).
6. Enable **Apify Proxy** for reliable volume (recommended).
7. Click **Start**. Download results as JSON, CSV, Excel, or HTML from the dataset.

### Input

Configure fields in the **Input** tab:

| Field | Type | Description |
|-------|------|-------------|
| `keywords` | string\[] | **Required.** Search phrases to match. |
| `subreddits` | string\[] | Optional. Limit to these subreddits; empty = all of Reddit. |
| `sort` | enum | `new` (default), `hot`, or `relevance`. |
| `maxPostsPerKeyword` | integer | Cap unique posts per keyword (`0` = unlimited). Default `50`. |
| `includeComments` | boolean | Fetch comments for each post. Default `false`. |
| `maxCommentsPerPost` | integer | Cap flattened comments per post. Default `50`. |
| `maxConcurrency` | integer | Parallel requests (keep low). Default `2`. |
| `maxRequestRetries` | integer | Retries on failure / rate limit. Default `5`. |
| `maxRequestsPerMinute` | integer | Global rate limit. Default `30`. |
| `proxyConfiguration` | object | Apify Proxy editor; default uses Apify Proxy. |

Example input:

```json
{
    "keywords": ["looking for alternative", "hate my CRM"],
    "subreddits": ["SaaS", "startups"],
    "sort": "new",
    "maxPostsPerKeyword": 20,
    "includeComments": false,
    "proxyConfiguration": { "useApifyProxy": true }
}
```

### Output

Each dataset item is either a **post** or a **comment**. You can download the dataset in **JSON, HTML, CSV, or Excel**.

#### Post example

```json
{
    "type": "post",
    "id": "1abc234",
    "title": "Looking for an alternative to HubSpot",
    "selftext": "Our team is outgrowing free tools...",
    "author": "founder_jane",
    "subreddit": "SaaS",
    "score": 42,
    "numComments": 18,
    "url": "https://www.reddit.com/r/SaaS/comments/1abc234/...",
    "permalink": "https://www.reddit.com/r/SaaS/comments/1abc234/...",
    "createdUtc": 1710000000,
    "keyword": "looking for alternative",
    "scrapedAt": "2026-07-18T12:00:00.000Z"
}
```

#### Comment example

```json
{
    "type": "comment",
    "id": "cmt001",
    "parentId": "1abc234",
    "body": "We switched to Attio and love it for SMB.",
    "author": "reply_alice",
    "subreddit": "SaaS",
    "score": 12,
    "url": "https://www.reddit.com/r/SaaS/comments/1abc234/.../cmt001/",
    "permalink": "https://www.reddit.com/r/SaaS/comments/1abc234/.../cmt001/",
    "createdUtc": 1710000500,
    "keyword": "looking for alternative",
    "scrapedAt": "2026-07-18T12:00:05.000Z"
}
```

A run summary is also stored in the key-value store as `OUTPUT` (totals per keyword, request stats).

### Data table

| Field | Description |
|-------|-------------|
| `type` | `post` or `comment` |
| `id` | Reddit thing id |
| `title` | Post title (posts only) |
| `selftext` | Post body (posts only) |
| `body` | Comment text (comments only) |
| `parentId` | Parent post/comment id (comments) |
| `author` | Reddit username |
| `subreddit` | Subreddit name |
| `score` | Ups minus downs (approx.) |
| `numComments` | Comment count on post |
| `url` / `permalink` | Absolute links |
| `createdUtc` | Unix timestamp |
| `keyword` | Keyword that matched this item |
| `scrapedAt` | ISO scrape time |

### How much does it cost to scrape Reddit?

This Actor uses **pay-per-event** pricing:

- **$0.002** per dataset item (`apify-default-dataset-item`) — each **post** or **comment**
- Tiny **actor-start** fee

Examples:

| Scenario | Items | Approx. cost |
|----------|-------|--------------|
| 100 posts, no comments | 100 | **$0.20** |
| 50 posts + 20 comments each | 1,050 | **$2.10** |
| 1,000 posts | 1,000 | **$2.00** |

Apify Free plan includes monthly platform credits so you can try the Actor with little or no spend. Higher volumes benefit from Apify Proxy and reserved compute.

### Tips

- Prefer **`sort: "new"`** for outbound lead streams (fresh pain points).
- Scope **subreddits** when you know your ICP communities — faster and less noise.
- Keep **maxConcurrency ≤ 3** and rely on **maxRequestsPerMinute** to reduce 429s.
- Enable **proxy** for scheduled / multi-keyword production runs.
- Turn on **includeComments** only when you need thread context — it multiplies cost and requests.
- Deduping is by **post id** within a run; re-runs may re-collect the same posts.

### FAQ, disclaimers, and support

**Is scraping Reddit legal?**\
This Actor only uses **public** Reddit JSON pages the same way a browser would. You are responsible for complying with Reddit’s Terms of Service, applicable laws, and fair use / rate limits. Do not collect or misuse personal data.

**Does it need a Reddit API key?**\
No. It primarily uses public Reddit `.json` endpoints (`search.json` / `r/{sub}/search.json`). When Reddit returns **HTTP 403** (common without residential IPs), the Actor automatically falls back to the **PullPush** public archive API for the same keywords/subreddits so runs still return structured posts.

**Why are some comments missing?**\
Reddit “load more comments” stubs are not expanded without authenticated API access. Nested replies present in the initial JSON tree are included up to `maxCommentsPerPost`.

**Blocked or empty results?**\
Keep **Apify Proxy + RESIDENTIAL** enabled (default). The Actor also retries alternate Reddit hosts and PullPush automatically.

**Custom solutions**\
Need monitoring webhooks, CRM push, or multi-platform social listening? Open an issue on the Actor’s **Issues** tab or contact the developer on Apify.

Built for high-volume **social listening** and **lead generation** workflows on Apify.

# Actor input Schema

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

Search keywords or phrases to find matching Reddit posts (e.g. "looking for alternative", "need help with CRM").

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

Limit search to these subreddits (without r/ prefix). Leave empty to search all of Reddit.

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

How Reddit should sort search results.

## `maxPostsPerKeyword` (type: `integer`):

Maximum number of unique posts to collect per keyword (across all subreddits if specified). 0 means unlimited (use with care).

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

If true, fetch comments for each scraped post and push them as separate dataset items (type=comment).

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

When includeComments is true, maximum comments to extract per post (flattened tree).

## `maxConcurrency` (type: `integer`):

Maximum parallel HTTP requests. Keep low to respect Reddit rate limits.

## `maxRequestRetries` (type: `integer`):

How many times to retry failed or rate-limited requests.

## `maxRequestsPerMinute` (type: `integer`):

Global rate limit for Reddit JSON endpoints.

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

Apify Proxy settings. Reddit blocks most datacenter IPs — the Actor defaults to RESIDENTIAL when useApifyProxy is true and no groups are set.

## Actor input object example

```json
{
  "keywords": [
    "looking for alternative",
    "hate my CRM"
  ],
  "subreddits": [
    "SaaS",
    "startups",
    "entrepreneur"
  ],
  "sort": "new",
  "maxPostsPerKeyword": 50,
  "includeComments": false,
  "maxCommentsPerPost": 50,
  "maxConcurrency": 2,
  "maxRequestRetries": 5,
  "maxRequestsPerMinute": 30,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

## `dataset` (type: `string`):

No description

## `summary` (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": [
        "looking for alternative",
        "hate my CRM"
    ],
    "subreddits": [
        "SaaS",
        "startups",
        "entrepreneur"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("mighty_monk/reddit-keyword-scraper").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": [
        "looking for alternative",
        "hate my CRM",
    ],
    "subreddits": [
        "SaaS",
        "startups",
        "entrepreneur",
    ],
}

# Run the Actor and wait for it to finish
run = client.actor("mighty_monk/reddit-keyword-scraper").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 '{
  "keywords": [
    "looking for alternative",
    "hate my CRM"
  ],
  "subreddits": [
    "SaaS",
    "startups",
    "entrepreneur"
  ]
}' |
apify call mighty_monk/reddit-keyword-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/yJcEOrlUZjDE1QeaO/builds/0FX6e7Hgd5xX1fDLY/openapi.json
