# Reddit Comments Search Scraper (`powerai/reddit-comments-search-scraper`) Actor

Search archived Reddit comments by subreddit, author, post, or parent comment. Filter by body text, time range, and sort order with automatic pagination. 💬

- **URL**: https://apify.com/powerai/reddit-comments-search-scraper.md
- **Developed by:** [PowerAI](https://apify.com/powerai) (community)
- **Categories:** Social media, Integrations, Open source
- **Stats:** 3 total users, 2 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

from $4.99 / 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 Comments Search Scraper

Search archived Reddit comments within a subreddit, by author, under a specific post, or under a parent comment. Filter by body text and time range with automatic pagination.

### Key Features

- Search comments by body text within a subreddit or scope
- Filter by author, link ID, or parent comment ID
- Support `after` and `before` time range filters
- Automatic pagination using the last comment's `created` timestamp
- Configurable per-request `limit` (1-100) and total `maxItems`
- Optional proxy configuration

### Input

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| subreddit | string | No\* | Subreddit name without r/ |
| author | string | No\* | Filter by username |
| link\_id | string | No\* | Post link ID, e.g. t3\_1ubt2cm |
| parent\_id | string | No\* | Parent comment ID, e.g. t1\_abc123 |
| body | string | No | Search comment body (requires one scope field above) |
| after | string | No | Created after (Unix timestamp or date) |
| before | string | No | Created before (Unix timestamp or ISO date) |
| limit | integer | No | Comments per request, 1-100 (default: 100) |
| sort | string | No | `desc` or `asc` (default: desc) |
| maxItems | integer | No | Max total comments (default: 100) |
| proxyConfiguration | object | No | Proxy settings |

\* At least one of `subreddit`, `author`, `link_id`, or `parent_id` is required.

#### Input Example

```json
{
    "subreddit": "chatgpt",
    "body": "token",
    "sort": "desc",
    "limit": 10,
    "maxItems": 50
}
```

### Output

Each result includes the full Reddit comment payload plus metadata:

```json
{
	"subreddit": "ChatGPT",
	"all_awardings": [],
	"approved_at_utc": null,
	"approved_by": null,
	"archived": false,
	"associated_award": null,
	"author": "Fit-Yesterday7032",
	"author_flair_background_color": null,
	"author_flair_css_class": null,
	"author_flair_richtext": [],
	"author_flair_template_id": null,
	"author_flair_text": null,
	"author_flair_text_color": null,
	"author_flair_type": "text",
	"author_fullname": "t2_2g1dgyb02p",
	"author_is_blocked": false,
	"author_patreon_flair": false,
	"author_premium": false,
	"awarders": [],
	"banned_at_utc": null,
	"banned_by": null,
	"body": "Semantics\n\nYou're conflating Generative Ai in general and commercial LLMs. One, indeed, only prioritizes that a token is produced; the other doesn't.\n\nWhile LLMs are a type of Generative AI, they are increasingly being designed to be accurate. Through techniques like RLHF (Reinforcement Learning from Human Feedback) and RAG (Retrieval-Augmented Generation), developers ARE trying to make them \"try\" to be accurate.\n\nTo claim that they \"can't fail at doing something they are not even trying to do\" is a semantic technicality. While the base model just predicts text, the product (like ChatGPT or Gemini) is absolutely designed and marketed to provide accurate information. Therefore, when they provide false info, it is a \"mistake\".",
	"can_gild": false,
	"can_mod_post": false,
	"collapsed": false,
	"collapsed_because_crowd_control": null,
	"collapsed_reason": null,
	"collapsed_reason_code": null,
	"comment_type": null,
	"controversiality": 0,
	"created": 1782348795,
	"created_utc": 1782348795,
	"distinguished": null,
	"downs": 0,
	"edited": false,
	"gilded": 0,
	"gildings": {},
	"id": "otmyisp",
	"is_submitter": false,
	"likes": null,
	"link_id": "t3_1qliqds",
	"locked": false,
	"mod_note": null,
	"mod_reason_by": null,
	"mod_reason_title": null,
	"mod_reports": [],
	"name": "t1_otmyisp",
	"no_follow": true,
	"num_reports": null,
	"parent_id": "t1_o1kbd5c",
	"permalink": "/r/ChatGPT/comments/1qliqds/has_anyone_noticed_that_chatgpt_does_not_admit_to/otmyisp/",
	"profile_img": "https://www.redditstatic.com/avatars/defaults/v2/avatar_default_1.png",
	"profile_over_18": false,
	"removal_reason": null,
	"replies": "",
	"report_reasons": null,
	"retrieved_on": 1782348813,
	"saved": false,
	"score": 1,
	"score_hidden": true,
	"send_replies": true,
	"stickied": false,
	"subreddit_id": "t5_7hqomg",
	"subreddit_name_prefixed": "r/ChatGPT",
	"subreddit_type": "public",
	"top_awarded_type": null,
	"total_awards_received": 0,
	"treatment_tags": [],
	"unrepliable_reason": null,
	"ups": 1,
	"user_reports": [],
	"body_html": "<div class=\"md\"><p>Semantics</p>\n\n<p>You&#39;re conflating Generative Ai in general and commercial LLMs. One, indeed, only prioritizes that a token is produced; the other doesn&#39;t.</p>\n\n<p>While LLMs are a type of Generative AI, they are increasingly being designed to be accurate. Through techniques like RLHF (Reinforcement Learning from Human Feedback) and RAG (Retrieval-Augmented Generation), developers ARE trying to make them &quot;try&quot; to be accurate.</p>\n\n<p>To claim that they &quot;can&#39;t fail at doing something they are not even trying to do&quot; is a semantic technicality. While the base model just predicts text, the product (like ChatGPT or Gemini) is absolutely designed and marketed to provide accurate information. Therefore, when they provide false info, it is a &quot;mistake&quot;.</p></div>",
	"scrapedAt": "2026-06-25T02:15:31.707Z"
}
```

### Use Cases

- Subreddit comment monitoring and research
- Keyword tracking in community discussions
- Extracting replies under a specific post or thread
- Author comment history analysis

# Actor input Schema

## `subreddit` (type: `string`):

Subreddit name without r/, e.g. chatgpt

## `author` (type: `string`):

Filter by Reddit username

## `after` (type: `string`):

Only include comments created after this time (Unix timestamp or date)

## `before` (type: `string`):

Only include comments created before this time (Unix timestamp or ISO date). Pagination uses the last item created value automatically

## `limit` (type: `integer`):

Number of comments per API request (1-100)

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

Sort order by created time

## `link_id` (type: `string`):

Filter comments by post link ID, e.g. t3\_1ubt2cm

## `parent_id` (type: `string`):

Filter replies under a parent comment ID, e.g. t1\_abc123

## `body` (type: `string`):

Search comment body text. Requires at least one of: subreddit, author, link\_id, or parent\_id

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

Maximum total number of comments to scrape

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

Proxy settings for the actor

## Actor input object example

```json
{
  "subreddit": "chatgpt",
  "author": "",
  "after": "",
  "before": "",
  "limit": 100,
  "sort": "desc",
  "link_id": "",
  "parent_id": "",
  "body": "token",
  "maxItems": 100,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# 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 = {
    "subreddit": "chatgpt",
    "author": "",
    "after": "",
    "before": "",
    "limit": 100,
    "sort": "desc",
    "link_id": "",
    "parent_id": "",
    "body": "token",
    "maxItems": 100
};

// Run the Actor and wait for it to finish
const run = await client.actor("powerai/reddit-comments-search-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 = {
    "subreddit": "chatgpt",
    "author": "",
    "after": "",
    "before": "",
    "limit": 100,
    "sort": "desc",
    "link_id": "",
    "parent_id": "",
    "body": "token",
    "maxItems": 100,
}

# Run the Actor and wait for it to finish
run = client.actor("powerai/reddit-comments-search-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 '{
  "subreddit": "chatgpt",
  "author": "",
  "after": "",
  "before": "",
  "limit": 100,
  "sort": "desc",
  "link_id": "",
  "parent_id": "",
  "body": "token",
  "maxItems": 100
}' |
apify call powerai/reddit-comments-search-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

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