# Reddit Scraper V1 — Subreddit Feeds, Posts, Comments (4) (`red_crawler/reddit-content-fetcher`) Actor

FREE — Scrape Reddit posts and comments by URL or subreddit name. No Reddit account or OAuth required.

- **URL**: https://apify.com/red_crawler/reddit-content-fetcher.md
- **Developed by:** [Red Crawler](https://apify.com/red_crawler) (community)
- **Categories:** Automation, SEO tools, Social media
- **Features:** Limited permissions
- **Stats:** 48 total users, 16 monthly users, 100.0% runs succeeded, 3 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

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

## 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 — Subreddit Feeds, Posts, Comments

![Endpoints](https://img.shields.io/badge/endpoints-4-blue) ![Auth](https://img.shields.io/badge/Reddit_account-not_required-brightgreen) ![Proxy](https://img.shields.io/badge/proxy-not_required-brightgreen) ![Price](https://img.shields.io/badge/price-FREE-brightgreen) ![Cap](https://img.shields.io/badge/feed_cap-~1000_posts-lightgrey)

> **This actor is free.** There is no per-result fee. You only pay Apify's normal platform usage (the compute time of your run), and Apify's free plan gives you $5 of usage credit every month.

Scrape Reddit posts and comments by URL or subreddit name. Four self-contained endpoints — pull a subreddit's feed, a single post's full payload, a post's full comment tree, or a single comment's metadata. **No Reddit account or proxy required.**

Pick the endpoint, fill the matching section, hit **Start**.

***

### Endpoints at a glance

| # | Endpoint | Records returned | Best for |
|---|---|---|---|
| 1 | **Scrape Posts** | up to 500 posts (subreddit feed) | niche monitoring, daily snapshots, RSS-style feeds |
| 2 | **Post Detail** | 1 record (one post) | refreshing a single post, importing a thread |
| 3 | **Scrape Comments** | up to 500 (or uncapped) | sentiment, archives, megathread research |
| 4 | **Comment Detail** | 1 record (one comment) | quoting, refreshing one comment |

Every endpoint accepts URLs, prefixed fullnames, or raw IDs:

| Entity | Examples |
|---|---|
| post | `https://www.reddit.com/r/Wordpress/comments/1s4a4j6/` · `t3_1s4a4j6` · `1s4a4j6` |
| comment | `https://www.reddit.com/r/.../comment/lwbnv0t/` · `t1_lwbnv0t` · `lwbnv0t` |
| subreddit | `AskReddit` · `r/AskReddit` · `/r/AskReddit` · full subreddit URL |

***

### What you can fetch

#### 1. Scrape Posts — subreddit feed

Pulls a subreddit's post feed and **streams pages** so records appear in the dataset within seconds. Pages are fetched in 100s and stitched together up to your `limit`.

**Inputs**

| Field | Type | Default | Notes |
|---|---|---|---|
| `subreddit` | string | `AskReddit` | Subreddit name (without `r/`). |
| `sort` | enum | `hot` | `best` / `hot` / `new` / `top` / `rising` / `controversial`. |
| `time` | enum | *(none)* | Only used when sort is `top` / `controversial`. `hour` … `all`. |
| `limit` | int | `25` | 1 – 500. |

**Returns per post** — Reddit ID, fullname, title, body / selftext, author, subreddit, score, ups / downs / upvote ratio, comment count, crosspost count, created + edited timestamps, permalink, external URL, domain, post-type flags (`is_self`, `is_video`, `over_18`, `spoiler`, `locked`, `stickied`, `pinned`, `archived`), distinguished status, removal category, link & author flair, thumbnail, media (images / video / gallery), awards.

**Use it when** — niche monitoring, daily community snapshots, content syndication (`r/programming` `hot` → RSS), bulk research, competitor watching.

**Example I/O**

Input (Apify form):

```json
{
  "endpoint": "subreddit_posts",
  "subreddit": "Wordpress",
  "sort": "hot",
  "limit": 3
}
```

Output (one dataset record per post; first record shown, truncated):

```json
{
  "endpoint": "subreddit_posts",
  "id": "1r80vkz",
  "name": "t3_1r80vkz",
  "title": "Monthly AMA - Suggestions wanted!",
  "author": "RealKenshino",
  "author_fullname": "t2_6wkumqdb",
  "subreddit": "Wordpress",
  "subreddit_name_prefixed": "r/Wordpress",
  "subreddit_id": "t5_2qhjq",
  "score": 29,
  "ups": 29,
  "downs": 0,
  "upvote_ratio": 1.0,
  "num_comments": 12,
  "num_crossposts": 0,
  "created_utc": 1771415293.0,
  "edited": false,
  "permalink": "https://reddit.com/r/Wordpress/comments/1r80vkz/monthly_ama_suggestions_wanted/",
  "url": "https://www.reddit.com/r/Wordpress/comments/1r80vkz/monthly_ama_suggestions_wanted/",
  "domain": "self.Wordpress",
  "is_self": true,
  "is_video": false,
  "over_18": false,
  "locked": false,
  "stickied": true,
  "archived": false,
  "distinguished": "moderator",
  "author_flair_text": "WordPress.org Volunteer",
  "selftext": "We're launching a monthly AMA series featuring people from across the WordPress ecosystem...",
  "thumbnail": "self",
  "total_awards_received": 0,
  "...": "..."
}
```

***

#### 2. Post Detail

Full payload of a single post.

**Inputs**

| Field | Type | Notes |
|---|---|---|
| `post` | string | URL, `t3_` fullname, or raw ID. |

**Returns** — same rich post record as Scrape Posts.

**Use it when** — single-post deep dive, refreshing one record after an edit, importing a single thread.

**Example I/O**

Input (Apify form):

```json
{
  "endpoint": "post_detail",
  "post_detail_url": "https://www.reddit.com/r/Wordpress/comments/1s4a4j6/"
}
```

Output (one dataset record; `post` holds the full Reddit payload, truncated):

```json
{
  "endpoint": "post_detail",
  "post": {
    "id": "1s4a4j6",
    "name": "t3_1s4a4j6",
    "title": "Serious question: which group smokes more crack?",
    "author": "evanmac42",
    "author_fullname": "t2_ebufp",
    "subreddit": "Wordpress",
    "subreddit_name_prefixed": "r/Wordpress",
    "subreddit_id": "t5_2qhjq",
    "score": 87,
    "ups": 87,
    "upvote_ratio": 0.92,
    "num_comments": 41,
    "created_utc": 1774538392.0,
    "permalink": "/r/Wordpress/comments/1s4a4j6/serious_question_which_group_smokes_more_crack/",
    "url": "https://www.reddit.com/r/Wordpress/comments/1s4a4j6/serious_question_which_group_smokes_more_crack/",
    "domain": "self.Wordpress",
    "is_self": true,
    "is_video": false,
    "over_18": false,
    "locked": false,
    "stickied": false,
    "selftext": "MS - The new features team at Microsoft\n\nOR\n\nWPBE - the wordpress team that creates new features...",
    "link_flair_text": null,
    "total_awards_received": 0,
    "...": "..."
  }
}
```

***

#### 3. Scrape Comments — post comment tree

Comments under a single post, with control over how the tree is traversed.

**Inputs**

| Field | Type | Default | Notes |
|---|---|---|---|
| `post` | string | *(required)* | URL, `t3_`, or raw ID. |
| `sort` | enum | `top` | `best` / `top` / `new` / `controversial` / `old` / `qa`. |
| `mode` | enum | `custom` | `custom` (capped), `top_level` (top-level only), `all` (uncapped). |
| `count` | int | `100` | 1 – 500. Used by `custom` mode. |

**Returns per comment** — ID, fullname, parent post / parent comment IDs, author, body (markdown + HTML), score / ups / downs / controversiality, created + edited timestamps, permalink, OP flag (`is_submitter`), depth, stickied / distinguished / locked / archived / score-hidden flags, subreddit, awards.

**Use it when** — sentiment analysis, comment archives, support-ticket mining, debate / megathread research, training data.

**Example I/O**

Input (Apify form):

```json
{
  "endpoint": "post_comments",
  "comments_post_url": "https://www.reddit.com/r/Wordpress/comments/1s4a4j6/",
  "comments_num": 3,
  "comment_sort": "top",
  "comment_mode": "custom"
}
```

Output (one dataset record per comment; first record shown, truncated):

```json
{
  "endpoint": "post_comments",
  "id": "ocls9cs",
  "name": "t1_ocls9cs",
  "parent_id": "t3_1s4a4j6",
  "link_id": "t3_1s4a4j6",
  "author": "evanmac42",
  "author_fullname": "t2_ebufp",
  "body": "Microsoft experiments on users.\n\nWordPress experiments on developers.\n\nPick your poison.",
  "body_html": "<div class=\"md\"><p>Microsoft experiments on users.</p>\n\n<p>WordPress experiments on developers.</p>\n\n<p>Pick your poison.</p>\n</div>",
  "score": 46,
  "ups": 46,
  "downs": 0,
  "controversiality": 0,
  "created_utc": 1774541569.0,
  "edited": false,
  "permalink": "https://reddit.com/r/Wordpress/comments/1s4a4j6/serious_question_which_group_smokes_more_crack/ocls9cs/",
  "is_submitter": false,
  "depth": 0,
  "stickied": false,
  "distinguished": null,
  "score_hidden": false,
  "locked": false,
  "archived": false,
  "gilded": 0,
  "subreddit": "Wordpress",
  "subreddit_name_prefixed": "r/Wordpress",
  "subreddit_id": "t5_2qhjq",
  "total_awards_received": 0,
  "all_awardings": [],
  "...": "..."
}
```

***

#### 4. Comment Detail

Full payload of a single comment.

**Inputs**

| Field | Type | Notes |
|---|---|---|
| `comment` | string | URL, `t1_` fullname, or raw ID. |

**Returns** — same rich comment record as Scrape Comments.

**Use it when** — pulling a quoted comment, refreshing one record after edits, citation tooling.

**Example I/O**

Input (Apify form):

```json
{
  "endpoint": "comment_detail",
  "comment_url": "https://www.reddit.com/r/Wordpress/comments/1s4a4j6/comment/ocls9cs/"
}
```

Output (one dataset record; `comment` holds the full Reddit payload, truncated):

```json
{
  "endpoint": "comment_detail",
  "comment": {
    "id": "ocls9cs",
    "name": "t1_ocls9cs",
    "parent_id": "t3_1s4a4j6",
    "link_id": "t3_1s4a4j6",
    "author": "evanmac42",
    "author_fullname": "t2_ebufp",
    "body": "Microsoft experiments on users.\n\nWordPress experiments on developers.\n\nPick your poison.",
    "body_html": "<div class=\"md\"><p>Microsoft experiments on users.</p>\n\n<p>WordPress experiments on developers.</p>\n\n<p>Pick your poison.</p>\n</div>",
    "score": 46,
    "ups": 46,
    "downs": 0,
    "controversiality": 0,
    "created_utc": 1774541569.0,
    "edited": false,
    "permalink": "/r/Wordpress/comments/1s4a4j6/serious_question_which_group_smokes_more_crack/ocls9cs/",
    "is_submitter": false,
    "depth": 0,
    "stickied": false,
    "score_hidden": false,
    "locked": false,
    "archived": false,
    "subreddit": "Wordpress",
    "subreddit_name_prefixed": "r/Wordpress",
    "subreddit_id": "t5_2qhjq",
    "total_awards_received": 0,
    "...": "..."
  }
}
```

***

### How to run

1. **Pick an endpoint** in the "What to fetch" dropdown.
2. **Open the matching section** and fill its fields. Each section is independent — fields outside your chosen section are ignored.
3. **Click Start.**

Default subreddit is `AskReddit` and default test post is the public WordPress post — the actor runs out of the box.

***

### Output

Results are pushed to the actor's default dataset. View as a table or download as JSON / CSV / Excel / XML.

| Endpoint | Rows pushed |
|---|---|
| Scrape Posts | up to `limit` posts |
| Post Detail | 1 record |
| Scrape Comments | up to `count` (or uncapped if `mode=all`) |
| Comment Detail | 1 record |

Every record carries an `endpoint` field. Most useful columns (id, title, score, created, etc.) are placed first so the Table view is readable without scrolling.

***

### Status & error reference

**Run status** *(Apify-side, shown on the run page)*

| Status | Apify message | Meaning | What to do |
|---|---|---|---|
| <img src="https://redcrawler.com/s/apify_pill_succeeded_v11.png" alt="Succeeded" height="40" style="max-width:none" /> | "Actor succeeded with N results in the dataset" | Run finished. Some or zero records pushed. | Open the dataset to view results. |
| <img src="https://redcrawler.com/s/apify_pill_failed_v11.png" alt="Failed" height="40" style="max-width:none" /> | "The Actor process failed…" | Validation error or upstream Reddit fault. | Check the run log. You are NOT charged for failed runs. |
| <img src="https://redcrawler.com/s/apify_pill_timed_out_v11.png" alt="Timed out" height="40" style="max-width:none" /> | "The Actor timed out. You can resurrect it with a longer timeout to continue where you left off." | Run exceeded its timeout. | Re-run with a smaller `limit` or fewer inputs. |
| <img src="https://redcrawler.com/s/apify_pill_aborted_v11.png" alt="Aborted" height="40" style="max-width:none" /> | "The Actor process was aborted. You can resurrect it to continue where you left off." | You stopped the run manually. | No charge for unpushed results. |

**Common in-run conditions** *(visible in run log)*

| Condition | Cause | Result |
|---|---|---|
| Empty result set | Subreddit empty / banned / private. | Run `SUCCEEDED`, 0 records, no charge. |
| Removed post stub | Post was removed; metadata still partial. | Run `SUCCEEDED`, returns stub with `removed_by_category`. |
| `qa` sort fallback | `qa` sort outside QA-mode subs. | Run `SUCCEEDED`, falls back to `top`. |
| Validation error: `post` required | Missing `post` field on Detail / Comments. | Run `FAILED` immediately, no charge. |

***

### Common edge cases

- **Removed / deleted posts** return whatever metadata Reddit still exposes — often a stub with `removed_by_category`.
- **Private / quarantined subreddits** return zero records.
- **500 items per run** — `limit` and `count` go up to 500 per run. Split bigger jobs into several runs.
- **Comments `all` mode is uncapped** — long threads (10k+ comments) hit Reddit's tree size limit before our cap.
- **Comment `qa` sort** — only meaningful in QA-mode subreddits; falls back to `top` elsewhere.
- **NSFW content** — fully supported; the `over_18` flag tells you if a post is age-gated.

***

### Why this actor is fast

- **Speed — 1–3 seconds per call, end-to-end.** Pure HTTP to Reddit's API. No browser to boot, no Playwright / Selenium / Puppeteer overhead. Competing browser-based scrapers typically take 15–60 seconds per call.
- **Reliability — zero browser flakiness.** No headless-Chromium crashes. No JS-render timeouts. No captcha pages. No surprise mid-run failures from a browser quirk.
- **Footprint — under 100 MB RAM per run.** Most browser-based scrapers need 1–4 GB. Built for reliability behind the scenes — just paste your inputs and run.

***

### Pricing

**Free. There is no per-result fee** — we don't charge anything for the results you get, however many you pull.

You only pay Apify's normal platform usage, which is the compute time your run takes. Apify's free plan includes **$5 of usage credit every month**, so you can start right away without a paid plan.

***

### Need a different shape of data?

- **[Reddit Bulk Scrape](https://apify.com/red_crawler/reddit-bulk-scrape)** — paste up to 10000 IDs / names / URLs in a single run (posts, comments, subreddits, users)
- **[Reddit Search](https://apify.com/red_crawler/reddit-search)** — keyword search across posts, subreddits, users
- **[Reddit Users](https://apify.com/red_crawler/reddit-users)** — single-user lookups with profile + trophies + posts + comments
- **[Reddit Subreddits](https://apify.com/red_crawler/reddit-subreddits)** — subreddit info, rules, browse, listings, autocomplete (8 ops)
- **[Reddit Posts](https://apify.com/red_crawler/reddit-posts)** — front-page feed, crosspost duplicates, pinned posts

***

### Support and feedback

Found a bug, want a feature, or hit a Reddit error code we don't translate clearly? Open an issue via the actor's Apify Console feedback link, or reach out at the RedCrawler support channel.

***

*Reddit Scraper — Subreddit Feeds, Posts, Comments is part of the RedCrawler family of Reddit actors. RedCrawler is independent — not affiliated with, endorsed by, or sponsored by Reddit, Inc. Use it within Reddit's API terms.*

# Actor input Schema

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

Choose which kind of Reddit content to retrieve.

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

Subreddit name without the r/ prefix. Used by: Scrape Posts.

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

Post sort order. Used by: Scrape Posts.

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

Time window — IGNORED unless sort is set to 'top' or 'controversial'. Leave as '—' for other sort orders.

## `limit` (type: `integer`):

Max posts to fetch (1–500). Used by: Scrape Posts.

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

Reddit post permalink, t3_xxxxx, or short id. Used by: Post Detail.

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

Reddit post permalink, t3_xxxxx, or short id whose comments you want. Used by: Scrape Comments.

## `comments_num` (type: `integer`):

How many comments to return (1–500). Used by: Scrape Comments.

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

Comment sort order. Used by: Scrape Comments.

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

How to traverse the comment tree. 'custom' = full tree to count, 'top_level' = top comments only, 'all' = full tree no limit.

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

Reddit comment permalink, t1_xxxxx, or short id. Used by: Comment Detail.

## Actor input object example

```json
{
  "endpoint": "subreddit_posts",
  "subreddit": "AskReddit",
  "sort": "hot",
  "time_filter": "",
  "limit": 25,
  "post_detail_url": "https://www.reddit.com/r/Wordpress/comments/1s4a4j6/",
  "comments_post_url": "https://www.reddit.com/r/Wordpress/comments/1s4a4j6/",
  "comments_num": 100,
  "comment_sort": "top",
  "comment_mode": "custom"
}
```

# 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 = {
    "endpoint": "subreddit_posts",
    "subreddit": "AskReddit",
    "post_detail_url": "https://www.reddit.com/r/Wordpress/comments/1s4a4j6/",
    "comments_post_url": "https://www.reddit.com/r/Wordpress/comments/1s4a4j6/"
};

// Run the Actor and wait for it to finish
const run = await client.actor("red_crawler/reddit-content-fetcher").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 = {
    "endpoint": "subreddit_posts",
    "subreddit": "AskReddit",
    "post_detail_url": "https://www.reddit.com/r/Wordpress/comments/1s4a4j6/",
    "comments_post_url": "https://www.reddit.com/r/Wordpress/comments/1s4a4j6/",
}

# Run the Actor and wait for it to finish
run = client.actor("red_crawler/reddit-content-fetcher").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 '{
  "endpoint": "subreddit_posts",
  "subreddit": "AskReddit",
  "post_detail_url": "https://www.reddit.com/r/Wordpress/comments/1s4a4j6/",
  "comments_post_url": "https://www.reddit.com/r/Wordpress/comments/1s4a4j6/"
}' |
apify call red_crawler/reddit-content-fetcher --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,red_crawler/reddit-content-fetcher"
        }
    }
}
```

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/8ImnuBB3R4CINrdyh/builds/Rqoaf640DR5hpe0Sy/openapi.json
