# 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:** 2 total users, 1 monthly users, 80.0% 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 a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Reddit Post Comments Scraper",
        "description": "Scrapes full comment trees from Reddit posts — user handles, upvotes, nested replies, and per-comment sentiment.",
        "version": "2.0",
        "x-build-id": "D1ncyW1RHDRaPZ6Ft"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/electrabot.info~reddit-post-comments/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-electrabot.info-reddit-post-comments",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/electrabot.info~reddit-post-comments/runs": {
            "post": {
                "operationId": "runs-sync-electrabot.info-reddit-post-comments",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/electrabot.info~reddit-post-comments/run-sync": {
            "post": {
                "operationId": "run-sync-electrabot.info-reddit-post-comments",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "postUrls"
                ],
                "properties": {
                    "postUrls": {
                        "title": "Post URLs",
                        "type": "array",
                        "description": "Reddit post links: full www/old/np URLs or redd.it short links. Each comment found becomes one result.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "sort": {
                        "title": "Comment sort",
                        "enum": [
                            "best",
                            "top",
                            "new",
                            "controversial",
                            "old",
                            "qa"
                        ],
                        "type": "string",
                        "description": "Which comments Reddit surfaces first (matters when a post has more comments than the per-post limit).",
                        "default": "best"
                    },
                    "maxDepth": {
                        "title": "Max reply depth",
                        "minimum": 0,
                        "maximum": 50,
                        "type": "integer",
                        "description": "How deep into reply threads to go (0 = top-level comments only).",
                        "default": 10
                    },
                    "maxComments": {
                        "title": "Max comments per post",
                        "minimum": 1,
                        "maximum": 500,
                        "type": "integer",
                        "description": "Upper bound on comments loaded per post (1-500, Reddit's per-request ceiling).",
                        "default": 500
                    },
                    "proxyConfiguration": {
                        "title": "Proxy configuration",
                        "type": "object",
                        "description": "Default (recommended): automatic tiering - cheap datacenter proxy first, auto-escalating to RESIDENTIAL only if Reddit blocks it.",
                        "default": {
                            "useApifyProxy": true
                        }
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
