# Reddit Post Comments Scraper (`electrabot.info/reddit-post-comments`) Actor

Scrapes full comment trees from Reddit posts — user handles, upvotes, nested replies, and per-comment sentiment.

- **URL**: https://apify.com/electrabot.info/reddit-post-comments.md
- **Developed by:** [electra bot](https://apify.com/electrabot.info) (community)
- **Categories:** Social media, AI, Lead generation
- **Stats:** 1 total users, 0 monthly users, 85.2% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $4.00 / 1,000 comments

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/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 Post Comments Scraper

Extract **every comment** from any Reddit post — the full nested reply tree,
with author, score, depth, timestamps, and **built-in sentiment analysis** —
as JSON, CSV, or Excel.

Paste one or many post URLs. Comments come back flattened with `depth` and
`parentId` so you can rebuild the tree or analyze it flat.

**Pay per result** — you're charged per comment delivered. Failed or
unreachable posts cost nothing.

***

### What can I use it for?

- **Brand & product sentiment** — every comment is scored positive/negative/neutral out of the box; aggregate the mood of a thread in one pass.
- **Market & customer research** — mine discussion threads for pain points, feature requests, and objections in your niche.
- **AI training & RAG** — clean, structured comment text with threading intact.
- **Community & moderation analytics** — who's active, what scores well, how deep conversations go.
- **Trend monitoring** — track how a topic is discussed across many posts.

***

### Input

| Field | Required | Description |
|-------|----------|-------------|
| **Post URLs** | ✅ | Reddit post links — full `www`/`old`/`np` URLs or `redd.it` short links. Each comment found is one result. |
| **Comment sort** | – | `best` (default), `top`, `new`, `controversial`, `old`, `qa`. Matters when a post has more comments than the limit. |
| **Max reply depth** | – | How deep into reply threads to go (0 = top-level only; default 10). |
| **Max comments per post** | – | Upper bound per post (1–500; default 500). |
| **Proxy configuration** | – | **Automatic by default:** datacenter proxy first, auto-escalating to RESIDENTIAL when Reddit blocks it. |

### Output

One record per comment:

```json
{
  "postUrl": "https://www.reddit.com/r/programming/comments/1uo1w91/...",
  "postId": "1uo1w91",
  "postTitle": "What ORMs have taught me: just learn SQL",
  "subreddit": "programming",
  "commentId": "abc123",
  "parentId": null,
  "depth": 0,
  "author": "some_user",
  "body": "Honestly this matches my experience...",
  "score": 148,
  "createdAt": "2026-06-30T14:22:01Z",
  "permalink": "https://www.reddit.com/r/programming/comments/1uo1w91/.../abc123/",
  "sentiment": "positive",
  "sentimentScore": 0.6597,
  "isTopLevel": true
}
```

| Field | Description |
|-------|-------------|
| `depth` / `parentId` / `isTopLevel` | Reconstruct the thread tree, or analyze flat |
| `sentiment` / `sentimentScore` | VADER sentiment (tuned for social text): label + compound score (−1…+1) |
| `score` | Comment's net upvotes |
| `author` / `createdAt` / `permalink` | Who, when, and a direct link |

***

### Why this scraper is reliable

- **Beats Reddit's 2026 anti-bot walls** — Reddit now hard-blocks plain HTTP clients (even through residential proxies). This actor uses a real stealth browser session to reach the structured comment data, so you get clean JSON, not brittle HTML scraping.
- **Automatic proxy escalation** — starts on a cheap datacenter proxy and escalates to residential only when Reddit blocks it, so you get reliability without paying residential rates for every request.
- **Sentiment included** — no separate NLP step; every comment ships with a label and score.
- **Honest run statuses** — deleted/removed comments are skipped; unreachable posts are reported per post in the `SUMMARY` and never charged; a run with zero comments is marked **Failed**, never a silent empty dataset.
- **No silent truncation** — Reddit collapses the tail of huge threads into "load more" stubs. If a thread has more comments than were retrieved, the run says so and the `SUMMARY.posts` array reports `commentsAvailable` vs `commentsScraped` per post. You always know whether you got the whole thread.
- **Batch-safe** — comments are saved incrementally and runs are checkpointed: an interruption never loses finished posts or double-charges.

### Tips & limits

- **Big threads:** Reddit returns at most ~500 comments per request, and the tail of a large discussion collapses into "load more" stubs. Set **Max comments per post** to 500 to get as much as Reddit will serve; the run and `SUMMARY.posts` tell you exactly how many of the thread's comments you received (`commentsScraped` vs `commentsAvailable`).
- Deleted and removed comments are omitted (no body worth storing).
- For private, quarantined, or removed posts, the post is reported as failed in the `SUMMARY` — you're not charged for it.

### FAQ

**Does it get comments from a whole subreddit?**
This actor takes post URLs. Pair it with a subreddit/post-listing scraper and feed the post URLs in — each comment is one result.

**What sentiment engine is used?**
VADER — a lexicon tuned for social-media text (handles emphasis, negation, emoji, slang). `sentimentScore` is the compound score from −1 (most negative) to +1 (most positive).

**Why did a post fail?**
Check the run's `SUMMARY` — each failed post is listed with a reason (not found, private, removed). Failed posts are never charged.

**Is scraping Reddit legal?**
This actor accesses only publicly visible posts and comments. You are responsible for complying with applicable laws and Reddit's User Agreement. Don't scrape private or personal data.

***

### Disclaimer

**This is an unofficial tool. It is not affiliated with, endorsed by, sponsored by,
or in any way officially connected to Reddit, Inc.** "Reddit" and related names,
marks, and logos are trademarks of their respective owners and are used here for
descriptive purposes only.

This actor accesses only **publicly available** information. You are responsible
for ensuring your use complies with applicable laws, Reddit's User Agreement and
API terms, and applicable rate-limiting rules. Use it ethically and at your own risk.

# Actor input Schema

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

Reddit post links: full www/old/np URLs or redd.it short links. Each comment found becomes one result.

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

Which comments Reddit surfaces first (matters when a post has more comments than the per-post limit).

## `maxDepth` (type: `integer`):

How deep into reply threads to go (0 = top-level comments only).

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

Upper bound on comments loaded per post (1-500, Reddit's per-request ceiling).

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

Default (recommended): automatic tiering - cheap datacenter proxy first, auto-escalating to RESIDENTIAL only if Reddit blocks it.

## Actor input object example

```json
{
  "postUrls": [
    "https://www.reddit.com/r/programming/comments/1uo1w91/what_orms_have_taught_me_just_learn_sql/"
  ],
  "sort": "best",
  "maxDepth": 10,
  "maxComments": 500,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

Requested/scraped/failed counts and per-video failure reasons.

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

One record per video: full plain-text transcript, timed segments, language info, and video metadata.

# 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/programming/comments/1uo1w91/what_orms_have_taught_me_just_learn_sql/"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("electrabot.info/reddit-post-comments").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/programming/comments/1uo1w91/what_orms_have_taught_me_just_learn_sql/"],
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("electrabot.info/reddit-post-comments").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/programming/comments/1uo1w91/what_orms_have_taught_me_just_learn_sql/"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call electrabot.info/reddit-post-comments --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

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