# Reddit Comment Scraper | Threads & Replies (`newbs/reddit-comment-scraper`) Actor

Extract Reddit comments, scores, authors, timestamps, permalinks, and nested reply paths. Fast HTTP-first collection with automatic browser fallback.

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

## Pricing

from $6.00 / 1,000 comments

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Reddit Comment Scraper | Threads & Replies

Scrape comments and nested replies from public Reddit posts without a Reddit API key or login. Get one clean dataset row per comment, including author, score, timestamp, permalink, parent ID, reply depth, and post context.

The Actor tries Reddit's structured HTTP response first and automatically uses a browser fallback when a thread needs it. This keeps common runs fast while preserving reliability on difficult pages.

### What you can do

- Analyze product feedback, complaints, feature requests, and customer language.
- Export complete reply chains for sentiment analysis and topic classification.
- Build Reddit datasets for AI agents, RAG pipelines, and research.
- Monitor selected discussion threads from n8n, Make, Zapier, or Pipedream.
- Collect AMA questions and identify replies written by the original post author.
- Export results as JSON, CSV, Excel, XML, or RSS through Apify.

### Quick start

1. Add one or more direct Reddit post URLs.
2. Keep **Maximum Comments** at 25 for your first run.
3. Choose whether to include replies and how deep to follow them.
4. Run the Actor and open the **Comments** dataset view.

Example input:

```json
{
  "postUrls": [
    "https://www.reddit.com/r/AskReddit/comments/ovihp9/what_city_would_you_never_ever_ever_live_in/"
  ],
  "maxComments": 25,
  "includeReplies": true,
  "maxCommentDepth": 20,
  "sortBy": "top",
  "maxConcurrency": 2
}
```

The Actor accepts standard `reddit.com`, `old.reddit.com`, and short `redd.it` post links. Subreddit listing pages and Reddit search pages are not supported.

### Input

| Field | Default | Description |
| --- | ---: | --- |
| `postUrls` | Required | Direct public Reddit post URLs |
| `maxComments` | `25` | Maximum saved comments per post, including replies |
| `includeReplies` | `true` | Include nested replies |
| `maxCommentDepth` | `20` | Deepest reply level to save; `0` means top-level only |
| `sortBy` | `top` | `top`, `best`, `new`, `controversial`, `old`, or `qa` |
| `maxConcurrency` | `2` | Posts processed in parallel, from 1 to 4 |
| `proxy` | Residential | Proxy used by both HTTP and browser collection |
| `mcpOutputConnectors` | Empty | Optional Apify MCP destinations for a run summary |

`maxComments` applies to each post. For example, two URLs with `maxComments: 25` can save up to 50 paid comment rows.

### Output

Each dataset item is one comment or reply. The flat format works directly with spreadsheets, databases, BI tools, and AI workflows.

```json
{
  "postUrl": "https://www.reddit.com/r/example/comments/abc123/example_post/",
  "postId": "t3_abc123",
  "postTitle": "Example post",
  "postAuthor": "original_poster",
  "postScore": 123,
  "postText": "Post body when available",
  "postCreatedAt": "2026-07-20T08:00:00.000Z",
  "subreddit": "example",
  "commentId": "t1_def456",
  "parentCommentId": "t3_abc123",
  "commentAuthor": "commenter",
  "commentText": "Example comment",
  "commentScore": 42,
  "commentPermalink": "https://www.reddit.com/r/example/comments/abc123/example_post/def456/",
  "commentTimestamp": "2026-07-20T09:00:00.000Z",
  "commentDepth": 0,
  "commentPath": "0",
  "parentPath": null,
  "isTopLevel": true,
  "isPostAuthor": false,
  "replyCount": 3,
  "scrapeSource": "reddit-json",
  "scrapedAt": "2026-07-28T10:00:00.000Z"
}
```

Reddit does not expose every field on every page. Fields such as score, permalink, or post body can be `null` when they are unavailable.

The Actor also writes an `OUTPUT` run summary with per-post status, row count, collection source, duration, and an explanation when a post returns no rows. This avoids silent empty runs.

### Pricing

The Actor uses pay-per-event pricing:

