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

Extract Reddit posts, nested comments as Markdown, and subreddit rules by subreddit, URL, author, or keyword. Track only new items on schedules and skip charges on errors. Not affiliated with Reddit.

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

## Pricing

from $0.50 / 1,000 post, thread or subreddit rows

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, Subreddits & Comments

Pass subreddit names, post URLs, share links, author usernames, or search keywords, and get structured Reddit posts, nested comment trees in LLM-ready Markdown, or subreddit metadata and rules as JSON, CSV, or Excel.

Turn on `onlyNewItems` on a schedule to collect and pay only for posts or comments not returned by prior runs. Empty input (`{}`) reads recent posts from `r/webscraping`. This Actor is an independent tool and is not affiliated with Reddit, Inc.

### What goes in and what comes out

| Input | What it returns |
|---|---|
| `subreddits` (`webscraping`, `r/python`, URL) | The newest `postsPerSource` posts from each subreddit (re-ordered by score or comment count with `sort: top` / `comments`), with optional nested comment trees |
| `postUrls` (post URL, `redd.it/<id>`, `/r/<sub>/s/...`, or ID) | Post metadata and optionally nested comment trees, up to `maxCommentsPerPost` per post (`includeComments: true` or `mode: "threads"`) |
| `startUrls` (mixed Reddit URLs) | Automatically routed to post, subreddit, or author extraction |
| `authors` (`spez`, `u/spez`, profile URL) | Public posts submitted by those users |
| `queries` (search keywords) | Matching posts inside the subreddits or authors you list. Without them, the Actor searches up to 5 communities whose names start with a keyword word (English letters and digits only). This is not a Reddit-wide search |
| `mode: "subreddits"` | Subreddit title, description, subscriber count, active users, NSFW flag, and community rules |

#### Quick start

Extract posts from a subreddit with keyword filtering and nested comments formatted as Markdown:

```json
{
    "mode": "posts",
    "subreddits": ["webscraping", "r/SaaS"],
    "queries": ["api"],
    "after": "7d",
    "includeComments": true,
    "maxCommentsPerPost": 30,
    "onlyNewItems": true,
    "maxItems": 20
}
```

Extract discussion threads as single LLM-ready Markdown rows:

```json
{
    "mode": "threads",
    "postUrls": ["https://www.reddit.com/r/SeveranceAppleTVPlus/comments/1k2vnz0/"],
    "commentSort": "top",
    "maxCommentsPerPost": 200,
    "maxItems": 10
}
```

### Output fields

Every row includes `id`, `type` (`post`, `thread`, `comment`, or `subreddit`), `source`, `capturedAt`, and `error` (`null` on delivered rows).

#### Post and thread rows

| Field | Description |
|---|---|
| `postId`, `url`, `permalink`, `subreddit` | Base36 ID, canonical Reddit URL, permalink, and subreddit name |
| `title`, `body`, `author`, `linkFlairText` | Post title, selftext body, author, and flair |
| `externalUrl`, `domain`, `thumbnailUrl`, `isSelf`, `isVideo`, `isNsfw`, `isSpoiler` | Link metadata and content flags |
| `score`, `upvoteRatio`, `numComments`, `metricsRefreshed` | Score, upvote ratio, comment count, and whether the counts were re-read after the first snapshot (see Data freshness) |
| `removedBy` | `null` for posts that look visible on Reddit. For a removed or deleted post: `moderator`, `automod_filtered`, `reddit`, `deleted`, `author`, or `removed` |
| `createdAt`, `retrievedAt` | Original creation time and index timestamp (ISO 8601 UTC) |
| `matchedTarget`, `matchedQuery`, `matchesQueryTerms` | Which target and keyword matched the row |
| `extractedCommentCount`, `comments[]`, `threadMarkdown`, `threadMarkdownTruncated` | Extracted comment count, nested comment array (`depth`, `parentId`, `isSubmitter`), and the thread as indented Markdown. `threadMarkdown` holds at most 60,000 characters: when comments do not fit, whole comments are left out from the end, the heading reads `Comments (k of N)`, and `threadMarkdownTruncated` is `true`. `comments[]` always has every extracted comment |

