# Reddit Comment Scraper (`kawsar/reddit-comment-scraper`) Actor

High-performance Reddit web scraper. Extract thousands of comments instantly from any post, subreddit, or user profile.

- **URL**: https://apify.com/kawsar/reddit-comment-scraper.md
- **Developed by:** [Kawsar](https://apify.com/kawsar) (community)
- **Categories:** SEO tools
- **Stats:** 13 total users, 4 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.00 / 1,000 results

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 Comment Scraper: Unlimited Reddit Web Scraper for Comments

**Reddit Comment Scraper** is a high-performance Apify actor designed to **extract Reddit comments** quickly and reliably without login or API keys. Easily scrape thousands of comments from specific Reddit posts, entire subreddits, or user profiles using Reddit's public JSON API. Perfect for sentiment analysis, social listening, academic research, and monitoring brand discussions.

Provide Reddit URLs to instantly crawl and download Reddit comments into structured formats like JSON, CSV, or Excel.

### Use cases

- **Sentiment analysis**: collect deep comment data to measure audience perception of brands or topics.
- **Academic research**: gather massive conversational datasets for NLP research or social studies.
- **Market research**: see exactly what real users are saying about products or competitors in the replies.
- **Social listening**: track user activity or monitor specific discussions without hitting strict rate limits.

### How to use

Simply provide one or more valid Reddit URLs in the `startUrls` input field. The actor automatically detects the page type and routes the extraction accordingly.

Supported `startUrls`:

- **Post URL**: `https://www.reddit.com/r/technology/comments/123abcd/` (Extracts all replies)
- **Subreddit URL**: `https://www.reddit.com/r/technology/` (Extracts the newest/hottest comments across the whole subreddit)
- **User Profile URL**: `https://www.reddit.com/user/username/` (Extracts the user's comment history)

### Input configuration

| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `startUrls` | array | — | Reddit URLs (post, subreddit, or user) to extract comments from. |
| `sort` | string | `confidence` | Sort order for extracted comments (`confidence`/Best, `top`, `new`, `controversial`, `old`, `qa`). |
| `maxItems` | integer | `100` | Maximum number of comments to extract per run (hard cap: 5000). |
| `proxyConfiguration` | object | `Auto` | Select proxies to use. Apify Datacenter proxies are highly recommended. |

### Example Output

Results are stored in a simple, structured dataset format ready for export to JSON, CSV, or Excel.

```json
{
    "redditId": "t1_jk2xyz",
    "parsedId": "jk2xyz",
    "url": "https://www.reddit.com/r/programming/comments/144w7sn/best_resources/jk2xyz/",
    "postUrl": "https://www.reddit.com/r/programming/comments/144w7sn/best_resources/",
    "parentId": "t3_144w7sn",
    "username": "kawsarlog",
    "communityName": "r/programming",
    "body": "This is definitely one of the best ways to learn scripting in 2025. Highly agree.",
    "upVotes": 150,
    "numberOfReplies": 3,
    "isSubmitter": false,
    "createdAt": "2024-06-09T05:23:15.000Z",
    "scrapedAt": "2025-03-14T08:00:00.000Z"
}
```

### Advantages over the official API

Reddit's official API enforces strict rate limits and requires developer credentials. This scraper parses the public frontend data feeds behind the scenes, offering vast, unlimited scraping functionality built on robust Apify proxies.

### FAQ

**Do I need an account to scrape Reddit?**
No. Reddit Comment Scraper extracts publicly available data and does not require an account or authentication token.

**Are nested replies scraped too?**
Yes. When scraping a post, this actor recursively flattens the comment tree into easily analyzable individual rows. Provide `sort=top` to ensure you get the most visible comments first.

# Actor input Schema

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

List of Reddit URLs to scrape comments from. Supports posts, user profiles, subreddits, and search URLs.

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

Sort order for comments.

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

Maximum number of comments to collect per run.

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

Select proxies to use for requests. Helps avoid IP blocking.

## Actor input object example

```json
{
  "startUrls": [
    "https://www.reddit.com/r/AskMen/comments/1rt23re/how_to_overcome_lust_as_a_touch_deprived_man/"
  ],
  "sort": "confidence",
  "maxItems": 100,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# 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 = {
    "startUrls": [
        "https://www.reddit.com/r/AskMen/comments/1rt23re/how_to_overcome_lust_as_a_touch_deprived_man/"
    ],
    "sort": "confidence",
    "maxItems": 100,
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("kawsar/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 = {
    "startUrls": ["https://www.reddit.com/r/AskMen/comments/1rt23re/how_to_overcome_lust_as_a_touch_deprived_man/"],
    "sort": "confidence",
    "maxItems": 100,
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("kawsar/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 '{
  "startUrls": [
    "https://www.reddit.com/r/AskMen/comments/1rt23re/how_to_overcome_lust_as_a_touch_deprived_man/"
  ],
  "sort": "confidence",
  "maxItems": 100,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call kawsar/reddit-comment-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

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