# 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, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

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

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

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Reddit Niche Subreddit Scraper | Auto-Tagged | Free",
        "description": "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.",
        "version": "0.1",
        "x-build-id": "TGkvqv7P82b2mPGrc"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/w4rd0g~reddit-niche-tagged/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-w4rd0g-reddit-niche-tagged",
                "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/w4rd0g~reddit-niche-tagged/runs": {
            "post": {
                "operationId": "runs-sync-w4rd0g-reddit-niche-tagged",
                "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/w4rd0g~reddit-niche-tagged/run-sync": {
            "post": {
                "operationId": "run-sync-w4rd0g-reddit-niche-tagged",
                "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",
                "required": [
                    "subreddits"
                ],
                "properties": {
                    "subreddits": {
                        "title": "Subreddits to scrape",
                        "type": "array",
                        "description": "List of subreddit names (without /r/ prefix). Example: ['MachineLearning', 'datascience', 'LocalLLaMA'].",
                        "items": {
                            "type": "string"
                        }
                    },
                    "sort": {
                        "title": "Sort order",
                        "enum": [
                            "hot",
                            "new",
                            "top",
                            "rising"
                        ],
                        "type": "string",
                        "description": "Reddit sort mode for the listing.",
                        "default": "hot"
                    },
                    "timeFilter": {
                        "title": "Time filter (used only with sort=top)",
                        "enum": [
                            "hour",
                            "day",
                            "week",
                            "month",
                            "year",
                            "all"
                        ],
                        "type": "string",
                        "description": "Time window for sort=top. Ignored otherwise.",
                        "default": "week"
                    },
                    "searchQuery": {
                        "title": "Optional keyword search",
                        "type": "string",
                        "description": "If provided, search within each subreddit for posts matching the keyword (server-side Reddit search)."
                    },
                    "tagKeywords": {
                        "title": "Auto-tag keywords",
                        "type": "array",
                        "description": "Each post is tagged with keywords from this list whose terms appear in title+body. Used downstream for ML/training data classification.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "maxPostsPerSubreddit": {
                        "title": "Max posts per subreddit",
                        "minimum": 1,
                        "maximum": 500,
                        "type": "integer",
                        "description": "Cap on posts returned per subreddit. Higher values trigger pagination, slower runs.",
                        "default": 25
                    },
                    "minScore": {
                        "title": "Min upvotes",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Skip posts with score below this threshold. 0 = no filter.",
                        "default": 5
                    },
                    "minComments": {
                        "title": "Min comments",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Skip posts with fewer comments than this. 0 = no filter.",
                        "default": 0
                    },
                    "includeBody": {
                        "title": "Include selftext body",
                        "type": "boolean",
                        "description": "If true, include the full post body (selftext) in output. Increases data volume.",
                        "default": true
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
