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

Search public Reddit comments by keyword or subreddit. Export comment text, authors, scores, permalinks, post context, timestamps, and scrape metadata for monitoring, research, and analysis.

- **URL**: https://apify.com/maximedupre/reddit-comments-search-scraper.md
- **Developed by:** [Maxime Dupré](https://apify.com/maximedupre) (community)
- **Categories:** Social media
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

$2.65 / 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.

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

Reddit Comments Search Scraper searches public comments on [Reddit](https://www.reddit.com/) by keyword, phrase, brand, or topic. Use it to export comment text, authors, scores, permalinks, subreddit names, parent post context, timestamps, and scrape metadata into a clean Apify dataset.

This Actor is built for people who care about what Reddit users are saying inside comments, not just post titles. Start with the prefilled `openai` query and a small comment limit, review the output shape, then switch to your own search term, subreddit list, freshness window, and sort order.

### ✅ What this Reddit comments search scraper does

- Searches public Reddit comments for a keyword, phrase, brand, product, competitor, or research topic.
- Optionally scopes the search to one or more subreddits such as `ChatGPT` or `r/LocalLLaMA`.
- Saves one dataset item per accepted comment result as soon as it is collected.
- Supports Reddit search ordering by newest, relevance, or top results.
- Filters by comment age after reading the comment timestamp.
- Keeps the parent post title, post URL, subreddit URL, and Reddit permalinks attached to each comment.
- Runs without asking for Reddit cookies, login details, or a user-provided Reddit API key.
- Works with Apify exports, API access, schedules, webhooks, and integrations.

### 📊 Reddit comment data you can extract

Each output row represents one Reddit comment search result.

| Data | Example fields |
| --- | --- |
| Comment identity | `commentId`, `rawCommentId`, `commentUrl`, `parentId` |
| Comment content | `text`, `createdAt`, `authorName`, `score`, `contentType` |
| Subreddit context | `subredditName`, `subredditId`, `subredditUrl`, `isSubredditQuarantined` |
| Parent post context | `postId`, `rawPostId`, `postUrl`, `postTitle`, `postCreatedAt`, `postScore`, `postCommentCount` |
| Search traceability | `searchQuery`, `effectiveSearchQuery`, `matchedSubreddit`, `sort`, `sourceResultPosition`, `resultPosition`, `scrapedAt` |

Reddit may not expose every field for every result. Nullable fields such as post score, post comment count, subreddit ID, NSFW flag, spoiler flag, and quarantine flag are returned as `null` when Reddit does not provide them in the search result.

### 🎯 Common use cases

- Monitor Reddit comments for brand, product, founder, or competitor mentions.
- Build a Reddit sentiment analysis dataset from comment text and scores.
- Find pain points, feature requests, and user language inside relevant subreddits.
- Track discussion around launches, incidents, policies, communities, or trends.
- Export subreddit comment search results for market research, social listening, or reporting.
- Feed Reddit comment data into spreadsheets, BI tools, alerts, enrichment jobs, or LLM analysis.

### 🚀 How to search Reddit comments

1. Open the Input tab.
2. Enter a `Search query`, such as `openai`, `pricing`, or your brand name.
3. Optional: add `Subreddits` to search only inside specific communities. Use plain names like `ChatGPT` or Reddit-style names like `r/LocalLLaMA`.
4. Set `Maximum comments` to control the run size and cost. Keep `25` for a small first run.
5. Set `Freshness window (days)` to filter older comments, or use `0` to keep all available comments returned by Reddit.
6. Choose `Newest`, `Relevance`, or `Top`, then start the Actor and open the dataset.

### ✍️ Input example

```json
{
	"query": "openai",
	"subreddits": ["ChatGPT"],
	"maxComments": 25,
	"maxDaysOld": 30,
	"sort": "new",
	"safeSearch": false
}
````

### 🧾 Output example

```json
{
	"commentId": "abc123",
	"rawCommentId": "t1_abc123",
	"commentUrl": "https://www.reddit.com/r/ChatGPT/comments/post123/example_post/abc123/",
	"text": "This is the visible Reddit comment text.",
	"createdAt": "2026-05-31T12:34:56.000Z",
	"authorName": "example_user",
	"score": 12,
	"parentId": "t3_post123",
	"subredditName": "ChatGPT",
	"subredditId": "t5_2qh1i",
	"subredditUrl": "https://www.reddit.com/r/ChatGPT/",
	"postId": "post123",
	"rawPostId": "t3_post123",
	"postUrl": "https://www.reddit.com/r/ChatGPT/comments/post123/example_post/",
	"postTitle": "Example post title",
	"postCreatedAt": "2026-05-30T09:00:00.000Z",
	"postScore": null,
	"postCommentCount": null,
	"contentType": "text",
	"isPostNsfw": false,
	"isPostSpoiler": false,
	"isSubredditQuarantined": null,
	"searchQuery": "openai",
	"effectiveSearchQuery": "openai subreddit:ChatGPT",
	"matchedSubreddit": "ChatGPT",
	"sort": "new",
	"sourceResultPosition": 1,
	"resultPosition": 1,
	"scrapedAt": "2026-05-31T12:35:05.000Z"
}
```

### 💸 Pricing

This Actor uses pay-per-event pricing. You are charged `$0.00265` for each saved comment, which is `$2.65` per 1,000 saved comments.

To control cost, set `Maximum comments` to the number of rows you actually need. A first run with `25` comments is enough to verify the dataset shape before you scale up.

### ⚠️ Limits and caveats

- The Actor searches public Reddit comment search results. It does not scrape full comment threads from a post URL.
- It cannot access private, deleted, quarantined-behind-login, or otherwise unavailable Reddit content.
- It does not collect Reddit posts, media results, communities, or user profiles.
- It does not use your Reddit account, cookies, or user-provided Reddit API credentials.
- Reddit search availability and returned fields can vary by query, subreddit, sort order, and source-side conditions.
- `Safe search` asks Reddit to filter mature results where Reddit supports that setting, but Reddit controls the final search response.

### ❓ FAQ

#### 💬 Can I search comments in one subreddit only?

Yes. Add one subreddit in `Subreddits`, for example `ChatGPT` or `r/ChatGPT`. The Actor searches comments for your keyword inside that subreddit and saves rows that match the requested subreddit.

#### 🧵 Does this scrape a full Reddit thread?

No. This Actor is focused on Reddit comment search results. Use it when you know the keyword or topic you want to search. It does not take a Reddit post URL and crawl every comment in that thread.

#### 📅 What does `Freshness window (days)` do?

It filters accepted comments by their own Reddit timestamp. Use `30` for comments from the last 30 days, or `0` to keep all available comments returned by Reddit search.

#### 🔐 Do I need a Reddit account?

No. The Actor does not ask for Reddit login details, cookies, or a user-provided Reddit API key.

### 📝 Changelog

- 0.0: Initial release.

### 🆘 Support

For issues, questions, or feature requests, [file a ticket](https://console.apify.com/actors/maximedupre~reddit-comments-search-scraper/issues) and I'll fix or implement it in less than 24h 🫡

### 🔗 Other actors

- [Reddit Scraper ↗](https://apify.com/maximedupre/reddit-scraper) - Search Reddit posts and comments together for broader conversation tracking.
- [Twitter Scraper ↗](https://apify.com/maximedupre/twitter-scraper) - Export public X/Twitter posts and trending topics for social listening.
- [LinkedIn Posts Scraper ↗](https://apify.com/maximedupre/linkedin-posts-scraper) - Collect public LinkedIn posts, engagement, and visible comments from profile or company URLs.
- [TikTok Hashtag Search Scraper ↗](https://apify.com/maximedupre/tiktok-hashtag-search-scraper) - Find public TikTok hashtags and metrics from keyword searches.
- [Social Media Stats Checker ↗](https://apify.com/maximedupre/social-media-stats-checker) - Check public profile stats across Reddit, TikTok, X, Instagram, and more.

**Made with ❤️ by Maxime Dupré**

# Actor input Schema

## `query` (type: `string`):

🔎 Keyword, phrase, brand, product, competitor, or topic to find in public Reddit comments. Example: `openai`.

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

🎯 Optional subreddit names to search inside, such as ChatGPT or r/LocalLLaMA. Leave empty to search all Reddit comments.

## `maxComments` (type: `integer`):

🔢 Maximum number of matching comments to save. Keep `25` for a small first run, then increase it when the output looks right.

## `maxDaysOld` (type: `integer`):

📅 Keep only comments from the last N days. Set to 0 to keep all available comments.

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

↕️ Reddit search ordering to use before filtering and saving comments. Newest is useful for monitoring; Top is useful for high-engagement comments.

## `safeSearch` (type: `boolean`):

🛡️ Ask Reddit to filter mature search results when supported by the source.

## Actor input object example

```json
{
  "query": "openai",
  "maxComments": 25,
  "maxDaysOld": 30,
  "sort": "new",
  "safeSearch": false
}
```

# Actor output Schema

## `results` (type: `string`):

API URL for the Reddit comment search results dataset.

# 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 = {
    "query": "openai"
};

// Run the Actor and wait for it to finish
const run = await client.actor("maximedupre/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 = { "query": "openai" }

# Run the Actor and wait for it to finish
run = client.actor("maximedupre/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 '{
  "query": "openai"
}' |
apify call maximedupre/reddit-comments-search-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=maximedupre/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 public Reddit comments by keyword or subreddit. Export comment text, authors, scores, permalinks, post context, timestamps, and scrape metadata for monitoring, research, and analysis.",
        "version": "0.0",
        "x-build-id": "7nQJE5wfULZumdqL3"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/maximedupre~reddit-comments-search-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-maximedupre-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/maximedupre~reddit-comments-search-scraper/runs": {
            "post": {
                "operationId": "runs-sync-maximedupre-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/maximedupre~reddit-comments-search-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-maximedupre-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",
                "required": [
                    "query"
                ],
                "properties": {
                    "query": {
                        "title": "Search query",
                        "minLength": 1,
                        "type": "string",
                        "description": "🔎 Keyword, phrase, brand, product, competitor, or topic to find in public Reddit comments. Example: `openai`."
                    },
                    "subreddits": {
                        "title": "Subreddits",
                        "uniqueItems": true,
                        "type": "array",
                        "description": "🎯 Optional subreddit names to search inside, such as ChatGPT or r/LocalLLaMA. Leave empty to search all Reddit comments.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "maxComments": {
                        "title": "Maximum comments",
                        "minimum": 1,
                        "type": "integer",
                        "description": "🔢 Maximum number of matching comments to save. Keep `25` for a small first run, then increase it when the output looks right.",
                        "default": 25
                    },
                    "maxDaysOld": {
                        "title": "Freshness window (days)",
                        "minimum": 0,
                        "type": "integer",
                        "description": "📅 Keep only comments from the last N days. Set to 0 to keep all available comments.",
                        "default": 30
                    },
                    "sort": {
                        "title": "Sort",
                        "enum": [
                            "new",
                            "relevance",
                            "top"
                        ],
                        "type": "string",
                        "description": "↕️ Reddit search ordering to use before filtering and saving comments. Newest is useful for monitoring; Top is useful for high-engagement comments.",
                        "default": "new"
                    },
                    "safeSearch": {
                        "title": "Safe search",
                        "type": "boolean",
                        "description": "🛡️ Ask Reddit to filter mature search results when supported by the source.",
                        "default": 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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
