# Reddit Subreddit Scraper AI (`crw/reddit-subreddit-scraper`) Actor

Scrape Reddit subreddit posts and comments — with AI-generated summaries of every post body and comment discussion. No login, no API key required.

- **URL**: https://apify.com/crw/reddit-subreddit-scraper.md
- **Developed by:** [CRW](https://apify.com/crw) (community)
- **Categories:** Social media, Automation, AI
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.99 / 1,000 posts

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 Subreddit Scraper AI

Scrape posts and comments from any subreddit — and let AI summarize every post body and comment discussion for you.

No login. No API key. No scrolling. Just a few parameters.

***

### What does the output look like?

#### Post (without comments)

```json
{
  "id": "t3_1udilkn",
  "title": "Before smartphones, what did people do when they had to wait somewhere for 30 minutes?",
  "url": "https://www.reddit.com/r/NoStupidQuestions/comments/1udilkn/before_smartphones_what_did_people_do_when_they/",
  "subredditName": "NoStupidQuestions",
  "subredditId": "t5_2w844",
  "authorName": "sudherzdiniq",
  "authorId": "t2_d8aku4pil",
  "createdAt": "2026-06-23T14:24:44.000000+0000",
  "score": 1207,
  "commentCount": 3104,
  "upvoteRatio": 0.902,
  "postType": "text",
  "domain": "self.NoStupidQuestions",
  "body": "I was sitting in a waiting room today and realized everyone was staring at their phones...",
  "images": null,
  "nsfw": false,
  "spoiler": false,
  "comments": null
}
```

#### Post (with comments enabled)

```json
{
  "id": "t3_1udilkn",
  "title": "Before smartphones, what did people do when they had to wait somewhere for 30 minutes?",
  "comments": [
    {
      "id": "t1_owililg",
      "postId": "t3_1udilkn",
      "parentId": null,
      "depth": 0,
      "authorName": "spytez",
      "body": "I have a friend that works at one of the large companies doing an AI push...",
      "score": 425,
      "createdAt": "2026-07-09T16:06:41.542000+0000",
      "permalink": "https://www.reddit.com/r/NoStupidQuestions/comments/1udilkn/comment/owililg/"
    },
    {
      "id": "t1_owit2n4",
      "postId": "t3_1udilkn",
      "parentId": "t1_owililg",
      "depth": 1,
      "authorName": "happyscrappy",
      "body": "We couldn't have foreseen this!",
      "score": 61,
      "createdAt": "2026-07-09T16:37:58.807000+0000",
      "permalink": "https://www.reddit.com/r/NoStupidQuestions/comments/1udilkn/comment/owit2n4/"
    }
  ]
}
```

***

### Post fields

| Field | Description | Example |
|-------|-------------|---------|
| `id` | Post ID | `t3_1udilkn` |
| `title` | Post title | `Before smartphones, what did people do...` |
| `body` | Full post text (text posts only — `null` for all other types) | `I was sitting in a waiting room today...` |
| `url` | Direct link to the post | `https://www.reddit.com/r/.../` |
| `subredditName` | Subreddit name | `NoStupidQuestions` |
| `subredditId` | Subreddit ID | `t5_2w844` |
| `authorName` | Author username | `sudherzdiniq` |
| `authorId` | Author ID | `t2_d8aku4pil` |
| `createdAt` | Post timestamp (ISO 8601) | `2026-06-23T14:24:44.000000+0000` |
| `score` | Upvote count | `1207` |
| `commentCount` | Number of comments | `3104` |
| `upvoteRatio` | Ratio of upvotes to total votes | `0.902` |
| `postType` | Post type | `text` / `link` / `image` / `gallery` / `video` |
| `domain` | Link domain for link posts, `self.<subreddit>` for text posts | `yahoo.com` |
| `images` | Image URLs for `image` and `gallery` posts — `null` for all other types | `["https://i.redd.it/..."]` |
| `nsfw` | Whether the post is marked NSFW | `false` |
| `spoiler` | Whether the post is marked as a spoiler | `false` |
| `comments` | Array of comments — `null` when `includeComments` is `false` | `[...]` |
| `bodySummary` | AI-generated summary of the post body — only present when `enableAI` is `true` and the post has body text | `"A user asks what people did while waiting before smartphones existed."` |
| `commentSummary` | AI-generated summary of the comment discussion — only present when `enableAI` is `true` and the post has comments | `"Most commenters share nostalgic anecdotes about reading and people-watching."` |

### Comment fields

| Field | Description | Example |
|-------|-------------|---------|
| `id` | Comment ID | `t1_owililg` |
| `postId` | Parent post ID | `t3_1udilkn` |
| `parentId` | Parent comment ID — `null` for top-level comments | `t1_owililg` |
| `depth` | Nesting depth — `0` = top-level, `1` = reply, `2` = reply to reply... | `1` |
| `authorName` | Comment author username | `happyscrappy` |
| `body` | Full comment text | `We couldn't have foreseen this!` |
| `score` | Upvote count | `61` |
| `createdAt` | Comment timestamp (ISO 8601) | `2026-07-09T16:37:58.807000+0000` |
| `permalink` | Direct link to the comment | `https://www.reddit.com/r/.../comment/owit2n4/` |

***

### Getting started

| Parameter | Required | Default | Description |
|-----------|----------|---------|-------------|
| `subreddit` | Yes | — | Subreddit name (e.g. `technology`, `worldnews`, `r/science`) |
| `sort` | No | `hot` | Feed sort order: `hot` / `new` / `top` / `rising` / `best` |
| `timeFilter` | No | `day` | Time range for `top` sort only: `hour` / `day` / `week` / `month` / `year` / `all` |
| `maxResults` | No | `100` | Number of posts to collect (10–500) |
| `includeComments` | No | `false` | Collect comments for each post |
| `maxCommentsPerPost` | No | `10` | Max comments per post, top-level and replies combined (1–100). Only applies when `includeComments` is `true` |
| `maxReplyExpansions` | No | `1` | How many times to expand hidden replies per thread. Set to `0` to skip, higher values load deeper reply chains. Only applies when `includeComments` is `true` |
| `enableAI` | No | `false` | Enrich each post with AI-generated `bodySummary` and `commentSummary` fields. |

Example — posts only:

```json
{
  "subreddit": "Entrepreneur",
  "sort": "hot",
  "maxResults": 100
}
```

Example — posts with comments:

```json
{
  "subreddit": "Entrepreneur",
  "sort": "hot",
  "maxResults": 50,
  "includeComments": true,
  "maxCommentsPerPost": 10
}
```

Example — posts with AI analysis:

```json
{
  "subreddit": "Entrepreneur",
  "sort": "hot",
  "maxResults": 50,
  "includeComments": true,
  "maxCommentsPerPost": 10,
  "enableAI": true
}
```

Click **Start** in the Apify console or call it via API. Results are available as JSON, CSV, or Excel.

#### AI Analysis output

When `enableAI` is `true`, each post in the dataset is enriched with:

- **`bodySummary`** — a concise summary of the post's body text (text posts only)
- **`commentSummary`** — a summary of the comment discussion, covering what people agree on, push back on, and additionally suggest

Both fields are only present when the relevant content exists (body or comments). Posts with no body and no comments will not have either field.

#### Pricing estimate

| Event | Unit | Price |
|-------|------|-------|
| Post | per post | $0.00199 |
| Comment | per comment (`includeComments: true`) | $0.00099 |
| AI body summary | per post with body (`enableAI: true`) | $0.001 |
| AI comment summary | per post with comments (`enableAI: true`) | $0.002 |

> **Note:** AI summaries are charged per **post**, not per comment. A post with 100 comments still generates one `commentSummary` — billed once at $0.002.

| Scenario | Posts | Comments | Estimated cost |
|----------|-------|----------|----------------|
| Posts only | 1,000 | — | ~$1.99 |
| Posts + 10 comments each | 1,000 | 10,000 | ~$11.89 |
| Posts + 50 comments each | 500 | 25,000 | ~$25.70 |
| Posts + AI body summary only | 1,000 | — | ~$2.99 |
| Posts + comments + AI (body + comment summary) | 500 | 5,000 | ~$7.44 |

Comment collection is billed per comment. AI summaries are billed per post. Keep `maxCommentsPerPost` low if you only need a sample of opinions per post.

***

### What can you do with it?

**Sentiment analysis and brand monitoring**
Pull the latest posts from a niche subreddit with `sort: new` and enable comments to capture raw, unfiltered opinions. Reddit comments are more candid than reviews or tweets — people say what they actually think.

**Build AI training datasets**
Subreddits like `r/AskReddit`, `r/explainlikeimfive`, or `r/relationship_advice` contain millions of long-form human discussions. Enable `includeComments` with `maxCommentsPerPost: 50` to capture full conversation threads — ideal for fine-tuning, RLHF, or building Q\&A datasets.

**Track community trends over time**
Run weekly on `r/investing` or `r/technology` with `sort: top` and `timeFilter: week` to see which topics are gaining traction. Combine post scores, comment counts, and upvote ratios to spot momentum early.

**Research what content resonates**
Compare `score`, `upvoteRatio`, and `commentCount` across hundreds of posts to understand what titles and formats drive engagement. Use comment `depth` and `score` to see which perspectives the community amplifies.

***

### For developers

#### JavaScript / TypeScript

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

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

const run = await client.actor('YOUR_ACTOR_ID').call({
  subreddit: 'technology',
  sort: 'top',
  timeFilter: 'week',
  maxResults: 100,
  includeComments: true,
  maxCommentsPerPost: 10,
});

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

#### Python

```python
from apify_client import ApifyClient

client = ApifyClient('YOUR_API_TOKEN')

run = client.actor('YOUR_ACTOR_ID').call(run_input={
    'subreddit': 'technology',
    'sort': 'top',
    'timeFilter': 'week',
    'maxResults': 100,
    'includeComments': True,
    'maxCommentsPerPost': 10,
})

for item in client.dataset(run['defaultDatasetId']).iterate_items():
    print(item)
```

***

### Limitations

- **Volume:** 10 to 500 posts per run.
- **Post body text:** Only available on text posts. Link, image, video, and gallery posts return `null` for `body`.
- **Comment body:** Text comments return the full comment text. Image-only or GIF comments (no text) return the media URL as `body` instead of `null`.
- **Images:** Only available on `image` and `gallery` posts — `null` for all other types. `image` posts return a permanent `i.redd.it` URL. `gallery` posts return signed `preview.redd.it` URLs that expire approximately **7 days** after scraping.
- **`timeFilter`:** Only applies when `sort` is set to `top`. Ignored for all other sort orders.
- **Comments:** Up to 100 comments per post (`maxCommentsPerPost`). This count includes both top-level comments and replies. Reddit initially hides some replies behind "load more" buttons — use `maxReplyExpansions` to control how many times those are expanded per thread (default: 1). Set to `0` to collect only what's visible on initial load.

***

### You might also need

If you want to search Reddit by keyword across all communities — not just one subreddit:

#### [Reddit Post Scraper](https://apify.com/crw/reddit-post-scraper)

| | Reddit Subreddit Scraper | Reddit Post Scraper |
|---|---|---|
| **Input** | Subreddit name | Search keyword |
| **Coverage** | One community | All of Reddit |
| **Best for** | Monitoring a specific community | Finding posts about a topic across subreddits |
| **Sort** | hot / new / top / rising / best | relevance / hot / top / new / comments |

→ **[Try Reddit Post Scraper](https://apify.com/crw/reddit-post-scraper)**

# Actor input Schema

## `subreddit` (type: `string`):

Subreddit name to scrape (e.g. <code>whatisit</code>, <code>worldnews</code>, <code>r/science</code>). The <code>r/</code> prefix is optional.

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

Feed sort order.

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

Time range for posts. Only applies when <strong>Sort order</strong> is set to <code>top</code>. Ignored for all other sort orders.

## `maxResults` (type: `integer`):

Maximum number of posts to collect. Between 10 and 500.

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

Collect comments for each post. When enabled, each post will include a <code>comments</code> array.

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

Maximum number of comments to collect per post. Between 1 and 100. Only applies when <strong>Include comments</strong> is enabled.

## `maxReplyExpansions` (type: `integer`):

How many times to expand hidden replies per comment thread. Reddit initially shows only a portion of replies — when a thread has more replies than shown, a "load more replies" button appears. This setting controls how many times that button is clicked per thread.<br><br>Each expansion loads one additional batch of replies for a given thread. If the loaded replies themselves contain further hidden replies, those are also expanded up to this limit — so setting this to <code>2</code> can load replies up to two levels deep beyond what was initially visible.<br><br>Set to <code>0</code> to skip reply expansion entirely (only initially visible replies are collected). Only applies when <strong>Include comments</strong> is enabled.

## `enableAI` (type: `boolean`):

When enabled, each post is enriched with AI-generated summaries: a <code>bodySummary</code> for text posts with body content, and a <code>commentSummary</code> for posts with comments. Billed per summary generated.

## Actor input object example

```json
{
  "subreddit": "Entrepreneur",
  "sort": "hot",
  "timeFilter": "day",
  "maxResults": 100,
  "includeComments": false,
  "maxCommentsPerPost": 10,
  "maxReplyExpansions": 1,
  "enableAI": false
}
```

# Actor output Schema

## `api` (type: `string`):

REST API endpoint to download the dataset programmatically.

# 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 = {
    "subreddit": "Entrepreneur"
};

// Run the Actor and wait for it to finish
const run = await client.actor("crw/reddit-subreddit-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 = { "subreddit": "Entrepreneur" }

# Run the Actor and wait for it to finish
run = client.actor("crw/reddit-subreddit-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 '{
  "subreddit": "Entrepreneur"
}' |
apify call crw/reddit-subreddit-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

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