# Reddit Search Scraper (`scrapingdino/reddit-search-scraper`) Actor

Search Reddit for posts, subreddits, or users by keyword — with sort, time range, and optional comment pulls. Structured results for monitoring and research. $0.50 per 1,000 rows.

- **URL**: https://apify.com/scrapingdino/reddit-search-scraper.md
- **Developed by:** [Scraping Dino](https://apify.com/scrapingdino) (community)
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.50 / 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.
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 Search Scraper - Search Posts, Subreddits & Users

### Overview

The **Reddit Search Scraper** runs Reddit keyword search across **posts**, **subreddits**, or **users** and returns structured JSON results. Add one or many queries, choose sort and time range for post search, and optionally pull comments for each matching post.

Built for social listening teams, researchers, SEOs, and product marketers who need repeatable Reddit search exports. Use it to discover conversations, communities, and accounts matching brand, competitor, or topic keywords — without manual scrolling.

Outputs **clean, structured JSON** with listing summaries plus optional nested comment rows when `includeComments` is enabled.

### Features

- Multi-query batch search in one run
- Search types: `posts`, `subreddits`, `users`
- Post sort: `relevance`, `hot`, `top`, `new`, `comments`
- Time range filter for Top sort: hour → all
- Optional comment fetch per matching post with per-post comment caps
- Configurable result limits
- Type-tagged rows for posts, communities, users, comments, and errors
- Reliable pagination-backed collection

### Use Cases

- **Brand monitoring** — Search brand and product names daily
- **Competitor analysis** — Track competitor mentions and sentiment threads
- **Market research** — Discover how buyers talk about a category
- **Lead generation** — Find posts asking for recommendations you can answer
- **Content research** — Source topics and FAQs for content calendars
- **Trend monitoring** — Compare query volumes and engagement over time
- **Recruitment** — Search for hiring or “looking for work” discussions
- **AI training datasets** — Build topic-scoped Reddit corpora
- **Academic research** — Export search hits for coding and analysis

### Input

| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| `queries` | array of strings | **Yes** | — | Search keywords (one or more). |
| `searchType` | string | No | `"posts"` | `posts`, `subreddits`, or `users`. |
| `sort` | string | No | `"relevance"` | Post result order: `relevance`, `hot`, `top`, `new`, `comments`. |
| `timeRange` | string | No | `"all"` | Time window when sort is `top`: `hour`, `day`, `week`, `month`, `year`, `all`. |
| `maxResults` | string | No | `"50"` | Max results per query (numeric string). |
| `includeComments` | boolean | No | `false` | Fetch comments for each post result (extra API calls). |
| `maxCommentsPerPost` | string | No | `"20"` | Max comments per post when comments are enabled. |

**How parameters affect the run:** `searchType` switches the endpoint family. `sort` / `timeRange` reshape post rankings. Enabling `includeComments` multiplies API usage by roughly one call per post.

#### Example input

```json
{
  "queries": ["chatgpt alternatives", "notion vs obsidian"],
  "searchType": "posts",
  "sort": "top",
  "timeRange": "month",
  "maxResults": "40",
  "includeComments": true,
  "maxCommentsPerPost": "10"
}
```

### Output

Rows vary by `searchType`. Shared listing fields:

| Field | Type | Description |
|---|---|---|
| `type` | string | e.g. `post`, `subreddit`, `user`, `comment`, `error` |
| `query` | string | Query that produced the row |
| `id` | string | null | Entity ID |
| `name` | string | null | Fullname |
| `kind` | string | null | Reddit kind |
| `title` | string | null | Title / display title |
| `author` | string | null | Author when applicable |
| `subreddit` | string | null | Subreddit when applicable |
| `score` | number | null | Score |
| `numComments` | number | null | Comment count for posts |
| `createdUtc` | number | string | null | Created time |
| `permalink` | string | null | Permalink |
| `url` | string | null | URL |
| `body` | string | null | Text / description excerpt |

Comment rows (when enabled) include parent post context fields from the same summary mapper. Error rows include `error` and optional `page`.

### Example Output

```json
{
  "type": "post",
  "query": "chatgpt alternatives",
  "id": "1jk4567",
  "name": "t3_1jk4567",
  "kind": "t3",
  "title": "What are the best ChatGPT alternatives in 2026?",
  "author": "saas_builder",
  "subreddit": "artificial",
  "score": 2104,
  "numComments": 387,
  "createdUtc": 1717000000,
  "permalink": "https://www.reddit.com/r/artificial/comments/1jk4567/what_are_the_best_chatgpt_alternatives_in_2026/",
  "url": "https://www.reddit.com/r/artificial/comments/1jk4567/what_are_the_best_chatgpt_alternatives_in_2026/",
  "body": "Looking for tools that are better for coding and long-context research..."
}
```

### Related Scrapers

- **Reddit Post Scraper** — Full details for URLs found via search
- **Reddit Comment Tree Scraper** — Deep comment trees for top hits
- **Reddit Popular Posts Scraper** — Platform-wide trending without keywords
- **Reddit Subreddit Posts Scraper** — Ongoing monitoring inside known communities

# Actor input Schema

## `queries` (type: `array`):

Enter one or more search keywords (e.g. python, chatgpt, cursor)

## `searchType` (type: `string`):

Search posts, subreddits, or users. Defaults to posts.

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

How to order post search results.

## `timeRange` (type: `string`):

Limit results to a time period. Only used when Sort is Top.

## `maxResults` (type: `string`):

Maximum number of posts to return.

## `includeComments` (type: `boolean`):

Fetch comments for each post found. Adds one API call per post.

## `maxCommentsPerPost` (type: `string`):

Maximum comments to fetch for each post. Only used when Include Comments is enabled.

## Actor input object example

```json
{
  "queries": [
    "python",
    "chatgpt"
  ],
  "searchType": "posts",
  "sort": "relevance",
  "timeRange": "all",
  "maxResults": "50",
  "includeComments": false,
  "maxCommentsPerPost": "20"
}
```

# Actor output Schema

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

Posts, subreddits, or users matching your search keywords.

## `comments` (type: `string`):

Comments for each post when Include Comments is enabled. Empty when comments were not requested.

## `all` (type: `string`):

Combined dataset with every record from Search Results and Comments. Use this for a single export of all rows.

# 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 = {
    "queries": [
        "python",
        "chatgpt"
    ],
    "searchType": "posts",
    "sort": "relevance",
    "timeRange": "all",
    "maxResults": "50",
    "includeComments": false,
    "maxCommentsPerPost": "20"
};

// Run the Actor and wait for it to finish
const run = await client.actor("scrapingdino/reddit-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 = {
    "queries": [
        "python",
        "chatgpt",
    ],
    "searchType": "posts",
    "sort": "relevance",
    "timeRange": "all",
    "maxResults": "50",
    "includeComments": False,
    "maxCommentsPerPost": "20",
}

# Run the Actor and wait for it to finish
run = client.actor("scrapingdino/reddit-search-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 '{
  "queries": [
    "python",
    "chatgpt"
  ],
  "searchType": "posts",
  "sort": "relevance",
  "timeRange": "all",
  "maxResults": "50",
  "includeComments": false,
  "maxCommentsPerPost": "20"
}' |
apify call scrapingdino/reddit-search-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,scrapingdino/reddit-search-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/1Lrj0KrcW9SgV0CMY/builds/ZWO4H5DjsnCfWWqTz/openapi.json
