# 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
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, NaN 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/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 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("💾 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": "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": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=datara/reddit-search-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Reddit Search Scraper",
        "description": "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.",
        "version": "0.0",
        "x-build-id": "IDnB5nrezWTVz12S2"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/datara~reddit-search-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-datara-reddit-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/datara~reddit-search-scraper/runs": {
            "post": {
                "operationId": "runs-sync-datara-reddit-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/datara~reddit-search-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-datara-reddit-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",
                        "type": "string",
                        "description": "Keyword or phrase to search for across Reddit.",
                        "default": "best project management tool"
                    },
                    "subreddit": {
                        "title": "Subreddit (optional)",
                        "type": "string",
                        "description": "Restrict search to a specific subreddit (e.g. 'entrepreneur' — no r/ prefix, no URL). Leave blank to search all of Reddit.",
                        "default": ""
                    },
                    "sort": {
                        "title": "Sort Order",
                        "enum": [
                            "relevance",
                            "new",
                            "top",
                            "comment_count",
                            "hot"
                        ],
                        "type": "string",
                        "description": "How to sort the search results. Note: 'Hot' is only available when searching within a specific subreddit.",
                        "default": "relevance"
                    },
                    "timeframe": {
                        "title": "Timeframe",
                        "enum": [
                            "all",
                            "year",
                            "month",
                            "week",
                            "day",
                            "hour"
                        ],
                        "type": "string",
                        "description": "Filter results by time period.",
                        "default": "all"
                    },
                    "maxResults": {
                        "title": "Max Results",
                        "minimum": 1,
                        "maximum": 500,
                        "type": "integer",
                        "description": "Maximum number of posts to return (1–500). Each API page returns ~25 posts; the actor will paginate automatically.",
                        "default": 10
                    },
                    "includeBodyText": {
                        "title": "Include Post Body Text",
                        "type": "boolean",
                        "description": "Include the full post body text in output where available. Disable to reduce dataset size.",
                        "default": true
                    },
                    "minScore": {
                        "title": "Minimum Score (Upvotes)",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Only return posts with an upvote score at or above this value. Set to 0 to include all.",
                        "default": 0
                    },
                    "minComments": {
                        "title": "Minimum Comments",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Only return posts with at least this many comments. Set to 0 to include all.",
                        "default": 0
                    },
                    "minTitleRelevance": {
                        "title": "Minimum Title Relevance",
                        "minimum": 0,
                        "maximum": 10,
                        "type": "integer",
                        "description": "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).",
                        "default": 1
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
