# Reddit Comments Scraper (Threads, Replies, Filters) (`himanshu-data/reddit-comments-scraper`) Actor

Scrape Reddit comments from post links, subreddits or Reddit search: author, text, score, depth, parent and post context. Filter by keyword or minimum score. Full reply threads, no login.

- **URL**: https://apify.com/himanshu-data/reddit-comments-scraper.md
- **Developed by:** [Himanshu Agrawal](https://apify.com/himanshu-data) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.10 / 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.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

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

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Reddit Comments Scraper (Threads, Replies, Filters)

Scrape **Reddit comments** from post links, from the top posts of any subreddit, or from Reddit search. Every comment comes with **author, text, score, depth, parent, time and link**, plus the post it belongs to (title, link, score, comments count). Full reply threads, best comments first. Keep only comments that **contain your keywords** or have a **minimum score**. No login, no API key.

### What you can use it for

- **Voice of customer:** what people really say about a product, brand or competitor in the comments.
- **Sentiment and AI datasets:** clean comment text with thread structure for training, RAG or analysis.
- **Market research:** pain points and feature requests from the busiest threads in your niche.
- **Lead generation:** find comments where people ask for a tool or service like yours.

### Input

| Field | What it does |
|---|---|
| Post links | Reddit posts whose comments you want. |
| Subreddits | Takes the top posts of each subreddit (Hot, New, Top or Rising) and scrapes their comments. |
| Search Reddit | Finds posts for keywords, then scrapes their comments. |
| Max posts per subreddit or search | How many posts to open. |
| Max comments per post | Best comments first, replies included. |
| Only comments containing | Keep comments with any of these words. |
| Minimum comment score | Skip low-scored comments. |
| Also save the post itself | Adds one row per post before its comments. |

```json
{
  "subreddits": ["technology"],
  "sort": "hot",
  "maxPostsPerSource": 10,
  "maxCommentsPerPost": 100,
  "minCommentScore": 2
}
```

### Output

One row per comment (real output, October 2026):

```json
{
  "type": "comment",
  "id": "phsb4vq",
  "postId": "1xaaong",
  "parentId": "1xaaong",
  "parentType": "post",
  "url": "https://www.reddit.com/r/technology/comments/1xaaong/comment/phsb4vq/",
  "author": "Dondontootles",
  "text": "Yes. More of this please",
  "score": 263,
  "depth": 0,
  "createdAt": "2026-10-19T22:17:23.905Z",
  "subreddit": "technology",
  "postTitle": "Developers Are Using AI to Strip Ads and Tracking From Smart TVs",
  "postUrl": "https://www.reddit.com/r/technology/comments/1xaaong/developers_are_using_ai_to_strip_ads_and_tracking/",
  "postScore": 7646,
  "postCommentsCount": 432
}
```

`parentId` and `depth` rebuild the full thread: depth 0 replies to the post, deeper comments reply to the comment in `parentId`.

### Pricing

**$1.50 per 1,000 comments** on paid Apify plans, less on Scale and Business. Comments skipped by your filters are not charged.

### Tips

- Need posts too? Use our Reddit Scraper (posts, comments, search and monitoring in one), or turn on **Also save the post itself**.
- Residential proxies are on by default because Reddit blocks data-center IPs.

# Actor input Schema

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

Reddit post links whose comments you want, e.g. https://www.reddit.com/r/india/comments/1xa551y/...

## `subreddits` (type: `array`):

Takes the top posts of each subreddit (by the sort below) and scrapes their comments.

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

Which posts to take from each subreddit.

## `searchQueries` (type: `array`):

Finds posts for these keywords and scrapes their comments.

## `searchInSubreddit` (type: `string`):

Leave empty to search all of Reddit.

## `searchSort` (type: `string`):

Order of search results.

## `timeFilter` (type: `string`):

Used by the Top sort and by search.

## `maxPostsPerSource` (type: `integer`):

How many posts to open from each subreddit or search.

## `maxCommentsPerPost` (type: `integer`):

Comments are taken in Reddit's default order (best first), replies included.

## `commentContains` (type: `array`):

Keep only comments that contain any of these words or phrases (not case-sensitive).

## `minCommentScore` (type: `integer`):

Skip comments with a lower score (upvotes minus downvotes).

## `includePostRows` (type: `boolean`):

Adds one row per post (title, text, score) before its comments.

## `postedAfter` (type: `string`):

Skip posts older than this date, e.g. 2026-10-01.

## `includeNsfw` (type: `boolean`):

Off skips posts Reddit marks as NSFW.

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

Reddit blocks data-center IPs, so residential proxies are used by default.

## Actor input object example

```json
{
  "subreddits": [
    "technology"
  ],
  "sort": "hot",
  "searchSort": "relevance",
  "timeFilter": "week",
  "maxPostsPerSource": 2,
  "maxCommentsPerPost": 20,
  "includePostRows": false,
  "includeNsfw": false,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "US"
  }
}
```

# Actor output Schema

## `results` (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 = {
    "subreddits": [
        "technology"
    ],
    "maxPostsPerSource": 2,
    "maxCommentsPerPost": 20,
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ],
        "apifyProxyCountry": "US"
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("himanshu-data/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 = {
    "subreddits": ["technology"],
    "maxPostsPerSource": 2,
    "maxCommentsPerPost": 20,
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
        "apifyProxyCountry": "US",
    },
}

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

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

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

```

## CLI example

```bash
echo '{
  "subreddits": [
    "technology"
  ],
  "maxPostsPerSource": 2,
  "maxCommentsPerPost": 20,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "US"
  }
}' |
apify call himanshu-data/reddit-comments-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,himanshu-data/reddit-comments-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/VnQM2VeBTSSZaKiPp/builds/ROXb8cl8UgWqYmLO1/openapi.json
