# Subreddit Scraper: Posts & Comments (`deepmine/subreddit-scraper`) Actor

Scrape any subreddit's posts and comments by name or link, no login: hot, new, top, rising or controversial posts with score, upvote ratio, text, flair, author and media, plus each post's comment thread with replies. Many subreddits per run; you pay per result.

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

## Pricing

from $0.79 / 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.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

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

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

### What does Subreddit Scraper do?

Subreddit Scraper gets the posts and comments of any subreddit: type subreddit names or paste links, pick hot, new, top, rising or controversial, and get each post (title, full text, score, upvote ratio, comment count, author, flair, media) followed by its comment thread with replies. Many subreddits in one run; the first rows land in seconds. No login, no browser, no cookies.

These are real rows from the prefilled run (r/smallbusiness and r/Entrepreneur, top posts of the week, 10 posts each with 4 comments per post):

| Post | Subreddit | Score | Comments | Posted |
|---|---|---:|---:|---|
| [My little home-based pet care business just crossed $35k in 6 months ...](https://www.reddit.com/r/smallbusiness/comments/1wugesv/my_little_homebased_pet_care_business_just/) | r/smallbusiness | 825 | 96 | 2026-09-30 |
| [From your experience, what business will always make money, regardle...](https://www.reddit.com/r/smallbusiness/comments/1wu73pk/from_your_experience_what_business_will_always/) | r/smallbusiness | 85 | 300 | 2026-09-30 |
| [I finally fired my highest paying client today, and I am terrified bu...](https://www.reddit.com/r/smallbusiness/comments/1wyuc0n/i_finally_fired_my_highest_paying_client_today/) | r/smallbusiness | 114 | 45 | 2026-10-06 |
| [What Is The Problem With Buying Land & Starting A Mobile Home Park?](https://www.reddit.com/r/Entrepreneur/comments/1wunu68/what_is_the_problem_with_buying_land_starting_a/) | r/Entrepreneur | 86 | 60 | 2026-10-01 |
| [What AI tools have changed your life as an entrepreneur?](https://www.reddit.com/r/Entrepreneur/comments/1wywt3a/what_ai_tools_have_changed_your_life_as_an/) | r/Entrepreneur | 85 | 83 | 2026-10-06 |

<sub>$0.99 per 1,000 results on Starter ($1.09 Free, $0.89 Scale, $0.79 Business). The prefilled run (100 results: 20 posts, 80 comments) costs about $0.10. No start fee. Collected 2026-10-06.</sub>

### What can you scrape from a subreddit?

- **Posts in any order**: Hot, New, Top, Rising or Controversial, and for Top and Controversial any period from the past hour to all time.
- **Comment threads**: each post's comments right after it, replies included, up to your per-post cap, with `depth`, `parentId` and `rootCommentId` on every comment, and `numberOfReplies` when the comment's replies were read.
- **Many subreddits per run**: one name or link per line. A link keeps its own sort (r/smallbusiness/top/?t=week).
- **Filters**: posted after or before a date (or "7 days"), minimum score, NSFW on or off. Filtered-out posts aren't charged.

### Use cases

- **Community and market research**: what a subreddit talks about, upvotes and argues over, with the comments that explain why.
- **Lead generation**: questions and complaints in your niche's subreddits, with the people asking.
- **Monitoring**: run your subreddits on a schedule with sort **New** and **Posted after** set to "1 day" to get only what's new.
- **Datasets for AI and analysis**: whole threads with `depth`, `parentId` and `rootCommentId`, ready to rebuild conversations.

### How much does it cost to scrape a subreddit?

You pay per result in your dataset: a post or a comment, both at the same price.

| Apify plan | Price per 1,000 results |
|---|---:|
| Free | $1.09 |
| Starter | $0.99 |
| Scale | $0.89 |
| Business | $0.79 |

Each post and comment is charged once per run. There's no start fee, and the run stops at your spending limit. For posts only, switch **Include comments** off.

### Input

The prefill reads r/smallbusiness and r/Entrepreneur, top posts of the week, 10 posts each with 4 comments per post. To change it:

- **Subreddits**: names (smallbusiness or r/smallbusiness) or links, one per line.
- **Sort** and **Period**: as on the subreddit's tabs; the period applies to Top and Controversial.
- **Max posts per subreddit**: Reddit lists about 1,000 posts per sort; use other sorts and periods for more.
- **Include comments** and **Max comments per post**: up to 100,000 comments per post. Reddit's first answer comes in its own order (Best, Top, New, Controversial, Old or Q\&A, under **Advanced**); on big threads the rest follow as they're read: 1,000 comments of a 3,141-comment thread took an 18 s run on 2026-10-22 (very large asks take longer).
- Below the first screen: **Filters** (dates, minimum score, NSFW) and **Advanced** (a total cap for the run, comment depth and sort, proxy).

```json
{
  "subreddits": ["smallbusiness", "https://www.reddit.com/r/Entrepreneur/new/"],
  "sort": "top",
  "time": "month",
  "maxItemsPerSource": 200,
  "includeComments": true,
  "maxCommentsPerPost": 50
}
```

### Output

Every row goes to one dataset, where `dataType` says what it is: `post` or `comment`. The Output tab shows a posts table (with a stats view), a comments table and both together. Download as JSON, CSV, Excel or HTML, or read it through the Apify API.

A comment row (prefilled run, shortened):

```json
{
  "dataType": "comment",
  "id": "t1_pd31rnp",
  "upVotes": 121,
  "createdAt": "2026-09-30T21:09:29Z",
  "depth": 0,
  "parentId": "t3_1wugesv",
  "postId": "t3_1wugesv",
  "postTitle": "My little home-based pet care business just crossed $35k in 6 months and I have nobody else to tell 😂",
  "communityName": "r/smallbusiness",
  "numberOfReplies": 3
}
```

**Post fields** (101): `id`, `url`, `title`, `body`, `communityName`, `username`, `upVotes`, `upvoteRatio`, `commentsCount`, `createdAt`, `flair`, `postType`, `contentUrl`, `domain`, `imageUrls`, `videoUrl`, `thumbnail`, `over18`, `ageHours`, `scorePerHour`, `commentsPerHour`, `engagementTotal`, `wordCount`, `bodyHtml`, `subredditSubscribers`, `authorId`, `authorFlairText`, `editedAt`, `isSelf`, `isVideo`, `isGallery`, `isDeletedOrRemoved`, `spoiler`, `locked`, `stickied`, `numCrossposts`, `numDuplicates`, `galleryImages`, `mediaAssets`, `permalink`, `shortUrl` and more.

**Comment fields** (61): `id`, `url`, `body`, `username`, `upVotes`, `createdAt`, `depth`, `parentId`, `parentKind`, `rootCommentId`, `postId`, `postTitle`, `postUrl`, `postUpVotes`, `postCommentsCount`, `postCreatedAt`, `postAuthor`, `communityName`, `numberOfReplies`, `isSubmitter`, `edited`, `stickied`, `bodyHtml` and more.

Every row also has `input` (which subreddit found it) and `scrapedAt` (when its page was read). Run totals, per-subreddit counts and anything not found are in the run's OUTPUT record.

### Is it legal to scrape Reddit?

This Actor reads only public Reddit content that anyone can see without logging in. It doesn't log in and doesn't touch private or quarantined communities. If your results include personal data, you're responsible for handling it lawfully (for example under GDPR).

### FAQ

**Why fewer posts than I asked for?** Reddit itself stops each subreddit sort at about 1,000 posts. Read the same subreddit in other sorts and periods (New, Top of the year, Top of all time) to get more.

**What if Reddit fails in the middle of a thread?** Each thread page is tried up to 4 times, each time from a new IP. If one still fails, the comments read so far stay in your dataset, and the run's status and OUTPUT (`commentsIncomplete`) list the posts whose threads stopped early.

**Is it fast?** Rows arrive page by page as Reddit answers, and the next post's comments are already being read while one is saved. The prefilled run (20 posts, 80 comments) took 10 and 12 seconds on Apify in two runs, the first row 1.8 and 4.3 seconds after the start (256 MB, datacenter proxy, October 22, 2026).

**Does my Apify plan matter?** Only for very large runs. Reddit allows 100 requests per IP every 10 minutes, and the run uses your plan's datacenter proxy IPs: 5 on the Free plan, more on paid plans. When every IP has used its 100, the run pauses until Reddit's window resets and says so in its status. If the pause would run past your run's timeout, it stops just before it and keeps every row it collected.

### Feedback

Found a bug or need a field? Open an issue on the Actor's Issues tab; we read every one. If the data was useful, a short review on the Store page helps others find it.

# Actor input Schema

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

Subreddit names or links, one per line: smallbusiness, r/smallbusiness or reddit.com/r/smallbusiness/top/?t=week (a link keeps its own sort). You get each subreddit's posts.

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

Order of posts, as on the subreddit's tabs.

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

How far back Top and Controversial look.

## `maxItemsPerSource` (type: `integer`):

Most posts per subreddit. Reddit lists about 1,000 posts per sort; use other sorts and periods for more.

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

Add each post's comments, replies included, right after the post. Each comment is one result.

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

Most comments to read per post, replies included, in Reddit's thread order (e.g. 4 for a quick look, 500 for whole threads).

## `postedAfter` (type: `string`):

Only posts and comments from after this date: 2026-09-01, 2026-09-01T12:00:00Z, or a period like '7 days' or '12 hours'.

## `postedBefore` (type: `string`):

Only posts and comments from before this date (same formats).

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

Skip posts with a lower score (upvotes minus downvotes), e.g. 10. Empty = no minimum.

## `includeNSFW` (type: `boolean`):

Keep posts and communities marked 18+.

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

Most rows for the whole run, every subreddit, post and comment counted together. Empty = no total cap.

## `commentDepth` (type: `integer`):

How deep in reply chains to go: 1 = top-level comments only, 10 = Reddit's maximum.

## `commentSort` (type: `string`):

Order of comments, as on Reddit.

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

Leave as is: Reddit answers Apify's datacenter proxy, the cheapest option. If you pick Residential, the run still reads through datacenter and uses your residential IPs only to retry a call Reddit refuses there.

## Actor input object example

```json
{
  "subreddits": [
    "smallbusiness",
    "Entrepreneur"
  ],
  "sort": "top",
  "time": "week",
  "maxItemsPerSource": 10,
  "includeComments": true,
  "maxCommentsPerPost": 4,
  "includeNSFW": true,
  "commentDepth": 10,
  "commentSort": "confidence",
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `posts` (type: `string`):

No description

## `comments` (type: `string`):

No description

## `overview` (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 = {
    "subreddits": [
        "smallbusiness",
        "Entrepreneur"
    ],
    "sort": "top",
    "time": "week",
    "maxItemsPerSource": 10,
    "includeComments": true,
    "maxCommentsPerPost": 4
};

// Run the Actor and wait for it to finish
const run = await client.actor("deepmine/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 = {
    "subreddits": [
        "smallbusiness",
        "Entrepreneur",
    ],
    "sort": "top",
    "time": "week",
    "maxItemsPerSource": 10,
    "includeComments": True,
    "maxCommentsPerPost": 4,
}

# Run the Actor and wait for it to finish
run = client.actor("deepmine/subreddit-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": [
    "smallbusiness",
    "Entrepreneur"
  ],
  "sort": "top",
  "time": "week",
  "maxItemsPerSource": 10,
  "includeComments": true,
  "maxCommentsPerPost": 4
}' |
apify call deepmine/subreddit-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,deepmine/subreddit-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/sh3I1h9R7jsOPPUOt/builds/YNtUWD4U8BLdW1Mq4/openapi.json