#### Comment rows (`mode: "comments"`)

| Field | Description |
|---|---|
| `commentId`, `postId`, `parentId`, `depth` | Comment ID, parent post ID, parent fullname (`t3_...` or `t1_...`), and nesting depth (`0` = top level; a reply whose parent is missing from the archive is also returned at `0` with its real `t1_` parent) |
| `subreddit`, `postTitle`, `postUrl`, `postAuthor` | Parent post context |
| `author`, `isSubmitter`, `distinguished`, `score`, `body`, `bodyMarkdown` | Author, OP flag, score, plain body, and Markdown-formatted comment block |
| `amaStatus` | On every comment: `answered` when its top-level thread has a reply from the original poster, otherwise `unanswered` |

#### Subreddit rows (`mode: "subreddits"`)

`subreddit`, `title`, `publicDescription`, `description`, `subscribers`, `activeUsers`, `isNsfw`, `lang`, `createdAt`, `rules[]` (`shortName`, `description`, `kind`).

#### Output example (shortened)

```json
{
    "id": "1abc901",
    "type": "post",
    "source": "reddit",
    "postId": "1abc901",
    "url": "https://www.reddit.com/r/webscraping/comments/1abc901/best_http_client/",
    "subreddit": "webscraping",
    "title": "Best HTTP client for TLS fingerprinting in Node.js",
    "author": "scrape_builder",
    "score": 28,
    "upvoteRatio": 0.94,
    "numComments": 2,
    "metricsRefreshed": true,
    "removedBy": null,
    "createdAt": "2026-11-16T03:33:20.000Z",
    "extractedCommentCount": 0,
    "error": null,
    "capturedAt": "2026-11-16T15:00:00.000Z"
}
```

### Data freshness and archive lag

Measured on active subreddits, 2026-11-16 UTC:

- New posts: in two 1,000-post runs on 2026-11-16 UTC, the newest post in each subreddit was 5–31 s behind (median 14 s; `r/AskReddit`, `r/technology`, `r/Python`, `r/SaaS`, `r/webscraping`).
- New comments: 28–66 s behind in 3 samples (`r/AskReddit` comments).
- Vote scores and comment counts: the archive first stores a post with its counts at that moment (often `score: 1`, `numComments: 0`). Many posts are re-read 3–36 hours after creation, but not all: in one 1,000-post run, 77 posts older than 36 hours still had only the first snapshot. `metricsRefreshed` is `true` only when the archive re-read the post or first indexed it 36+ hours after creation. Filter on it when vote counts matter.

#### Removed and deleted posts

Subreddit, author and keyword lists skip posts that moderators, Reddit or the author removed or deleted, so you get and pay only for posts people can still see. In a measured 1,000-post run across 5 active subreddits, 433 of the posts had been removed or deleted. Set `includeRemoved: true` to get them too; `removedBy` says who removed each one. A post you name in `postUrls` is always returned. Posts that AutoModerator held but whose text is still in the archive are returned: a moderator approves many of them later, and the archive cannot tell approved from still-held posts (in one check, 15 of 17 such posts were visible on Reddit). A removal that happens after the archive last read the post is not seen. So a few removed posts can still come through, and a few visible ones can be left out.

### Scheduled monitoring with `onlyNewItems`

When `onlyNewItems` is `true`, the Actor remembers delivered item IDs for 90 days in a named key-value store. Later scheduled runs skip already-delivered rows before writing and charging, so you pay only for new posts or comments.

The memory is kept per `mode`, set of targets and keywords (their order does not matter), `after`, `includeNsfw`, `includeRemoved`, `amaFilter`, and, when comments are attached, `maxCommentsPerPost` and `commentSort`. Changing any of these starts a fresh memory. In `posts` and `threads` mode a post is remembered by its ID, so a post already delivered is not returned again when new comments arrive; use `mode: "comments"` to follow new comments. Do not run the exact same input concurrently, as parallel runs read the same prior state.

