# Reddit Comments Scraper (`shahidirfan/reddit-comments-scraper`) Actor

Extract detailed comments and discussion threads from Reddit instantly. Perfect for sentiment analysis, market research, and community monitoring. Get structured data from any post URL efficiently. Residential proxies are recommended for high-volume scraping stability.

- **URL**: https://apify.com/shahidirfan/reddit-comments-scraper.md
- **Developed by:** [Shahid Irfan](https://apify.com/shahidirfan) (community)
- **Categories:** Social media, Developer tools, Agents
- **Stats:** 41 total users, 5 monthly users, 100.0% runs succeeded, 1 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/platform/actors/running/actors-in-store#pay-per-usage

## 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

### What does Reddit Comments Scraper do?

Reddit Comments Scraper collects every comment from any public Reddit thread and returns a structured dataset with author details, scores, timestamps, threading depth, flair, moderation flags, and post context. Provide a Reddit post URL and set a comment limit. The output works with JSON, CSV, Excel, XML, and connected platforms for research, monitoring, or data pipelines.

### Why use Reddit Comments Scraper?

- **Complete discussion capture** - Collect top-level comments and nested replies from any public Reddit post in a single run.
- **Rich per-comment metadata** - Each record includes author, score, timestamps, depth, parent references, flair, moderation flags, awards, and post context.
- **Automation-ready output** - Export results to JSON, CSV, Excel, XML, or send them through webhooks, Google Sheets, Make, or Zapier.
- **No API key or login required** - The Actor works with public Reddit threads. No Reddit account or API credentials needed.
- **Schedule-friendly** - Run on demand or set recurring schedules to track discussions over time.

### What data can you extract from Reddit?

| Field | Description |
|-------|-------------|
| `id` | Reddit comment ID |
| `author` | Comment author or `[deleted]` |
| `body` | Comment text or `[removed]` |
| `score` | Comment score |
| `depth` | Reply depth in the thread |
| `permalink` | Direct URL to the comment |
| `post_title` | Parent post title |
| `subreddit` | Subreddit name |
| `created_at` | ISO timestamp |
| `stickied` | Whether the comment is stickied |

### How to use Reddit Comments Scraper

1. Open the Actor on Apify Store.
2. Paste a public Reddit post URL into the **Reddit Post URL** field.
3. Set the **Maximum number of comments** (optional, defaults to 20).
4. Choose proxy settings (Apify Residential Proxy is the default).
5. Click **Start** and wait for the extraction to complete.
6. Download the dataset or connect it to your workflow.

### Input Parameters

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| `startUrl` | String | Yes | - | Full URL of the Reddit thread to collect comments from |
| `results_wanted` | Integer | No | `20` | Maximum number of unique comments to collect |
| `proxyConfiguration` | Object | No | Apify Residential Proxy | Proxy settings for reliable collection |

### Output Data

| Field | Type | Description |
|-------|------|-------------|
| `id` | String | Reddit comment ID |
| `comment_fullname` | String | Full Reddit thing name |
| `author` | String | Comment author or `[deleted]` |
| `author_fullname` | String | Reddit fullname for the author |
| `body` | String | Comment text or `[removed]` |
| `body_html` | String | Comment body in HTML format |
| `score` | Number | Comment score |
| `ups` | Number | Upvote count |
| `downs` | Number | Downvote count |
| `created_utc` | Number | Unix timestamp |
| `created_at` | String | ISO timestamp |
| `edited` | Boolean or Number | Edit status or timestamp |
| `depth` | Number | Reply depth in the thread |
| `parent_id` | String | Parent thing ID |
| `parent_comment_id` | String | Parent comment ID |
| `parent_type` | String | Parent type (`t1` for comment, `t3` for post) |
| `link_id` | String | Parent post fullname |
| `permalink` | String | Absolute URL to the comment |
| `subreddit` | String | Subreddit name |
| `subreddit_id` | String | Subreddit ID |
| `subreddit_name_prefixed` | String | Prefixed name like `r/AskReddit` |
| `subreddit_type` | String | Subreddit visibility type |
| `post_id` | String | Parent post ID |
| `post_title` | String | Parent post title |
| `post_author` | String | Parent post author |
| `post_permalink` | String | Parent post URL |
| `is_submitter` | Boolean | Author is the post creator |
| `distinguished` | String | Mod or admin distinction |
| `stickied` | Boolean | Comment is stickied |
| `locked` | Boolean | Comment is locked |
| `archived` | Boolean | Comment is archived |
| `collapsed` | Boolean | Comment is collapsed |
| `controversiality` | Number | Controversiality score |
| `score_hidden` | Boolean | Score visibility |
| `gilded` | Number | Legacy gild count |
| `total_awards_received` | Number | Total awards |
| `all_awardings_count` | Number | Award entry count |
| `author_premium` | Boolean | Premium status |
| `author_is_blocked` | Boolean | Blocked status |
| `author_flair_text` | String | Flair text |
| `author_flair_type` | String | Flair type |
| `author_flair_text_color` | String | Flair text color |
| `author_flair_background_color` | String | Flair background color |
| `comment_type` | String | Comment classification |
| `treatment_tags` | Array | Reddit treatment tags |
| `retrieval_source` | String | Source (`listing` or `morechildren`) |
| `source_url` | String | Verified thread URL |

### Usage Examples

#### Basic Extraction

Collect 20 comments from a single Reddit thread:

```json
{
  "startUrl": "https://www.reddit.com/r/AskReddit/comments/1pqgcx9/whats_the_most_unexpected_way_someone_you_know/",
  "results_wanted": 20
}
```

#### Larger Collection

Increase the limit for threads with active discussions:

```json
{
  "startUrl": "https://www.reddit.com/r/webscraping/comments/1qs66k0/couldnt_find_proxy_directory_with_filters_so/",
  "results_wanted": 200
}
```

#### With Residential Proxies

Use Apify Residential Proxy for more reliable runs across many threads:

```json
{
  "startUrl": "https://www.reddit.com/r/AskReddit/comments/1pqgcx9/whats_the_most_unexpected_way_someone_you_know/",
  "results_wanted": 50,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": ["RESIDENTIAL"]
  }
}
```

### Sample Output

```json
{
  "id": "nuuw9it",
  "comment_fullname": "t1_nuuw9it",
  "author": "Agua_Frecuentemente",
  "body": "The guy who invented Smartfood lives in my town.",
  "score": 2851,
  "created_utc": 1766150326,
  "created_at": "2025-12-19T18:25:26.000Z",
  "depth": 0,
  "parent_id": "t3_1pqgcx9",
  "permalink": "https://www.reddit.com/r/AskReddit/comments/1pqgcx9/whats_the_most_unexpected_way_someone_you_know/nuuw9it/",
  "subreddit": "AskReddit",
  "subreddit_name_prefixed": "r/AskReddit",
  "post_id": "1pqgcx9",
  "post_title": "What's the most unexpected way someone you know became wealthy?",
  "is_submitter": false,
  "stickied": false,
  "locked": false,
  "archived": false,
  "retrieval_source": "listing",
  "source_url": "https://www.reddit.com/r/AskReddit/comments/1pqgcx9/whats_the_most_unexpected_way_someone_you_know/"
}
```

### Tips for Best Results

- Use public Reddit thread URLs only. Subreddit feeds, search pages, and private posts are not supported.
- Start with a small `results_wanted` value to verify the thread loads correctly before scaling up.
- Larger threads (500+ comments) may need a higher limit to capture more discussion data.
- Residential proxies help maintain stable runs when collecting from many threads or high-traffic posts.
- Some fields may be empty when the source does not publish that information. Check multiple results before assuming the Actor failed.

### Integrations

- **Google Sheets** - Export comment data to spreadsheets for analysis.
- **Webhooks** - Send run results to downstream systems after each completion.
- **Make or Zapier** - Connect results to no-code automations and workflows.
- **API** - Access datasets programmatically from your own applications.
- **Export formats** - JSON, CSV, Excel, XML, and other Apify-supported formats.

### Frequently Asked Questions

#### How many comments can I collect from a single thread?

You can collect any number up to the total comments in the thread. The `results_wanted` parameter sets the limit, and the Actor automatically fetches nested replies to reach your target.

#### Does this collect nested replies or just top-level comments?

It collects both top-level comments and all nested replies. The `depth` field preserves each comment's position in the reply tree, and the `parent_id` and `parent_comment_id` fields let you reconstruct the full thread structure.

#### How are duplicate comments handled?

The Actor deduplicates by comment ID and merges additional fields into a single record per ID. This prevents duplicates when Reddit returns the same comment through multiple expansion calls.

#### What happens when a comment author is deleted or the body is removed?

Deleted authors are replaced with `[deleted]` and removed bodies with `[removed]`. All other fields remain intact so your dataset stays usable even when Reddit's moderation removes content.

#### How long does a typical run take?

A run collecting 20 comments from a fresh thread usually completes within 30-60 seconds. Larger collections take longer because the Actor fetches more deferred comment batches, but the time scales proportionally.

#### Can I scrape private or restricted communities?

No. The Actor is designed for public Reddit threads only. Private communities and quarantined subreddits require authorization that this tool does not support.

#### Do I need an API key or authentication?

No API key or Reddit account login is required. The Actor works with public Reddit thread URLs directly.

#### What should I do if some fields are missing in the output?

Some fields may be empty when the source page does not publish that information. Check multiple results before assuming the Actor failed. If you consistently see missing data for fields that should exist, report it through the Issues tab.

### Related Actors

- [Reddit Community Scraper](https://apify.com/shahidirfan/reddit-community-scraper) - Extract posts, listings, and metadata from subreddits and Reddit communities.
- [YouTube Comments Scraper](https://apify.com/shahidirfan/youtube-comments-scraper) - Collect comments, replies, author details, and engagement metrics from YouTube videos.
- [Instagram Post Comments Scraper](https://apify.com/shahidirfan/instagram-post-comments-scraper) - Extract comments, likes, replies, and user profiles from Instagram posts.
- [Hacker News Data Scraper](https://apify.com/shahidirfan/hacker-news-data-scraper) - Collect stories, comments, and job postings from Hacker News categories.

### Support

For issues, feature requests, or custom Actor work, use the Issues tab on the Actor page or contact the developer through Apify.

### Legal Notice

This Actor is designed for legitimate data collection from publicly available Reddit threads. Users are responsible for using the data responsibly and complying with applicable laws, Reddit's terms of service, and privacy rules.

# Actor input Schema

## `startUrl` (type: `string`):

The URL of the Reddit post to scrape comments from.

## `results_wanted` (type: `integer`):

The maximum number of comments to collect. Leave empty to collect all comments.

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

Use Apify Proxy for reliable scraping.

## Actor input object example

```json
{
  "startUrl": "https://www.reddit.com/r/webscraping/comments/1qs66k0/couldnt_find_proxy_directory_with_filters_so/",
  "results_wanted": 20,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

## `overview` (type: `string`):

No description

# 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 = {
    "startUrl": "https://www.reddit.com/r/webscraping/comments/1qs66k0/couldnt_find_proxy_directory_with_filters_so/",
    "results_wanted": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("shahidirfan/reddit-comments-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 = {
    "startUrl": "https://www.reddit.com/r/webscraping/comments/1qs66k0/couldnt_find_proxy_directory_with_filters_so/",
    "results_wanted": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("shahidirfan/reddit-comments-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 '{
  "startUrl": "https://www.reddit.com/r/webscraping/comments/1qs66k0/couldnt_find_proxy_directory_with_filters_so/",
  "results_wanted": 20
}' |
apify call shahidirfan/reddit-comments-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/9sKMV0mJEBL7aguKE/builds/EaYSpGG28WvW4HxV0/openapi.json
