# Reddit Scraper: Posts, Comments, Subreddits (`herus13/reddit-scraper`) Actor

Scrape Reddit posts, comments, subreddits and user profiles by search, subreddit, user or post link, with no login. Every row carries kind, post_id, title, body, author, subreddit, score, comment_count and created_at. Export JSON, CSV or Excel.

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

## Pricing

from $1.99 / 1,000 reddit 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/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

The Reddit Scraper extracts posts, comments, subreddit details and user profiles from Reddit, with no login and no API key. Search by phrase, read a subreddit or a user's history, or pull the full comment tree of any post, and get one clean row per item with score, author, text and dates.

### What you get

One row per item, tagged with its `kind`: `post`, `comment`, `subreddit` or `profile`. A post row carries the title, the full text, the link, the author, the subreddit, the score, the comment count, flair, dates and content flags such as NSFW, locked or removed.

```json
{
  "kind": "post",
  "source_input": "web scraping",
  "post_id": "t3_1abc23",
  "title": "How do you handle sites that change their markup every week?",
  "body": "We scrape about 40 shops and the selectors break constantly. What is your approach?",
  "author": "example_user",
  "subreddit": "webscraping",
  "score": 87,
  "comment_count": 34,
  "created_at": "2026-10-20T14:03:11Z",
  "permalink": "https://www.reddit.com/r/webscraping/comments/1abc23/how_do_you_handle_sites_that_change_their_markup/",
  "url": "https://www.reddit.com/r/webscraping/comments/1abc23/how_do_you_handle_sites_that_change_their_markup/",
  "scraped_at": "2026-10-28T09:00:00Z",
  "_meta": {"author": "https://apify.com/herus13", "status": "ok", "message": null}
}
```

`_meta` is run metadata, not scraped data. Comment rows carry the text, author, score, depth, parent and the post they belong to. In the Comments of a post mode the run also writes one `comments_report` row per post, saying how many comments Reddit lists for it, how many were read, and which branches were left out when a limit stopped the run. The report row is free.

### Input

