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

Search Reddit by keyword or subreddit and extract posts with engagement data. Ideal for brand monitoring, lead generation, and market research. Supports timeframe filters, sort options, and cursor-based pagination.

- **URL**: https://apify.com/datara/reddit-search-scraper.md
- **Developed by:** [Datara](https://apify.com/datara) (community)
- **Categories:** Lead generation, Social media, SEO tools
- **Features:** Limited permissions
- **Stats:** 22 total users, 4 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.00 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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 Reddit for any keyword or phrase and extract matching posts with full engagement data — upvotes, comment counts, post body, author, subreddit, and more.

Built for **brand monitoring**, **lead generation**, **competitor analysis**, and **market research**. No browser, no proxies, near-zero failure rate.

***

### What This Actor Does

Enter a search query (and optionally a target subreddit) and this actor returns a clean dataset of Reddit posts matching your search. Results include post metadata, engagement metrics, and body text — ready to feed into spreadsheets, CRMs, or downstream automations.

**Use cases:**

- Monitor Reddit for mentions of your brand, product, or competitors
- Find communities discussing problems your product solves (for lead generation)
- Research sentiment and language around a topic before launching a campaign
- Track trending discussions in a niche subreddit
- Identify high-engagement posts for content inspiration

***

### Inputs

| Field | Required | Description |
|---|---|---|
| **Search Query** | ✅ Yes | Keyword or phrase to search (e.g. `"notion alternative"`, `"best CRM for startups"`) |
| **Subreddit** | No | Restrict to one subreddit (e.g. `entrepreneur`). Leave blank to search all of Reddit. |
| **Sort Order** | No | `relevance` (default), `new`, `top`, `comment_count`. Use `hot` only with a subreddit. |
| **Timeframe** | No | `all` (default), `year`, `month`, `week`, `day`, `hour` |
| **Max Results** | No | How many posts to return, up to 500. Default: 10. |
| **Include Body Text** | No | Include the full post text where available. Default: true. |
| **Minimum Score** | No | Filter out posts below this upvote score. Default: 0 (no filter). |
| **Minimum Comments** | No | Filter out posts with fewer than this many comments. Default: 0 (no filter). |

> **Subreddit name format:** Use bare name only — `entrepreneur`, not `r/entrepreneur` or a full URL. The actor strips any `r/` prefix automatically.

***

### Example Inputs

**Global search across all of Reddit:**

```json
{
  "query": "best CRM for small business",
  "sort": "top",
  "timeframe": "year",
  "maxResults": 50,
  "minScore": 10,
  "minComments": 5
}
```

**Scoped to a specific subreddit:**

```json
{
  "query": "Notion vs Obsidian",
  "subreddit": "productivity",
  "sort": "hot",
  "timeframe": "month",
  "maxResults": 25,
  "includeBodyText": false
}
```

***

### Example Output

**Global search** — fields from `/v1/reddit/search`:

```json
[
  {
    "id": "w63dgy",
    "title": "Player realizes that he nearly stole the dogs job",
    "author": "Morgentau7",
    "subreddit": "MadeMeSmile",
    "url": "https://www.reddit.com/r/MadeMeSmile/comments/w63dgy/player_realizes_that_he_nearly_stole_the_dogs_job/",
    "score": 220403,
    "upvoteRatio": 0.97,
    "numComments": 1246,
    "createdAt": "2022-07-23T14:35:00.000Z",
    "isVideoPost": true,
    "permalink": "/r/MadeMeSmile/comments/w63dgy/",
    "subredditSubscribers": 11605207,
    "bodyText": null,
    "searchQuery": "dogs at work",
    "searchSubreddit": null,
    "scrapedAt": "2026-04-04T08:45:00.000Z"
  }
]
```

**Subreddit search** — fields from `/v1/reddit/subreddit/search`:

```json
[
  {
    "id": "t3_8gmjrb",
    "title": "Is doing 50-100 pushups a day doing anything?",
    "author": null,
    "subreddit": "Fitness",
    "url": "https://www.reddit.com/r/Fitness/comments/8gmjrb/is_doing_50100_pushups_a_day_doing_anything/",
    "score": 1414,
    "upvoteRatio": null,
    "numComments": 582,
    "createdAt": "2018-05-03T01:09:17.620Z",
    "isNsfw": false,
    "isSpoiler": false,
    "isCrosspost": false,
    "thumbnail": null,
    "permalink": "/r/Fitness/comments/8gmjrb/is_doing_50100_pushups_a_day_doing_anything/",
    "bodyText": null,
    "searchQuery": "pushups",
    "searchSubreddit": "Fitness",
    "scrapedAt": "2026-04-04T08:45:01.000Z"
  }
]
```

> **Note:** Global and subreddit searches return slightly different fields because they use different API endpoints. `upvoteRatio` is only available from global search; `isNsfw`, `isSpoiler`, and `isCrosspost` are only available from subreddit search.

***

### Quality Filters

Use `minScore` and `minComments` to cut through low-quality posts and focus on discussions that have actually resonated with the Reddit community.

- `minScore: 50` — only posts that got real upvotes
- `minComments: 10` — only posts that sparked conversation

These filters run client-side after retrieval, so they don't affect the number of API calls made.

***

### Pricing

This actor uses a **pay-per-event (PPE)** model at **$0.50 per 100 results** returned. You only pay for results that make it into your dataset after all filters are applied.

***

### Store Description (150 words)

Search Reddit for any keyword and extract posts with full engagement data — upvotes, comments, body text, author, subreddit, and more. Built for brand monitoring, lead generation, competitor analysis, and market research.

Enter a query, choose your sort order, and optionally scope results to a single subreddit. Use the minimum score and comment filters to surface only high-quality, high-engagement discussions. Get back a clean, structured dataset ready for spreadsheets, CRMs, or automation pipelines.

No proxies needed, no browser overhead, near-zero failure rate. Results include post ID, title, author, URL, upvote ratio, comment count, creation date, body text, and flair — all in a consistent JSON schema.

Ideal for SaaS founders researching pain points, marketers tracking brand mentions, agencies monitoring competitors, and researchers mapping Reddit discourse at scale.

**Category tags:** `social-media` · `reddit` · `lead-generation` · `market-research`

***

### Setup Instructions for Apify Console

#### 1. Create the Actor

- Go to **Actors → Develop → Create new**
- Select **Empty Node.js template**
- Name it `reddit-search-scraper`

#### 2. Enter the Files

Use the code editor sidebar to create/overwrite these files:

| File | Where in editor |
|---|---|
| `src/main.js` | `src/` folder |
| `package.json` | root |
| `.actor/actor.json` | `.actor/` folder |
| `.actor/input_schema.json` | `.actor/` folder |

#### 3. Set the Environment Variable

- Go to **Actor settings → Environment variables**
- Add: `SCRAPECREATORS_API_KEY` = `<your key>`
- Mark it as **Secret**

This keeps the API key out of source code and invisible to users.

#### 4. Memory & Runtime

- Minimum memory: **128 MB** (sufficient)
- Runtime: **Node.js 18**
- No special build commands needed

#### 5. Test Run

Paste this input and verify the dataset has records:

```json
{
  "query": "best project management tool",
  "sort": "relevance",
  "maxResults": 10
}
```

#### 6. Publish to Store

- Pricing: **PPE — $0.50 per 100 results**
- Description: use the 150-word block above
- Tags: `social-media`, `reddit`, `lead-generation`, `market-research`
- Set visibility to **Public**

# Actor input Schema

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

Keyword or phrase to search for across Reddit.

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

Restrict search to a specific subreddit (e.g. 'entrepreneur' — no r/ prefix, no URL). Leave blank to search all of Reddit.

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

How to sort the search results. Note: 'Hot' is only available when searching within a specific subreddit.

## `timeframe` (type: `string`):

Filter results by time period.

## `maxResults` (type: `integer`):

Maximum number of posts to return (1–500). Each API page returns ~25 posts; the actor will paginate automatically.

## `includeBodyText` (type: `boolean`):

Include the full post body text in output where available. Disable to reduce dataset size.

## `minScore` (type: `integer`):

Only return posts with an upvote score at or above this value. Set to 0 to include all.

## `minComments` (type: `integer`):

Only return posts with at least this many comments. Set to 0 to include all.

## `minTitleRelevance` (type: `integer`):

Only return posts where at least this many query words appear in the title. Set to 0 to disable and return all results. Default: 1 (at least one query word must appear in the title).

## Actor input object example

```json
{
  "query": "best project management tool",
  "subreddit": "",
  "sort": "relevance",
  "timeframe": "all",
  "maxResults": 10,
  "includeBodyText": true,
  "minScore": 0,
  "minComments": 0,
  "minTitleRelevance": 1
}
```

# Actor output Schema

## `posts` (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 = {
    "query": "best project management tool",
    "subreddit": "",
    "sort": "relevance",
    "timeframe": "all",
    "maxResults": 10,
    "includeBodyText": true,
    "minScore": 0,
    "minComments": 0,
    "minTitleRelevance": 1
};

// Run the Actor and wait for it to finish
const run = await client.actor("datara/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 = {
    "query": "best project management tool",
    "subreddit": "",
    "sort": "relevance",
    "timeframe": "all",
    "maxResults": 10,
    "includeBodyText": True,
    "minScore": 0,
    "minComments": 0,
    "minTitleRelevance": 1,
}

# Run the Actor and wait for it to finish
run = client.actor("datara/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 '{
  "query": "best project management tool",
  "subreddit": "",
  "sort": "relevance",
  "timeframe": "all",
  "maxResults": 10,
  "includeBodyText": true,
  "minScore": 0,
  "minComments": 0,
  "minTitleRelevance": 1
}' |
apify call datara/reddit-search-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,datara/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/TjBf9oHTaIDOjCaxh/builds/IDnB5nrezWTVz12S2/openapi.json
