# Reddit Subreddit Scraper & API: Posts & Comments by Subreddit (`quarra/reddit-subreddit-scraper`) Actor

Subreddit scraper to get the posts of any subreddit: title, text, score, upvote ratio, comments count, author, flair, media, date, and the full comment tree if you want it. Hot, new, top, rising; date, flair and keyword filters; new posts only on a schedule.

- **URL**: https://apify.com/quarra/reddit-subreddit-scraper.md
- **Developed by:** [Quarra Labs](https://apify.com/quarra) (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 $2.20 / 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.
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

## Reddit Subreddit Scraper: Posts & Comments by Subreddit

Type subreddit names and get their posts: title, text, score, upvote ratio, comments count, author, flair, media,
domain and date, and each post's comments if you want them. Hot, new, top, rising or controversial, over the time
range you choose. No login, no cookies, no API key. Export as JSON, CSV or Excel, or read it through the Apify API.

- **Beyond Reddit's 1,000-post listing**: Reddit lists about 1,000 posts per subreddit sort. **Go beyond Reddit's
  listing cap** combines sorts and time ranges: 3,000 unique posts from one subreddit in our tests.
- **Comment trees on demand**: each post can come with its comments, each with `parentId` and `depth`, or as one
  Markdown record per thread for an LLM.
- **Filters that are not charged**: dates, flairs, post types, excluded keywords, NSFW. Removed posts cost nothing.
- **Only new posts on a schedule**: turn on **Only new since the last run** and each run returns and charges only the
  posts earlier runs did not return.

**$2.50 per 1,000 posts, $2.50 per 1,000 comments**, less on paid plans, plus $0.005 per run. Subreddits that fail,
duplicates and posts removed by your filters are not charged.

Optional **AI analysis** of each post and comment (sentiment, intent, entities, summary, pain point, business
signals, your own labels): **$0.50 per 1,000** analyzed records.

### Quick start

1. Type subreddit names into **Subreddits** (`technology`, `r/LocalLLaMA`, or a subreddit URL), one per line.
2. Choose a sort, a time range and **Max posts per subreddit**.
3. Click **Start** and read the posts in the run's **Output** tab.

Through the API:

```json
{
  "subreddits": ["LocalLLaMA", "selfhosted"],
  "sort": "top",
  "timeFilter": "week",
  "maxPostsPerSource": 50,
  "includeComments": true,
  "maxCommentsPerPost": 200,
  "outputFormat": "threadMarkdown"
}
```

Like any Apify Actor, it can be scheduled, connected to webhooks, Make, Zapier, n8n, or called by AI agents through
Apify's MCP server.

### Output

One record per post (and one per comment when you ask for them). A real post (October 11, 2026, author replaced, some
fields left out):

```json
{
  "type": "post",
  "id": "1x3b0mi",
  "url": "https://www.reddit.com/r/technology/comments/1x3b0mi/canadian_youtuber_builds_flocklike_camera_to/",
  "subreddit": "technology",
  "title": "Canadian YouTuber builds 'Flock-like' camera to exclusively track police vehicles — officers visit his home to express privacy concerns",
  "body": "",
  "author": "example_user",
  "createdAt": "2026-10-11T15:26:57Z",
  "score": 12460,
  "upvoteRatio": 0.99,
  "numComments": 376,
  "flair": "Privacy",
  "mediaType": "link",
  "domain": "tomshardware.com",
  "source": "r/technology",
  "scrapedAt": "2026-10-11T18:53:43Z"
}
```

| Field | What it holds |
|---|---|
| `title`, `body`, `flair` | the post as written, and its flair |
| `score`, `upvoteRatio`, `numComments` | the counters Reddit shows |
| `scorePerHour`, `commentsPerHour` | how fast the post grew since it went up |
| `mediaType`, `imageUrls`, `videoUrl`, `link`, `domain` | text, image, gallery, video or link, and the media links |
| `stickied`, `locked`, `over18`, `isDeletedOrRemoved` | the post's state |

Field names stay the same between runs: a value Reddit does not provide is `null`, not missing. The run summary is the
`OUTPUT` record of the run's key-value store.

### AI analysis (optional)

Turn on **AI analysis** and every post and comment gets an `aiAnalysis` object next to its own fields:
**$0.50 per 1,000 analyzed records, every field and signal included**. A real result (post "Best and inexpensive CRM
for small businesses" in r/CRM, analyzed October 14, 2026, with two labels of our own; some entities left out):

```json
"aiAnalysis": {
  "language": "en",
  "sentiment": "mixed",
  "sentimentScore": -0.2,
  "emotion": "anticipation",
  "intent": "seeking_recommendation",
  "category": "software",
  "topics": ["crm alternatives", "hubspot pricing", "small business software"],
  "entities": [{"name": "HubSpot", "type": "brand"}, {"name": "Zoho", "type": "brand"}, {"name": "Pipedrive", "type": "brand"}],
  "summary": "A user seeks a cheaper CRM alternative to HubSpot that retains key features like lead tracking and reporting for their small businesses.",
  "painPoint": "HubSpot is becoming too expensive",
  "wantsHelp": true,
  "buyingSignal": true,
  "mentionsPrice": true,
  "featureRequest": false,
  "isVendor": false,
  "relevance": null,
  "labels": {"switching": true, "budget": true}
}
```

| Field | What it holds |
|---|---|
| `sentiment`, `sentimentScore` | positive, negative, neutral or mixed, and a score from -1 to 1 |
| `emotion` | the main emotion (joy, frustration, anger, curiosity, confusion, none…) |
| `intent` | what the author wants: question, seeking_recommendation, complaint, praise, purchase_intent, comparison, announcement, self_promotion, discussion, humor |
| `category`, `topics`, `entities` | a category, up to 3 topics, and the brands, products, companies, people and places named |
| `summary`, `painPoint` | one English sentence, and the problem or frustration the author expresses (or null) |
| `wantsHelp`, `buyingSignal`, `mentionsPrice`, `featureRequest`, `isVendor` | business signals, true or false: asks for help, ready to buy or pay, names a price or budget, asks for a feature, sells or builds what they talk about |
| `relevance` | search results only (in [Reddit Search Scraper](https://apify.com/quarra/reddit-search-scraper)): how much the record is about the query, 0 to 1 |
| `labels` | your own yes/no labels |

**Your own labels**: up to 5, as `{"label_name": "what makes it true"}`, for example
`{"switching": "The author wants to switch from one product to another"}`. Included in the price.

- Charged once per record analyzed in full. Deleted, removed, bot (AutoModerator) and empty records are not analyzed
  and not charged. If an analysis fails, the record is still delivered (and charged as usual), its
  `aiAnalysisStatus` is `failed` with the reason in `aiAnalysisError`, and the analysis is not charged.
- Any language in, summaries in English. The first ~2,500 characters of a very long text are analyzed.
- Works with the one-record-per-item output format (not the Markdown thread format).
- It adds time: about a minute and a half per 100 records.

### Inputs

- **Subreddits**: names (`technology`, `r/technology`), URLs, or several joined by `+` for one listing.
- **Max posts per subreddit** and **Max results in total**.
- **Subreddit sort** (hot, new, top, rising, controversial) and **Time range** (for top and controversial).
- **Filters**: dates, NSFW, excluded keywords, post types, flairs, and **Go beyond Reddit's listing cap**.
- **Comments**: include the comments of each post, how many, how deep, in which order.
- **AI analysis** and **Your own labels**: the optional analysis described above.
- **Output format**: one record per item, or each thread as one Markdown record for LLMs.
- **Only new since the last run** and **Watch name**, for scheduled runs.

### Pricing

Pay per event:

| Apify plan | Posts | Comments |
|---|---|---|
| Free | $2.50 / 1,000 | $2.50 / 1,000 |
| Starter | $2.40 / 1,000 | $2.40 / 1,000 |
| Scale | $2.30 / 1,000 | $2.30 / 1,000 |
| Business and above | $2.20 / 1,000 | $2.20 / 1,000 |

AI analysis (optional): $0.50 / 1,000 analyzed records on every plan.

Plus the start: $0.005 per GB of run memory. Not charged: subreddits that fail, error records, duplicates, posts
removed by a filter, posts already returned to a watch. Set **Maximum cost per run** in the run options and the run
stops before going over it.

### Limits

- A subreddit's full history since its creation is not reachable: Reddit lists about 1,000 posts per sort, and going
  beyond combines sorts and time ranges.
- Quarantined and private communities are not scraped; the run says so for each one.

### FAQ

**How fast is it?** 50 posts of a subreddit in 4.7 to 6.0 seconds of run time on Apify, start included.

**Do I need a Reddit account or API key?** No account, no cookies, no API key. Platform costs are included in the
price.

**Is it legal?** It collects public posts any logged-out visitor can see. Reddit's terms and privacy law (GDPR in the
EU) apply to how you use the data.

**Does the Actor send anything to Quarra?** Only when a run fails or runs out of time: the Actor, its build, the error type, the line of our code where it happened, and the memory and time the run was given, so we can fix it fast. Never your input, your results, your account or the run ID.

### Related tools from Quarra

- [Reddit Scraper](https://apify.com/quarra/reddit-scraper): subreddits, searches, post URLs and users in one Actor.
- [Reddit Search Scraper](https://apify.com/quarra/reddit-search-scraper): posts and comments by keyword.
- [Reddit Comments Scraper](https://apify.com/quarra/reddit-comments-scraper): all the comments of posts from their
  links.

# Actor input Schema

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

Subreddit names (technology, r/technology), URLs, or several joined by + (pics+homelab, one listing). Posts are listed with the sort and time range below.

## `maxPostsPerSource` (type: `integer`):

Posts per subreddit or search query, comments per comment search, posts and comments per user history. Reddit lists ~1,000 posts per subreddit sort and ~250 per search; enable 'Go beyond Reddit's listing cap' for more. With 'Only new', this is the window watched.

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

Optional hard cap for the whole run, counted in charged results (posts + comments + profiles). Respected exactly. Empty = no global cap.

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

How subreddit posts are ordered. Use Top or Controversial with a time range. For monitoring, New is the fastest and cheapest.

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

Used by the Top and Controversial subreddit sorts and by searches (comment search: with the New sort only).

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

Only items created after this date (2026-09-01, or relative: 7 days). Applies to posts, user history and listing URLs.

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

Only items created before this date.

## `includeNsfw` (type: `boolean`):

Include posts marked NSFW (18+). Off by default.

## `excludeKeywords` (type: `array`):

Drop every post whose title or text contains one of these words or phrases, one per line (whole words, case and accents ignored; a comma belongs to the phrase, as in 10,000 views). Dropped items are not charged. Comment trees are not filtered; comments found by comment search are.

## `postTypes` (type: `array`):

Keep only these post types (mediaType). Empty = all types. Dropped posts are not charged.

## `flairs` (type: `array`):

Keep only posts with one of these flairs, written as on Reddit (Question, Help; case and accents ignored). Empty = all flairs. Dropped posts are not charged. In a search, the flair:"…" operator lets Reddit filter first.

## `deepScrape` (type: `boolean`):

When you need more posts than Reddit lists (~1,000 per subreddit sort, ~250 per search), combine extra sorts and time ranges and keep unique posts only. Posts outside the chosen sort may be added: use the date filters for a precise window.

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

For every post found in subreddits, searches, user histories and listing URLs, also scrape its complete comment tree (each comment has parentId and depth). Post URLs always include their comments.

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

Empty = the complete thread, even with tens of thousands of comments. 0 returns the post only. With Only new, each run returns up to this many comments of a thread that earlier runs did not return.

## `maxCommentDepth` (type: `integer`):

Empty = all levels. 0 = top-level comments only, 1 = plus direct replies, and so on. Deeper branches are not even requested (faster).

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

Order of comments inside each thread (Best is Reddit's default).

## `aiAnalysis` (type: `boolean`):

Adds aiAnalysis to every post and comment: language, sentiment and score (-1 to 1), emotion, intent (question, recommendation request, complaint, praise, purchase intent, comparison…), category, topics, named brands, products and people, a one-sentence English summary, the pain point, and business signals (wants help, buying signal, mentions a price, feature request, vendor). Search results also get a relevance score (0 to 1) against your query. Charged once per post or comment analyzed in full; deleted, removed, bot or empty records and failed analyses are free. Works with the items output format.

## `aiLabels` (type: `object`):

Up to 5 yes/no labels of your own, as {"label_name": "what makes it true"}. Each analyzed record gets labels: {label_name: true or false}. Example: {"switching": "The author wants to switch from one product to another", "budget": "The author states a budget"}. Included in the analysis price.

## `outputFormat` (type: `string`):

Thread Markdown: one record per post with its whole comment tree as indented Markdown (author, score, date, text), about 7 times fewer characters than the same thread as JSON. A thread too big for one record (over ~20,000 comments) comes as numbered parts. Same price: 1 post + 1 comment per comment included. Profiles stay normal records.

## `onlyNew` (type: `boolean`):

Remember what earlier runs of the same watch returned and output only new posts and new comments (with Include comments, also comments that earlier runs did not return under posts already seen; with Max comments per post, each run adds up to that many of them per thread, oldest included). Nothing already delivered is charged again, even after a run that timed out, was aborted or overlapped another. One run per watch at a time: a second one does nothing and charges nothing. Memory: key-value store quarra-reddit-watch-\<this Actor's ID, lowercase> of your account (a watch already kept in quarra-reddit-watch stays there). Set a watch name, then schedule the Actor.

## `watchName` (type: `string`):

Name of this watch's memory for 'Only new'. Recommended: runs with the same name share it even when you add or remove sources. Empty: the memory belongs to this exact set of inputs and filters, so adding a source starts a new watch that returns everything again (limits, output format and proxy don't count).

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

Connection. Keep the default (automatic). Costs are included in the price.

## Actor input object example

```json
{
  "subreddits": [
    "technology"
  ],
  "maxPostsPerSource": 20,
  "sort": "hot",
  "timeFilter": "all",
  "includeNsfw": false,
  "deepScrape": false,
  "includeComments": false,
  "commentSort": "confidence",
  "aiAnalysis": false,
  "outputFormat": "items",
  "onlyNew": false,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `results` (type: `string`):

Every record: posts, comments, profiles, communities and Markdown threads, each with a type field.

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

Posts only (type post).

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

Comments with parentId, depth and rootCommentId (type comment).

## `threads` (type: `string`):

With outputFormat threadMarkdown: one record per post with its whole comment tree as Markdown.

## `summary` (type: `string`):

Per-input status, errors, posts dropped by filters, per-thread completeness and watch statistics.

# 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"
    ],
    "maxPostsPerSource": 20,
    "includeComments": false,
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("quarra/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 = {
    "subreddits": ["technology"],
    "maxPostsPerSource": 20,
    "includeComments": False,
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("quarra/reddit-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": [
    "technology"
  ],
  "maxPostsPerSource": 20,
  "includeComments": false,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call quarra/reddit-subreddit-scraper --silent --output-dataset

```

## MCP server setup

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