- **$0.006 per saved comment**
- **$0.00005 when the Actor starts**
- Apify platform usage can also apply as shown in the Console pricing estimate

Estimated result charges:

| Saved comments | Result charge |
| ---: | ---: |
| 25 | $0.15 |
| 100 | $0.60 |
| 500 | $3.00 |

You are charged only for rows successfully saved under the `comment` event. The Actor respects the maximum run cost configured by the user and stops gracefully when that limit is reached.

### Ready-to-run examples

- [Analyze Reddit product feedback](https://apify.com/newbs/reddit-comment-scraper/examples/analyze-reddit-product-feedback?fpr=nmao3)
- [Find SaaS pain points on Reddit](https://apify.com/newbs/reddit-comment-scraper/examples/find-saas-pain-points-on-reddit?fpr=nmao3)
- [Export comments for sentiment analysis](https://apify.com/newbs/reddit-comment-scraper/examples/export-reddit-comments-for-sentiment-analysis?fpr=nmao3)
- [Analyze game launch feedback](https://apify.com/newbs/reddit-comment-scraper/examples/analyze-game-launch-feedback-reddit?fpr=nmao3)
- [Collect Reddit AMA questions](https://apify.com/newbs/reddit-comment-scraper/examples/collect-reddit-ama-questions?fpr=nmao3)
- [Research competitor discussions](https://apify.com/newbs/reddit-comment-scraper/examples/research-competitor-discussions-on-reddit?fpr=nmao3)
- [Extract customer complaints](https://apify.com/newbs/reddit-comment-scraper/examples/summarize-customer-complaints-from-reddit?fpr=nmao3)
- [Build a Reddit dataset for AI](https://apify.com/newbs/reddit-comment-scraper/examples/build-reddit-thread-dataset-for-ai?fpr=nmao3)

### API

JavaScript:

```javascript
const run = await apifyClient.actor("newbs/reddit-comment-scraper").call({
  postUrls: [
    "https://www.reddit.com/r/AskReddit/comments/ovihp9/what_city_would_you_never_ever_ever_live_in/"
  ],
  maxComments: 25,
  includeReplies: true,
  maxCommentDepth: 20,
  sortBy: "top"
});

const { items } = await apifyClient.dataset(run.defaultDatasetId).listItems();
```

Synchronous HTTP API:

```text
POST https://api.apify.com/v2/acts/newbs~reddit-comment-scraper/run-sync-get-dataset-items
```

Send the JSON input as the request body and authenticate with your Apify API token.

### Automation and AI

#### Apify MCP

Select this Actor in Apify's hosted MCP server or use:

```text
https://mcp.apify.com?tools=newbs/reddit-comment-scraper
```

The input, output, and dataset schemas let AI agents discover the tool and understand its result fields. Optional MCP output connectors can send a compact run summary and dataset link to an authenticated destination without exposing destination credentials to the Actor.

### Use with n8n

Use the official Apify node and choose **Run an Actor and Get Dataset**:

1. Set Actor ID to `newbs/reddit-comment-scraper`.
2. Pass the same JSON input shown above.
3. Send returned rows to Google Sheets, Slack, Notion, Airtable, a database, or an AI node.

The `integrations/n8n-workflows` directory also contains importable examples for clean export, pain-point scoring, thread metrics, AI research briefs, brand monitoring, and competitor research.

### Reliability and limitations

- Public Reddit posts only; private, quarantined, age-gated, or removed content may be unavailable.
- Deleted and removed comment bodies are skipped.
- Reddit can hide additional comments behind continuation requests. The Actor uses a browser fallback when the fast response indicates more comments are available.
- `maxCommentDepth` and `maxComments` intentionally limit the saved result set.
- Residential proxy traffic costs more than datacenter traffic but currently gives the best Reddit success rate.

### Support

For a failed or empty source, first open the run's **Run summary** output. It identifies the affected URL and explains whether the post was empty, unavailable, blocked, or stopped by a spending limit.

If the problem persists, open an issue on the Actor page and include the run ID and a public example URL. Do not include API tokens or proxy credentials.

### Changelog

#### July 2026

- Added HTTP-first collection that skips browser startup when possible.
- Kept automatic browser fallback for blocked or incomplete JSON responses.
- Added canonical support for reddit.com variants and redd.it links.
- Added comment score, permalink, parent ID, original-poster flag, post text, and collection source.
- Added maximum reply depth.
- Added a visible per-post run summary for empty and failed sources.
- Reduced the first-run default from 500 to 25 comments for clearer cost control.

# Actor input Schema

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

One or more direct Reddit post URLs. Supports reddit.com, old.reddit.com, and redd.it links. Subreddit listing and search URLs are not supported.

## `maxComments` (type: `integer`):

Maximum saved comments per post, including replies. This also caps pay-per-event result charges. Start with 25, then increase after checking the output.

## `includeReplies` (type: `boolean`):

Collect nested replies and preserve their parent-child thread structure. Disable this to collect top-level comments only.

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

Deepest reply level to save. Use 0 for top-level comments only, 1 for direct replies, or 20 for all available levels.

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

How to sort comments before collection. This affects which comments are collected when using maxComments limit.

## `maxConcurrency` (type: `integer`):

Maximum number of Reddit posts to process at the same time. Increase for faster runs, lower it if Reddit blocks requests.

## `proxy` (type: `object`):

Residential proxies provide the best Reddit success rate. Keep the default unless you have tested another proxy configuration.

## `mcpOutputConnectors` (type: `array`):

Optional Apify MCP connectors used after scraping to send a compact run summary and dataset link to an external tool such as Slack, Notion, GitHub, or another MCP-compatible destination.

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

Optional exact MCP tool name to call on each selected output connector. Leave empty to auto-select the first output-writing tool exposed by the connector.

## `mcpToolArguments` (type: `object`):

Optional JSON object merged into the MCP tool call. Use this for required destination fields such as channel, channel\_id, database\_id, repository, or page\_id.

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

Optional message template sent to MCP output tools. Supported tokens: {{rowsPushed}}, {{postsProcessed}}, {{datasetUrl}}, {{datasetApiUrl}}, {{runUrl}}, {{postUrls}}, {{sortBy}}, {{includeReplies}}.

## `failOnMcpDeliveryError` (type: `boolean`):

When enabled, the run fails if connector delivery fails. Keep disabled to preserve scraped dataset results even if a destination tool needs different arguments.

## Actor input object example

```json
{
  "postUrls": [
    "https://www.reddit.com/r/AskMec/comments/14990m6/les_applications_de_rencontres_fonctionnent_telles/"
  ],
  "maxComments": 25,
  "includeReplies": true,
  "maxCommentDepth": 20,
  "sortBy": "top",
  "maxConcurrency": 2,
  "proxy": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "US"
  },
  "mcpOutputConnectors": [],
  "mcpToolArguments": {},
  "failOnMcpDeliveryError": false
}
```

# Actor output Schema

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

Default dataset items. Each row contains one Reddit comment or reply with post metadata and thread-position fields.

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

Per-post status, row counts, collection source, duration, and a user-visible explanation for empty or failed sources.

# 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 = {
    "postUrls": [
        "https://www.reddit.com/r/AskMec/comments/14990m6/les_applications_de_rencontres_fonctionnent_telles/"
    ],
    "maxComments": 25,
    "maxCommentDepth": 20,
    "sortBy": "top",
    "maxConcurrency": 2
};

// Run the Actor and wait for it to finish
const run = await client.actor("newbs/reddit-comment-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 = {
    "postUrls": ["https://www.reddit.com/r/AskMec/comments/14990m6/les_applications_de_rencontres_fonctionnent_telles/"],
    "maxComments": 25,
    "maxCommentDepth": 20,
    "sortBy": "top",
    "maxConcurrency": 2,
}

# Run the Actor and wait for it to finish
run = client.actor("newbs/reddit-comment-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "postUrls": [
    "https://www.reddit.com/r/AskMec/comments/14990m6/les_applications_de_rencontres_fonctionnent_telles/"
  ],
  "maxComments": 25,
  "maxCommentDepth": 20,
  "sortBy": "top",
  "maxConcurrency": 2
}' |
apify call newbs/reddit-comment-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=newbs/reddit-comment-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/acts/ZkFVDxz01dxwlUD2M/builds/KJKNAltaJwuiU1Es5/openapi.json
