# 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:** 2 total users, 1 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 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 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

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Reddit Comments Search Scraper",
        "description": "Search archived Reddit comments by subreddit, author, post, or parent comment. Filter by body text, time range, and sort order with automatic pagination. 💬",
        "version": "0.0",
        "x-build-id": "OuMCd1gv2joKyKU6A"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/powerai~reddit-comments-search-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-powerai-reddit-comments-search-scraper",
                "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/powerai~reddit-comments-search-scraper/runs": {
            "post": {
                "operationId": "runs-sync-powerai-reddit-comments-search-scraper",
                "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/powerai~reddit-comments-search-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-powerai-reddit-comments-search-scraper",
                "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",
                "properties": {
                    "subreddit": {
                        "title": "Subreddit",
                        "type": "string",
                        "description": "Subreddit name without r/, e.g. chatgpt",
                        "default": "chatgpt"
                    },
                    "author": {
                        "title": "Author",
                        "type": "string",
                        "description": "Filter by Reddit username",
                        "default": ""
                    },
                    "after": {
                        "title": "After (UTC)",
                        "type": "string",
                        "description": "Only include comments created after this time (Unix timestamp or date)",
                        "default": ""
                    },
                    "before": {
                        "title": "Before (UTC)",
                        "type": "string",
                        "description": "Only include comments created before this time (Unix timestamp or ISO date). Pagination uses the last item created value automatically",
                        "default": ""
                    },
                    "limit": {
                        "title": "Limit",
                        "minimum": 1,
                        "maximum": 100,
                        "type": "integer",
                        "description": "Number of comments per API request (1-100)",
                        "default": 100
                    },
                    "sort": {
                        "title": "Date Sort",
                        "enum": [
                            "desc",
                            "asc"
                        ],
                        "type": "string",
                        "description": "Sort order by created time",
                        "default": "desc"
                    },
                    "link_id": {
                        "title": "Link ID",
                        "type": "string",
                        "description": "Filter comments by post link ID, e.g. t3_1ubt2cm",
                        "default": ""
                    },
                    "parent_id": {
                        "title": "Parent Comment ID",
                        "type": "string",
                        "description": "Filter replies under a parent comment ID, e.g. t1_abc123",
                        "default": ""
                    },
                    "body": {
                        "title": "Body",
                        "type": "string",
                        "description": "Search comment body text. Requires at least one of: subreddit, author, link_id, or parent_id",
                        "default": "token"
                    },
                    "maxItems": {
                        "title": "Maximum Results",
                        "minimum": 1,
                        "maximum": 50000,
                        "type": "integer",
                        "description": "Maximum total number of comments to scrape",
                        "default": 100
                    },
                    "proxyConfiguration": {
                        "title": "Proxy Configuration",
                        "type": "object",
                        "description": "Proxy settings for the actor",
                        "default": {
                            "useApifyProxy": false
                        }
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