### Pricing and free tier

This Actor uses pay-per-event pricing, like the top Reddit Actors: a `result` event for each post, thread, or subreddit row, and a `comment` event for each comment (a comment row, or each comment inside a thread row or a post row with `includeComments`). `apify-actor-start` is charged once per run start.

| Apify plan | Post, thread, or subreddit (per 1,000) | Comment (per 1,000) |
|---|---:|---:|
| Free | $0.80 | $0.60 |
| Starter (Bronze) | $0.80 | $0.52 |
| Scale (Silver) | $0.65 | $0.42 |
| Business (Gold) | $0.50 | $0.32 |

Example: a thread with 100 comments is one post plus 100 comments, $0.0008 + 100 × $0.00052 = $0.0528 on Starter (Bronze).

Apify's Free plan includes USD 5 of monthly usage, which covers about 6,250 posts or 8,333 comments at the Free plan price (run start fees aside). Comments cost the same in [Reddit Comments Scraper](https://apify.com/kizukidata/reddit-comments-scraper).

You are not charged when a post, subreddit, or user cannot be found or read on Reddit's side: the row says why in `error`, and these rows do not count toward `maxItems`. Invalid inputs and items skipped by `onlyNewItems` are not charged either.

### Integrations and MCP

#### MCP (Claude, Cursor, n8n)

Add this Actor to any MCP client:

```text
https://mcp.apify.com?tools=fetch-actor-details,kizukidata/reddit-scraper
```

- **Claude Code**: `claude mcp add --transport http apify "https://mcp.apify.com?tools=fetch-actor-details,kizukidata/reddit-scraper"`
- **Cursor / Claude Desktop**: configure an HTTP MCP connector with the URL above and your Apify API token.

#### API (cURL / Python / JavaScript)

```bash
curl -X POST "https://api.apify.com/v2/acts/kizukidata~reddit-scraper/runs?token=<APIFY_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{"subreddits":["webscraping"],"maxItems":20}'
```

```python
from apify_client import ApifyClient

client = ApifyClient("<APIFY_TOKEN>")
run = client.actor("kizukidata/reddit-scraper").call(run_input={
    "subreddits": ["webscraping"],
    "queries": ["proxy"],
    "onlyNewItems": True,
    "maxItems": 20,
})
items = list(client.dataset(run["defaultDatasetId"]).iterate_items())
```

### Related Kizuki Actors

