# Reddit Scraper - Posts, Comments, Search & Subreddits (`groupoject/reddit-scraper`) Actor

Scrape Reddit posts and top comments from subreddits and keyword searches using each user's free Reddit API credentials. Export structured Reddit data for social listening, market research, and AI workflows.

- **URL**: https://apify.com/groupoject/reddit-scraper.md
- **Developed by:** [Group Oject](https://apify.com/groupoject) (community)
- **Categories:** Social media, News, AI
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 results

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 Scraper - Posts, Comments, Search & Subreddits

Scrape Reddit posts and optional top comments from subreddits and keyword searches using Reddit's official API. Export structured Reddit data for social listening, brand monitoring, market research, community research, sentiment analysis, and AI workflows.

This Actor uses each user's own free Reddit API credentials. That keeps access stable, avoids shared-rate-limit problems, and is more reliable than brittle public-page scraping.

### Why use this Reddit Scraper?

- **Reliable official API access** - uses `oauth.reddit.com` instead of fragile public pages.
- **Subreddit scraping** - collect posts from `r/technology`, `r/Entrepreneur`, `r/MachineLearning`, and more.
- **Keyword search** - monitor brand, product, competitor, and topic mentions across Reddit.
- **Top comments** - optionally attach top-level comments to each post.
- **Clean exports** - JSON, CSV, Excel, XML, RSS, API, webhooks, Make, Zapier, n8n, and AI pipelines.
- **Low-cost HTTP runtime** - no browser needed, 512 MB default memory.

### Setup: free Reddit API credentials

Reddit requires API authentication for reliable automated access. Setup takes about 2 minutes:

1. Go to [reddit.com/prefs/apps](https://www.reddit.com/prefs/apps).
2. Click **create another app...**
3. Choose **script**.
4. Set redirect URI to `http://localhost:8080`.
5. Copy the short Client ID under the app name.
6. Copy the value labelled `secret`.
7. Paste them into `redditClientId` and `redditClientSecret`.

Credentials are secret input fields and are not written to the dataset.

### Quick start

```json
{
  "redditClientId": "YOUR_CLIENT_ID",
  "redditClientSecret": "YOUR_CLIENT_SECRET",
  "subreddits": ["technology", "Entrepreneur", "MachineLearning"],
  "searchQueries": ["AI tools", "best CRM"],
  "sort": "hot",
  "maxItems": 50,
  "includeComments": false
}
```

With top comments:

```json
{
  "redditClientId": "YOUR_CLIENT_ID",
  "redditClientSecret": "YOUR_CLIENT_SECRET",
  "subreddits": ["SaaS", "Entrepreneur"],
  "searchQueries": ["stripe alternative", "best crm"],
  "sort": "top",
  "time": "month",
  "maxItems": 50,
  "includeComments": true,
  "maxComments": 5
}
```

### Input

| Field | Type | Default | Description |
|---|---|---:|---|
| `redditClientId` | string | required | Reddit app Client ID |
| `redditClientSecret` | string | required | Reddit app secret |
| `subreddits` | string\[] | sample list | Subreddits without `r/` |
| `searchQueries` | string\[] | sample list | Reddit search keywords |
| `sort` | string | `hot` | `hot`, `new`, `top`, or `rising` |
| `time` | string | `week` | Time window for `top` sorting |
| `maxItems` | integer | `50` | Max posts per subreddit or query |
| `includeComments` | boolean | `false` | Attach top comments to each post |
| `maxComments` | integer | `10` | Top comments per post |
| `proxyConfiguration` | object | optional | Usually not needed for official API |

### Output

Each dataset row is one Reddit post.

```json
{
  "id": "1abcd23",
  "subreddit": "technology",
  "title": "New AI product launches",
  "author": "example_user",
  "score": 1423,
  "upvoteRatio": 0.97,
  "numComments": 312,
  "createdIso": "2026-08-21T07:33:20+00:00",
  "url": "https://example.com/article",
  "permalink": "https://www.reddit.com/r/technology/comments/1abcd23/...",
  "selftext": "",
  "flair": "AI",
  "domain": "example.com",
  "matchedSource": "r/technology",
  "comments": [
    {
      "author": "commenter1",
      "body": "This is useful for research workflows.",
      "score": 88
    }
  ]
}
```

The `comments` array appears only when `includeComments` is enabled.

### High-value use cases

- Reddit social listening
- Brand and product mention monitoring
- Competitor research
- Community trend discovery
- Voice-of-customer mining
- Sentiment and NLP datasets
- Lead and pain-point research
- AI/RAG pipelines from Reddit discussions
- Launch monitoring and feedback analysis

### Pricing

Launch pricing recommendation: **$1.00 / 1,000 results**.

This is priced for adoption: cheaper than many high-friction social scraping workflows, while still monetizing a high-demand category.

### Notes

This Actor uses Reddit's official API and only collects public Reddit data. You are responsible for using the data responsibly and following Reddit's terms, Apify's policies, and applicable laws.

# Actor input Schema

## `redditClientId` (type: `string`):

Your Reddit app's Client ID. Create a free app at https://www.reddit.com/prefs/apps → 'create another app...' → choose type 'script'. The Client ID is the short string shown directly under the app's name.

## `redditClientSecret` (type: `string`):

Your Reddit app's Secret (labelled 'secret' on the app page at https://www.reddit.com/prefs/apps). Kept encrypted; each user brings their own so rate limits are per-account.

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

Subreddit names to scrape, without the 'r/' prefix (e.g. 'python', 'dataisbeautiful').

## `searchQueries` (type: `array`):

Optional keyword searches run against Reddit's site-wide search. One record per matching post.

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

How to sort posts within each source.

## `time` (type: `string`):

Time window applied only when sort is 'top'.

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

Maximum number of posts to collect per subreddit or search query.

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

If enabled, fetch the top comments for each post (slower, extra requests).

## `maxComments` (type: `integer`):

Maximum number of top-level comments to collect per post when 'Include comments' is enabled.

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

Optional. The official Reddit API usually works best without proxy; add Apify Proxy only if your environment requires it.

## Actor input object example

```json
{
  "subreddits": [
    "technology",
    "Entrepreneur",
    "MachineLearning"
  ],
  "searchQueries": [
    "AI tools",
    "best CRM",
    "meal delivery"
  ],
  "sort": "hot",
  "time": "week",
  "maxItems": 50,
  "includeComments": false,
  "maxComments": 10
}
```

# Actor output Schema

## `results` (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 = {
    "subreddits": [
        "technology",
        "Entrepreneur",
        "MachineLearning"
    ],
    "searchQueries": [
        "AI tools",
        "best CRM",
        "meal delivery"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("groupoject/reddit-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 = {
    "subreddits": [
        "technology",
        "Entrepreneur",
        "MachineLearning",
    ],
    "searchQueries": [
        "AI tools",
        "best CRM",
        "meal delivery",
    ],
}

# Run the Actor and wait for it to finish
run = client.actor("groupoject/reddit-scraper").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 '{
  "subreddits": [
    "technology",
    "Entrepreneur",
    "MachineLearning"
  ],
  "searchQueries": [
    "AI tools",
    "best CRM",
    "meal delivery"
  ]
}' |
apify call groupoject/reddit-scraper --silent --output-dataset

```

## MCP server setup

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

```

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/M0DYqu7zv6EchwiBJ/builds/42rVoMtET389N33bw/openapi.json