| Field | Type | Required | Default | What it does |
|---|---|---|---|---|
| `mode` | string | yes | — | One kind of data per run. `search_posts` and `search_comments` read `queries`; `subreddit_feed` and `subreddit_info` read `subreddits`; `user_posts`, `user_comments` and `profile` read `users`; `post_comments` reads `posts`. Fill only the list your mode reads, the others must stay empty. |
| `queries` | array | no | — | Phrases to search Reddit for, one per entry. Used by the Search posts and Search comments modes. One search returns about 250 results at most; to go deeper the run repeats the phrase per subreddit, time window and order and removes duplicates. Leave empty when your mode does not read this list. |
| `subreddits` | array | no | — | Subreddit names or links, one per entry, for example `programming`, `r/programming` or `https://www.reddit.com/r/programming`. Used by the Subreddit posts and Subreddit details modes. Leave empty when your mode does not read this list. |
| `users` | array | no | — | User names or profile links, one per entry, for example `spez`, `u/spez` or `https://www.reddit.com/user/spez`. Used by the User posts, User comments and User profile modes. Leave empty when your mode does not read this list. |
| `posts` | array | no | — | Post links or ids, one per entry, for example `https://www.reddit.com/r/redditdev/comments/abc123/title/` or `abc123`. Used by the Comments of a post mode. Leave empty when your mode does not read this list. |
| `search_in_subreddits` | array | no | — | Search modes only. Restrict every phrase to these subreddits, one per entry. Leave empty to search all of Reddit. |
| `sort` | string | no | — | Order of the results. Search accepts RELEVANCE, HOT, TOP, NEW and COMMENTS; Subreddit posts accepts HOT, NEW, TOP and CONTROVERSIAL; User posts accepts NEW and HOT; User comments accepts NEW and TOP. Leave empty for the mode's default: RELEVANCE for search, NEW for the listings. Not used by the other modes. |
| `time_range` | string | no | — | Only results from this period: hour, day, week, month, year or all. Works in the search modes, and in Subreddit posts and User comments when the order is TOP (or CONTROVERSIAL for subreddits). Leave empty for no window. |
| `comment_sort` | string | no | — | Comments of a post mode only. Order of the comment tree: CONFIDENCE (Reddit's default), TOP, NEW, OLD, CONTROVERSIAL or QA. Leave empty for CONFIDENCE. |
| `max_items_per_target` | integer | no | `100` | How many posts or comments to return for each entry of the list your mode reads. Default 100, minimum 0, maximum 10000. Set 0 to return nothing. Reddit lists about 950 items per subreddit or user, and a single search about 250, so higher values only help when the source has that many. |
| `max_comments_per_post` | integer | no | `500` | Comments of a post mode only. How many comments to return for each post, replies included. Default 500, minimum 0, maximum 100000. Set 0 to return none. The run also writes one report row per post saying how many of the post's comments were read and which were left out. |
| `proxyUrls` | array | no | — | Leave empty: the run uses the residential proxy this actor ships with, included in the price of the run. To route the run through your own provider instead, add one gateway URL per entry, for example `http://user:pass@host:port` — works with any provider that issues URLs. When set, the run uses these first and switches to the included proxy if they stop working, so a broken proxy never fails the run. |

### How to run it

1. Pick a mode in What to collect.
2. Fill the one list that mode reads: search phrases, subreddits, users or posts.
3. Optionally set the order, a time window and a limit per entry.
4. Run it and export the dataset as JSON, CSV or Excel.

The newest 50 posts mentioning "web scraping" in two subreddits:

```json
{
  "mode": "search_posts",
  "queries": ["web scraping"],
  "search_in_subreddits": ["webscraping", "python"],
  "sort": "NEW",
  "max_items_per_target": 50
}
```

Minimal input:

```json
{
  "mode": "subreddit_feed",
  "subreddits": ["programming"]
}
```

Available as the MCP tool `herus13--reddit-scraper` on mcp.apify.com, so an AI agent can call it with the same input.

### Use cases

- **Brand and product monitoring**: search a name or a competitor every day with the New order and a past-day window, and see what people say before it reaches the news.
- **Market and audience research**: read the top posts and comments of the subreddits where your customers talk, to find the questions they keep asking and the words they use.
- **Sentiment and topic analysis**: feed post and comment text, scores and dates into a model or a spreadsheet and track a topic over weeks.
- **Community analysis**: compare subreddits by size, activity and what gets upvoted, using the subreddit details rows.
- **Lead and influencer discovery**: find the users who write the most helpful answers in your niche through their post and comment history, then read their profiles.
- **Datasets for AI**: build question-and-answer collections from a post and its full comment tree, with a report that tells you what share of the tree was read.

### FAQ

**Does it need a Reddit account or API key?** No. It reads what any visitor can see, without logging in.

**How many results can one run return?** In our tests a single search listed about 250 results and a subreddit or user listing about 950. To go deeper than a search allows, the run repeats each phrase per subreddit, time window and order and removes duplicates. For more than that, use several phrases or subreddits in one run.

**How do I know I got every comment of a post?** The Comments of a post mode writes a `comments_report` row for each post: the number of comments Reddit lists, the number returned, and the branches that remain if a limit stopped the run. Comments that were deleted before they could be read are not part of the count.

**Why did a subreddit or user return nothing?** The name may be misspelled, or the subreddit may be private or banned, or the user suspended. The log names the entry that could not be read and why, and a run where no entry could be read is reported as failed rather than as an empty success.

**Can I use my own proxy?** Yes. Paste gateway URLs into Your own proxy URLs and the run uses them first, then falls back to the included residential proxy if they fail.

**Is the data fresh?** Every run reads Reddit live, so rows reflect the moment of the run, and each row carries its `scraped_at` time.

### Related actors

- [YouTube Transcript Scraper](https://apify.com/herus13/youtube-transcript-scraper) — transcripts and subtitles of YouTube videos.
- [Instagram Comment Scraper](https://apify.com/herus13/instagram-comment-scraper) — comments of Instagram posts and reels.

# Actor input Schema

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

One kind of data per run. `search_posts` and `search_comments` read `queries`; `subreddit_feed` and `subreddit_info` read `subreddits`; `user_posts`, `user_comments` and `profile` read `users`; `post_comments` reads `posts`. Fill only the list your mode reads, the others must stay empty.

## `queries` (type: `array`):

Phrases to search Reddit for, one per entry. Used by the Search posts and Search comments modes. One search returns about 250 results at most; to go deeper the run repeats the phrase per subreddit, time window and order and removes duplicates. Leave empty when your mode does not read this list.

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

Subreddit names or links, one per entry, for example `programming`, `r/programming` or `https://www.reddit.com/r/programming`. Used by the Subreddit posts and Subreddit details modes. Leave empty when your mode does not read this list.

## `users` (type: `array`):

User names or profile links, one per entry, for example `spez`, `u/spez` or `https://www.reddit.com/user/spez`. Used by the User posts, User comments and User profile modes. Leave empty when your mode does not read this list.

## `posts` (type: `array`):

Post links or ids, one per entry, for example `https://www.reddit.com/r/redditdev/comments/abc123/title/` or `abc123`. Used by the Comments of a post mode. Leave empty when your mode does not read this list.

## `search_in_subreddits` (type: `array`):

Search modes only. Restrict every phrase to these subreddits, one per entry. Leave empty to search all of Reddit.

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

Order of the results. Search accepts RELEVANCE, HOT, TOP, NEW and COMMENTS; Subreddit posts accepts HOT, NEW, TOP and CONTROVERSIAL; User posts accepts NEW and HOT; User comments accepts NEW and TOP. Leave empty for the mode's default: RELEVANCE for search, NEW for the listings. Not used by the other modes.

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

Only results from this period: hour, day, week, month, year or all. Works in the search modes, and in Subreddit posts and User comments when the order is TOP (or CONTROVERSIAL for subreddits). Leave empty for no window.

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

Comments of a post mode only. Order of the comment tree: CONFIDENCE (Reddit's default), TOP, NEW, OLD, CONTROVERSIAL or QA. Leave empty for CONFIDENCE.

## `max_items_per_target` (type: `integer`):

How many posts or comments to return for each entry of the list your mode reads. Default 100, minimum 0, maximum 10000. Set 0 to return nothing. Reddit lists about 950 items per subreddit or user, and a single search about 250, so higher values only help when the source has that many.

## `max_comments_per_post` (type: `integer`):

Comments of a post mode only. How many comments to return for each post, replies included. Default 500, minimum 0, maximum 100000. Set 0 to return none. The run also writes one report row per post saying how many of the post's comments were read and which were left out.

## `proxyUrls` (type: `array`):

Leave empty: the run uses the residential proxy this actor ships with, included in the price of the run. To route the run through your own provider instead, add one gateway URL per entry, for example `http://user:pass@host:port` — works with any provider that issues URLs. When set, the run uses these first and switches to the included proxy if they stop working, so a broken proxy never fails the run.

## Actor input object example

```json
{
  "mode": "search_posts",
  "queries": [
    "web scraping"
  ],
  "max_items_per_target": 100,
  "max_comments_per_post": 500
}
```

# Actor output Schema

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

One row per post, comment, subreddit or user profile, depending on the mode, each tagged with its kind. The Comments of a post mode adds one comments_report row per post. Each row also carries \_meta: run metadata, not scraped data.

# 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 = {
    "mode": "search_posts",
    "queries": [
        "web scraping"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("herus13/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 = {
    "mode": "search_posts",
    "queries": ["web scraping"],
}

# Run the Actor and wait for it to finish
run = client.actor("herus13/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 '{
  "mode": "search_posts",
  "queries": [
    "web scraping"
  ]
}' |
apify call herus13/reddit-scraper --silent --output-dataset

```

## MCP server setup

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