# Reddit Scraper — Posts & Comments by Subreddit, Keyword or User (`hipersoft/reddit-scraper`) Actor

Scrape Reddit posts and comments by subreddit, keyword, author or thread URL. Get titles, self-text, scores, upvote ratio, comment counts, comment trees and permalinks — one clean row per post or comment. Export as JSON, CSV or Excel.

- **URL**: https://apify.com/hipersoft/reddit-scraper.md
- **Developed by:** [Hipersoft](https://apify.com/hipersoft) (community)
- **Categories:** Social media, News
- **Features:** Limited permissions
- **Stats:** 18 total users, 6 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.0017 / post scraped

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 Scraper — Posts & Comments by Subreddit, Keyword, User or URL

Scrape **Reddit** posts and comments into clean, structured **JSON, CSV or Excel**. Pull recent submissions from any **subreddit**, search Reddit by **keyword**, collect everything from a **user**, or drop in a **thread URL** to grab the post and its comment tree — one tidy row per post or comment. Built for market research, brand monitoring, sentiment analysis, lead discovery and automations.

![Reddit Scraper input input — configure the options in the Apify Console](https://api.apify.com/v2/key-value-stores/SUfvnaFLd9z9eBCtV/records/reddit-scraper-input.png)

### Best for history and research, not live rankings

This scraper shines at **going back in time**: pull a subreddit, keyword or author across any date range, years back. A real row from a March 2020 search of r/singapore:

```json
{
  "type": "post",
  "id": "feypa1",
  "subreddit": "singapore",
  "title": "Don't get a pet if you don't have the time",
  "author": "shaunreddits",
  "selftext": "I don't know why do people get a pet and not want to commit themselves to it pro",
  "score": 838,
  "scoreCapturedAt": "2020-04-22T18:28:39.000Z",
  "upvoteRatio": 1,
  "numComments": 86,
  "createdAt": "2020-03-07T17:57:13.000Z",
  "permalink": "https://www.reddit.com/r/singapore/comments/feypa1/dont_get_a_pet_if_you_dont_have_the_time/",
  "url": "https://www.reddit.com/r/singapore/comments/feypa1/dont_get_a_pet_if_you_dont_have_the_time/",
  "domain": "self.singapore",
  "flair": "Unverified",
  "isVideo": false,
  "over18": false
}
```

**How current are scores?** `score` and `numComments` were captured at `scoreCapturedAt`, usually soon after posting for recent content. A post from today can show a score of 1 even if it's now popular. For older content the capture date can be later, like the row above. If you need live vote counts or Reddit's "hot" ranking right now, this isn't the right tool. `sort: top` ranks only the rows collected, by captured score.

### Features

- 🧵 **Posts and comments** — collect submissions, comment threads, or both in a single run.
- 🌐 **Four ways to target** — by subreddit, by keyword search, by author, or by a direct thread URL.
- 📝 **Full text** — post titles and self-text (text posts) plus the full body of every comment.
- 📊 **Engagement metrics** — score, upvote ratio and comment count for each post.
- 🌳 **Comment trees** — link and parent ids on every comment so you can rebuild the reply structure.
- 🗓️ **Date filtering** — limit results to a date range, or to the last N days.
- 🔀 **Sort** — newest first, or the highest-scoring content first.
- 🔗 **Permalinks** — a ready-to-open reddit.com link for every post and comment.
- 📄 **Volume control** — `maxItems` and `maxItemsPerSource` to balance coverage and cost.

### Input

```json
{
  "subreddits": ["aww"],
  "type": "both",
  "sort": "new",
  "maxItems": 50
}
```

| Field | Description |
| --- | --- |
| `subreddits` | Subreddits to scrape, with or without `r/` (e.g. `aww`, `AskReddit`, `r/technology`). |
| `searchQueries` | Keywords to search across Reddit. Combined with `subreddits`, the search is limited to those subreddits. |
| `authors` | Reddit usernames to collect posts/comments from, with or without `u/`. |
| `postUrls` | Reddit thread URLs — each is expanded to its post plus the comments beneath it. |
| `type` | `posts`, `comments`, or `both`. Defaults to `posts`. |
| `sort` | `new` (most recent) or `top` (highest score). |
| `maxItems` | Maximum total posts + comments to collect (0 = no limit). |
| `maxItemsPerSource` | Optional cap per subreddit / keyword / author / URL (0 = no cap). |
| `postedAfter` / `postedBefore` | Optional date range — a date (`YYYY-MM-DD`) or a number of days ago (e.g. `7`). |
| `minScore` | Only rows with at least this captured score. |
| `includeNSFW` | Include posts marked NSFW (default on). |
| `commentsPerPost` | Also fetch up to this many comments per post (each charged as a comment). |

#### How to use

Pick one or more targets — a **subreddit**, a **keyword**, an **author**, or a **thread URL** — choose whether you want **posts, comments or both**, set `maxItems`, and run. Mix inputs freely: add a keyword and a subreddit together to search within that subreddit.

### Use cases

- Track brand, product or topic mentions across Reddit for sentiment and PR monitoring.
- Build datasets of posts and comments for research, NLP and trend analysis.
- Watch specific subreddits for new posts on keywords you care about.
- Pull an entire thread's comment tree for community and discourse analysis.
- Collect a user's post and comment history for account research.
- Feed structured Reddit records into a spreadsheet, database or analytics pipeline.

### What you get

Each **post** is one dataset record:

```json
{
  "type": "post",
  "id": "abc123",
  "subreddit": "aww",
  "title": "My cat just discovered the sunbeam",
  "author": "example_user",
  "selftext": "",
  "score": 5421,
  "upvoteRatio": 0.98,
  "numComments": 142,
  "createdAt": "2026-09-10T14:22:31.000Z",
  "permalink": "https://www.reddit.com/r/aww/comments/abc123/my_cat_just_discovered_the_sunbeam/",
  "url": "https://i.redd.it/xxxx.jpg",
  "domain": "i.redd.it",
  "flair": null,
  "isVideo": false,
  "over18": false
}
```

Each **comment** is one dataset record:

```json
{
  "type": "comment",
  "id": "def456",
  "subreddit": "aww",
  "author": "another_user",
  "body": "This is the best thing I've seen all day.",
  "score": 87,
  "createdAt": "2026-09-10T15:01:12.000Z",
  "linkId": "t3_abc123",
  "parentId": "t3_abc123",
  "permalink": "https://www.reddit.com/r/aww/comments/abc123/_/def456/"
}
```

![Reddit Scraper input output — the results as a clean dataset](https://api.apify.com/v2/key-value-stores/SUfvnaFLd9z9eBCtV/records/reddit-scraper-output.png)

#### Output schema

| Field | Type | Description |
|---|---|---|
| `type` | string | `post` or `comment`. |
| `id` | string | Reddit's base-36 id for the post or comment. |
| `subreddit` | string | Subreddit the item belongs to. |
| `title` | string | Post title (posts only). |
| `author` | string | Username of the poster / commenter. |
| `selftext` | string | Body text of a self/text post (posts only). |
| `body` | string | Comment text (comments only). |
| `score` | integer | Net score when captured (see `scoreCapturedAt`). |
| `scoreCapturedAt` | string | When the score and comment count were captured. |
| `upvoteRatio` | number | Fraction of votes that are upvotes (posts only). |
| `numComments` | integer | Number of comments on the post (posts only). |
| `createdAt` | string | Creation time in ISO 8601. |
| `permalink` | string (URL) | Direct reddit.com link to the item. |
| `url` | string (URL) | Outbound/link-post URL (posts only). |
| `domain` | string | Domain of the post's link (posts only). |
| `flair` | string | Link flair text where present (posts only). |
| `isVideo` | boolean | Whether the post is a Reddit-hosted video (posts only). |
| `over18` | boolean | Whether the post is marked NSFW (posts only). |
| `linkId` | string | Fullname of the post a comment belongs to (comments only). |
| `parentId` | string | Fullname of the comment's parent (comments only). |

### Feedback

How did it go? Good or bad, a [review](https://console.apify.com/actors/8MS9Iyb8bOWs2AaIk/reviews) helps other users decide and tells us what to improve. Something broken or missing? Open an [issue](https://apify.com/hipersoft/reddit-scraper/issues) and we'll look at it.

### Related Actors

- [Twitter Scraper](https://apify.com/hipersoft/twitter-scraper)
- [Bluesky Scraper](https://apify.com/hipersoft/bluesky-scraper)
- [YouTube Scraper](https://apify.com/hipersoft/youtube-scraper)
- [Hacker News Scraper](https://apify.com/hipersoft/hacker-news-scraper)

### FAQ

**Can I get a whole thread's comments?**
Yes. Put the thread URL in `postUrls` and set `type` to `comments` or `both` — you'll get the post and the comments beneath it.

**Can I filter by date?**
Yes. Use `postedAfter` and `postedBefore` with a date (`YYYY-MM-DD`) or a number of days ago.

**How many items can I collect?**
As many as your targets return. Use `maxItems` and `maxItemsPerSource` to control volume and cost.

**What export formats are supported?**
JSON, CSV, Excel and XML, plus the Apify API for programmatic access.

**Can I use this with n8n?**
Yes. Use the [Apify node for n8n](https://docs.apify.com/platform/integrations/n8n) to run this Actor and pull its dataset straight into an n8n workflow — trigger it on a schedule, then route the rows to a database, spreadsheet or messaging step.

**Can I connect it to other tools?**
The Reddit Scraper connects with almost any cloud service or web app thanks to [integrations on the Apify platform](https://apify.com/integrations). It works with [Make](https://apify.com/integrations/make), [Zapier](https://apify.com/integrations/zapier), [Slack](https://docs.apify.com/platform/integrations/slack), [Airbyte](https://docs.apify.com/platform/integrations/airbyte), [GitHub](https://docs.apify.com/platform/integrations/github), [Google Drive](https://docs.apify.com/platform/integrations/drive) and [many more](https://apify.com/integrations), plus the [Apify API](https://docs.apify.com/api/v2), JavaScript/Python clients and MCP. Or use [webhooks](https://docs.apify.com/platform/integrations/webhooks) to trigger an action whenever a run finishes.

### Notes

Returns only public Reddit content — the same posts and comments any visitor can see. This is an independent tool and is not affiliated with, endorsed by or connected to Reddit; "Reddit" is a trademark of its respective owner. Original clean-room implementation.

# Actor input Schema

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

Subreddits to scrape recent posts and/or comments from. Enter names with or without the r/ prefix, e.g. aww, AskReddit, r/technology.

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

Keywords to search across Reddit. If you also fill in Subreddits, the search is limited to those subreddits.

## `authors` (type: `array`):

Reddit usernames to collect posts and/or comments from. Enter with or without the u/ prefix, e.g. spez, u/example_user.

## `postUrls` (type: `array`):

Reddit thread URLs or permalinks. Each one is expanded to its post plus the comments underneath it, e.g. https://www.reddit.com/r/aww/comments/abc123/title/.

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

Collect posts, comments, or both.

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

New = the most recent content first. Top = the highest-scoring content first.

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

Maximum total number of posts + comments to collect across all sources (0 = no limit).

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

Optional cap on items collected from each individual subreddit, keyword, author or URL (0 = no per-source cap).

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

Only include content posted after this point. Accepts a date (YYYY-MM-DD or ISO) or a number of days ago (e.g. 7).

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

Only include content posted before this point. Accepts a date (YYYY-MM-DD or ISO) or a number of days ago (e.g. 1).

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

Only rows with at least this score. Scores are captured soon after posting for recent content, so use with care on new posts.

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

Include posts marked NSFW.

## `commentsPerPost` (type: `integer`):

Also fetch up to this many comments for each post collected. Each comment is charged as a comment.

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

Optional.

## Actor input object example

```json
{
  "subreddits": [
    "aww"
  ],
  "type": "both",
  "sort": "new",
  "maxItems": 50,
  "maxItemsPerSource": 0,
  "includeNSFW": true,
  "commentsPerPost": 0,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

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

The results as dataset items.

# 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": [
        "aww"
    ],
    "type": "both",
    "maxItems": 50,
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("hipersoft/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": ["aww"],
    "type": "both",
    "maxItems": 50,
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("hipersoft/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": [
    "aww"
  ],
  "type": "both",
  "maxItems": 50,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call hipersoft/reddit-scraper --silent --output-dataset

```

## MCP server setup

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