# Reddit Niche Subreddit Scraper | Auto-Tagged | Free (`w4rd0g/reddit-niche-tagged`) Actor

Scrape posts from any list of niche subreddits with automatic keyword tagging. Filter by date, score, comments. Output: clean JSON ready for LLM training, social listening, or brand monitoring. FREE during launch preview.

- **URL**: https://apify.com/w4rd0g/reddit-niche-tagged.md
- **Developed by:** [Polara Data](https://apify.com/w4rd0g) (community)
- **Categories:** Social media, AI, Lead generation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.001 / reddit post

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

## Reddit Niche Subreddit Scraper (Auto-Tagged)

Scrape posts from a curated list of niche subreddits, with optional keyword search and automatic content tagging. Built for ML/LLM training pipelines, social listening, brand monitoring, and trend detection on niche communities that generic scrapers miss.

### What it does

- Pulls posts from any list of subreddits (no auth, no API key)
- Filters by sort order (hot/new/top/rising), time window, min upvotes, min comments
- Optional within-subreddit keyword search
- **Auto-tags every post** with your custom keyword list — search the body+title for terms you care about, output them as a `tags` array
- Returns clean structured JSON, ready to drop into ML pipelines or Slack/Notion automations

### Use cases

**LLM training data** — Curate subreddit-specific corpora for fine-tuning domain models (e.g. r/MachineLearning + r/LocalLLaMA + r/datascience for AI dev models).

**Social listening (niche)** — Track brand mentions or competitor names across vertical subreddits without paying enterprise tools.

**Trend detection** — Auto-tag posts in r/startups, r/SaaS, r/Entrepreneur for emerging product categories or pain points.

**Content discovery** — Find high-engagement posts (>100 score, >50 comments) in your niche for content marketing inspiration.

### Input

```json
{
  "subreddits": ["MachineLearning", "datascience", "LocalLLaMA"],
  "sort": "hot",
  "searchQuery": "RAG",
  "tagKeywords": ["RAG", "fine-tuning", "Llama", "evaluation", "agent", "embedding"],
  "maxPostsPerSubreddit": 25,
  "minScore": 5,
  "minComments": 0,
  "includeBody": true
}
```

| Field | Type | Default | Description |
|---|---|---|---|
| `subreddits` | array | required | Subreddit names (without /r/) |
| `sort` | enum | `hot` | hot / new / top / rising |
| `timeFilter` | enum | `week` | hour / day / week / month / year / all (only for sort=top) |
| `searchQuery` | string | (none) | Optional keyword search inside each subreddit |
| `tagKeywords` | array | \[] | Auto-tag keywords applied to title+body |
| `maxPostsPerSubreddit` | int (1-500) | 25 | Cap per subreddit |
| `minScore` | int | 5 | Skip posts below this upvote count |
| `minComments` | int | 0 | Skip posts below this comment count |
| `includeBody` | bool | true | Include selftext body in output |

### Output

One dataset item per post:

```json
{
  "id": "1abcxyz",
  "subreddit": "MachineLearning",
  "title": "[D] Best practices for evaluating RAG systems in production",
  "body": "...",
  "author": "user123",
  "url": "https://www.reddit.com/r/MachineLearning/comments/1abcxyz/...",
  "linkUrl": "https://arxiv.org/abs/...",
  "score": 234,
  "upvoteRatio": 0.97,
  "numComments": 56,
  "createdUtc": 1730000000,
  "createdAt": "2026-04-29T10:00:00Z",
  "isSelf": true,
  "flair": "Discussion",
  "domain": "self.MachineLearning",
  "tags": ["RAG", "evaluation"]
}
```

### Pricing

**Currently FREE** during the launch preview — no per-result charges, no monthly cap.

When paid pricing rolls out (notice will be posted at least 14 days in advance):

| Event | Price |
|---|---|
| Actor start | $0.01 (one-time per run) |
| Result item | $0.001 (per post) |

**Cost examples (post-launch)**:

- 100 posts: ~$0.11
- 1.000 posts: ~$1.01
- 10.000 posts: ~$10.01

### Limits

- Source: Reddit public JSON API (no auth required, no API key)
- Rate limit: ~1 req/sec (politely paced internally with 0.6s sleep)
- Max posts per subreddit: 500 per run (cumulative pagination)
- No private subreddits, no NSFW filtering bypass
- No comment scraping in v1 (planned for v2)

### Source attribution

Data comes from Reddit's public JSON endpoint (`/r/{sub}/.json`), which does not require authentication. Subject to Reddit's Public Content Policy.

### Author

**Polara Data** — niche scrapers for Italy, EU & global markets.

# Actor input Schema

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

List of subreddit names (without /r/ prefix). Example: \['MachineLearning', 'datascience', 'LocalLLaMA'].

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

Reddit sort mode for the listing.

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

Time window for sort=top. Ignored otherwise.

## `searchQuery` (type: `string`):

If provided, search within each subreddit for posts matching the keyword (server-side Reddit search).

## `tagKeywords` (type: `array`):

Each post is tagged with keywords from this list whose terms appear in title+body. Used downstream for ML/training data classification.

## `maxPostsPerSubreddit` (type: `integer`):

Cap on posts returned per subreddit. Higher values trigger pagination, slower runs.

## `minScore` (type: `integer`):

Skip posts with score below this threshold. 0 = no filter.

## `minComments` (type: `integer`):

Skip posts with fewer comments than this. 0 = no filter.

## `includeBody` (type: `boolean`):

If true, include the full post body (selftext) in output. Increases data volume.

## Actor input object example

```json
{
  "subreddits": [
    "MachineLearning",
    "datascience",
    "LocalLLaMA"
  ],
  "sort": "hot",
  "timeFilter": "week",
  "tagKeywords": [
    "RAG",
    "fine-tuning",
    "Llama",
    "evaluation",
    "agent",
    "embedding"
  ],
  "maxPostsPerSubreddit": 25,
  "minScore": 5,
  "minComments": 0,
  "includeBody": true
}
```

# 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": [
        "MachineLearning",
        "datascience",
        "LocalLLaMA"
    ],
    "tagKeywords": [
        "RAG",
        "fine-tuning",
        "Llama",
        "evaluation",
        "agent",
        "embedding"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("w4rd0g/reddit-niche-tagged").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": [
        "MachineLearning",
        "datascience",
        "LocalLLaMA",
    ],
    "tagKeywords": [
        "RAG",
        "fine-tuning",
        "Llama",
        "evaluation",
        "agent",
        "embedding",
    ],
}

# Run the Actor and wait for it to finish
run = client.actor("w4rd0g/reddit-niche-tagged").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": [
    "MachineLearning",
    "datascience",
    "LocalLLaMA"
  ],
  "tagKeywords": [
    "RAG",
    "fine-tuning",
    "Llama",
    "evaluation",
    "agent",
    "embedding"
  ]
}' |
apify call w4rd0g/reddit-niche-tagged --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/OLBVhEmbEfgC1x8H5/builds/TGkvqv7P82b2mPGrc/openapi.json