- [Reddit Comments Scraper](https://apify.com/kizukidata/reddit-comments-scraper) — dedicated extractor for nested comment trees, AMA filtering, and LLM-ready Markdown threads, at a lower price per comment row.
- [Bluesky Scraper](https://apify.com/kizukidata/bluesky-monitor) — keyword posts, account feeds, and follower growth snapshots via AT Protocol.
- [Telegram Channel Scraper](https://apify.com/kizukidata/telegram-channel-feed) — public Telegram channel posts with views, reactions, and `onlyNewItems` monitoring.
- [YouTube Transcript Scraper](https://apify.com/kizukidata/youtube-transcripts) — video subtitles, chapters, and replay heatmaps as Markdown and RAG chunks.
- [Reddit User & Subreddit Scraper](https://apify.com/kizukidata/reddit-user-subreddit-scraper) — the posts and comments of a user, plus profile rows, and the rules and newest posts of a subreddit.

# Actor input Schema

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

posts (default): 1 row/post. threads: 1 row/post with nested comments and LLM Markdown. comments: 1 row/comment. subreddits: subreddit info and rules.

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

Subreddit names (webscraping, r/python) or URLs (up to 50 in this list). Empty input reads r/webscraping.

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

Reddit post URLs, redd.it links, /r/{subreddit}/s/... share links, or post IDs (e.g. 1k2vnz0). Up to 50.

## `startUrls` (type: `array`):

Mixed Reddit URLs (subreddit, post, share link, or user profile). Automatically routed by URL type (up to 50 in this list).

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

Reddit usernames (spez, u/spez) or profile URLs (up to 50).

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

Search phrases (2-120 chars, up to 10; supports "exact phrase", OR, -exclude). Searches inside the subreddits or authors you list; without them, searches up to 5 communities whose names start with the keyword (English letters and digits). Not a Reddit-wide search.

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

Order of the newest postsPerSource posts read from each source: new (default), top (score), or comments (comment count). Not an all-time top list.

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

Oldest post boundary: ISO date (2026-11-01), epoch seconds, or relative offset (24h, 7d, 30d). Empty means no cutoff.

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

Newest post boundary: ISO date, epoch seconds, or relative offset (e.g. 7d). Empty means now.

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

In posts mode, also attach nested comments and LLM-ready threadMarkdown to each post row.

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

Maximum comments extracted per post (0-1000; 0 = no per-post cap). Applies in threads/comments mode or when includeComments is true.

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

Order comments within each tree level: top (default), best, new, old, or controversial.

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

Filter top-level comment threads (root comment plus all replies) by OP replies: all (default), answered (OP replied somewhere in the thread), or unanswered (no OP reply).

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

Include posts marked NSFW (over_18). Off by default.

## `includeRemoved` (type: `boolean`):

Also return posts that moderators, Reddit or the author removed or deleted (the row's removedBy field says which). Off by default: subreddit, author and keyword lists skip them, so you only get and pay for posts people can still see. Posts you name in postUrls are always returned.

## `onlyNewItems` (type: `boolean`):

true skips rows already delivered by earlier runs with the same input (90-day state); false (default) returns all matching items.

## `postsPerSource` (type: `integer`):

Posts scanned per subreddit or author before maxItems (1-500, default 25).

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

Max charged rows returned per run (1-2000, default 20). Status rows (error set) are free and do not count toward this cap.

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

Proxy settings. Default uses no proxy. Residential proxies are not available.

## Actor input object example

```json
{
  "mode": "posts",
  "subreddits": [
    "webscraping",
    "r/SaaS"
  ],
  "postUrls": [
    "https://www.reddit.com/r/SeveranceAppleTVPlus/comments/1k2vnz0/"
  ],
  "queries": [
    "web scraping"
  ],
  "sort": "new",
  "after": "",
  "before": "",
  "includeComments": false,
  "maxCommentsPerPost": 50,
  "commentSort": "top",
  "amaFilter": "all",
  "includeNsfw": false,
  "includeRemoved": false,
  "onlyNewItems": false,
  "postsPerSource": 25,
  "maxItems": 20,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

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

Reddit posts, comment trees, comments, or subreddits returned by this run.

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

Status code, counters and skipped input entries of this run.

# 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": "posts",
    "sort": "new",
    "after": "",
    "before": "",
    "includeComments": false,
    "maxCommentsPerPost": 50,
    "commentSort": "top",
    "amaFilter": "all",
    "includeNsfw": false,
    "includeRemoved": false,
    "onlyNewItems": false,
    "postsPerSource": 25,
    "maxItems": 20,
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("kizukidata/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": "posts",
    "sort": "new",
    "after": "",
    "before": "",
    "includeComments": False,
    "maxCommentsPerPost": 50,
    "commentSort": "top",
    "amaFilter": "all",
    "includeNsfw": False,
    "includeRemoved": False,
    "onlyNewItems": False,
    "postsPerSource": 25,
    "maxItems": 20,
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("kizukidata/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": "posts",
  "sort": "new",
  "after": "",
  "before": "",
  "includeComments": false,
  "maxCommentsPerPost": 50,
  "commentSort": "top",
  "amaFilter": "all",
  "includeNsfw": false,
  "includeRemoved": false,
  "onlyNewItems": false,
  "postsPerSource": 25,
  "maxItems": 20,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call kizukidata/reddit-scraper --silent --output-dataset

```

## MCP server setup

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