# Reddit Search Scraper & API: Posts & Comments by Keyword (`quarra/reddit-search-scraper`) Actor

Scrape Reddit search results by keyword, site-wide or inside one subreddit: title, text, score, comments count, author, flair, date, and the full comment tree if you want it. Strict word matching, date filters, new results only on a schedule.

- **URL**: https://apify.com/quarra/reddit-search-scraper.md
- **Developed by:** [Quarra Labs](https://apify.com/quarra) (community)
- **Categories:** Social media, AI, Lead generation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.20 / 1,000 posts

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: Posts & Comments by Keyword

Type keywords and get the Reddit posts (or comments) that match them, site-wide or inside one subreddit: title, text,
score, upvote ratio, comments count, author, flair, media and date, and the post's comment tree if you want it. No
login, no cookies, no API key. Export as JSON, CSV or Excel, or read it through the Apify API.

- **Search that contains your words**: Reddit's search returns loosely related posts (for "home assistant", 17 of the
  top 100 contain it). Turn on strict search and only posts with all the words of your query, as whole words, are
  kept; the others are not charged.
- **Comment search**: comments that contain your keywords, anywhere on Reddit or in one subreddit, each with its post's
  title and URL.
- **Comment trees on demand**: each post found can come with its comments, each with `parentId` and `depth`.
- **Only new results on a schedule**: turn on **Only new since the last run** and each run returns and charges only
  what earlier runs did not return.

**$2.50 per 1,000 posts, $2.50 per 1,000 comments**, less on paid plans, plus $0.005 per run. Searches that fail,
duplicates and posts removed by your filters are not charged.

Optional **AI analysis** of each post and comment (sentiment, intent, entities, summary, pain point, business
signals, your own labels): **$0.50 per 1,000** analyzed records.

### Quick start

1. Type keywords into **Search queries** (posts) or **Comment search** (comments), one search per line. Quotes keep a
   phrase together: `"home assistant"`.
2. Optionally name a subreddit in **Search only inside this subreddit**, choose a sort and a time range.
3. Click **Start** and read the results in the run's **Output** tab.

Through the API:

```json
{
  "searchQueries": ["home assistant dashboard"],
  "searchSubreddit": "homeassistant",
  "strictSearch": true,
  "searchSort": "top",
  "timeFilter": "month",
  "maxPostsPerSource": 100
}
```

Comments that name a product, each week, only the new ones:

```json
{ "commentSearchQueries": ["\"apify\""], "searchSort": "new", "onlyNew": true, "watchName": "apify-mentions" }
```

Like any Apify Actor, it can be scheduled, connected to webhooks, Make, Zapier, n8n, or called by AI agents through
Apify's MCP server.

### Output

One record per post (or comment). A real search result (October 11, 2026, author replaced, some fields left out):

```json
{
  "type": "post",
  "id": "1wpy5q6",
  "url": "https://www.reddit.com/r/homeassistant/comments/1wpy5q6/claude_and_home_assistant/",
  "subreddit": "homeassistant",
  "title": "Claude and Home Assistant",
  "body": "When I bought my house about 3 years ago one of the first things I did was start down the home automation path. …",
  "author": "example_user",
  "createdAt": "2026-09-25T14:42:18Z",
  "score": 157,
  "upvoteRatio": 0.74,
  "numComments": 283,
  "flair": "💬 Discussion",
  "mediaType": "text",
  "source": "search: home assistant",
  "scrapedAt": "2026-10-11T18:53:41Z"
}
```

| Field | What it holds |
|---|---|
| `title`, `body`, `flair` | the post as written, and its flair |
| `score`, `upvoteRatio`, `numComments` | the counters Reddit shows |
| `scorePerHour`, `commentsPerHour` | how fast the post grew since it went up |
| `mediaType`, `imageUrls`, `videoUrl`, `link` | text, image, gallery, video or link, and the media links |
| `source` | the search that found the post |

A comment record has `body`, `score`, `createdAt`, `postId`, `postTitle`, `parentId` and `depth`. Field names stay the
same between runs: a value Reddit does not provide is `null`, not missing. The run summary is the `OUTPUT` record of
the run's key-value store.

### AI analysis (optional)

Turn on **AI analysis** and every post and comment gets an `aiAnalysis` object next to its own fields:
**$0.50 per 1,000 analyzed records, every field and signal included**. A real result (post "Best and inexpensive CRM
for small businesses" in r/CRM, analyzed October 14, 2026, with two labels of our own; some entities left out):

```json
"aiAnalysis": {
  "language": "en",
  "sentiment": "mixed",
  "sentimentScore": -0.2,
  "emotion": "anticipation",
  "intent": "seeking_recommendation",
  "category": "software",
  "topics": ["crm alternatives", "hubspot pricing", "small business software"],
  "entities": [{"name": "HubSpot", "type": "brand"}, {"name": "Zoho", "type": "brand"}, {"name": "Pipedrive", "type": "brand"}],
  "summary": "A user seeks a cheaper CRM alternative to HubSpot that retains key features like lead tracking and reporting for their small businesses.",
  "painPoint": "HubSpot is becoming too expensive",
  "wantsHelp": true,
  "buyingSignal": true,
  "mentionsPrice": true,
  "featureRequest": false,
  "isVendor": false,
  "relevance": 1.0,
  "labels": {"switching": true, "budget": true}
}
```

| Field | What it holds |
|---|---|
| `sentiment`, `sentimentScore` | positive, negative, neutral or mixed, and a score from -1 to 1 |
| `emotion` | the main emotion (joy, frustration, anger, curiosity, confusion, none…) |
| `intent` | what the author wants: question, seeking_recommendation, complaint, praise, purchase_intent, comparison, announcement, self_promotion, discussion, humor |
| `category`, `topics`, `entities` | a category, up to 3 topics, and the brands, products, companies, people and places named |
| `summary`, `painPoint` | one English sentence, and the problem or frustration the author expresses (or null) |
| `wantsHelp`, `buyingSignal`, `mentionsPrice`, `featureRequest`, `isVendor` | business signals, true or false: asks for help, ready to buy or pay, names a price or budget, asks for a feature, sells or builds what they talk about |
| `relevance` | how much the record is really about your search, 0 to 1 |
| `labels` | your own yes/no labels |

**Your own labels**: up to 5, as `{"label_name": "what makes it true"}`, for example
`{"switching": "The author wants to switch from one product to another"}`. Included in the price.

- Charged once per record analyzed in full. Deleted, removed, bot (AutoModerator) and empty records are not analyzed
  and not charged. If an analysis fails, the record is still delivered (and charged as usual), its
  `aiAnalysisStatus` is `failed` with the reason in `aiAnalysisError`, and the analysis is not charged.
- Any language in, summaries in English. The first ~2,500 characters of a very long text are analyzed.
- Works with the one-record-per-item output format (not the Markdown thread format).
- It adds time: about a minute and a half per 100 records.

### Inputs

- **Search queries**: keywords as typed in Reddit's search box. **Comment search**: keywords to find in comments.
- **Search only inside this subreddit**: one subreddit, or empty for all of Reddit.
- **Strict search (exact words only)**, and where the words must appear (title or text, or title only).
- **Max results per search** (Reddit lists about 250 per search) and **Max results in total**.
- **Search sort** (relevance, hot, top, new, most comments) and **Time range**.
- **Filters**: dates, NSFW, excluded keywords, post types, flairs. Removed posts are not charged.
- **Comments**: include the comments of each post found, how many, how deep, in which order.
- **AI analysis** and **Your own labels**: the optional analysis described above.
- **Output format**: one record per item, or each thread as one Markdown record for LLMs.
- **Only new since the last run** and **Watch name**, for scheduled runs.

### Pricing

Pay per event:

| Apify plan | Posts | Comments |
|---|---|---|
| Free | $2.50 / 1,000 | $2.50 / 1,000 |
| Starter | $2.40 / 1,000 | $2.40 / 1,000 |
| Scale | $2.30 / 1,000 | $2.30 / 1,000 |
| Business and above | $2.20 / 1,000 | $2.20 / 1,000 |

AI analysis (optional): $0.50 / 1,000 analyzed records on every plan.

Plus the start: $0.005 per GB of run memory. Not charged: searches that fail, error records, duplicates, posts
removed by a filter or by strict search, results already returned to a watch. Set **Maximum cost per run** in the run
options and the run stops before going over it.

### Limits

- Reddit lists about 250 posts per search. **Go beyond Reddit's listing cap** combines sorts and time ranges to get
  more; use the date filters for a precise window.
- Strict search checks words, not relevance; quotes around a phrase fix most false matches.
- Quarantined communities are visible to logged-in accounts only. The Actor reports them and does not log in.

### FAQ

**Do I need a Reddit account or API key?** No account, no cookies, no API key. Platform costs are included in the
price.

**Why did my run return nothing?** The status message, the free `error` records and the `OUTPUT` record give the
reason for each search: no result, nothing in your date window, nothing matching strict search. Such a run costs only
the start.

**Is it legal?** It collects public posts and comments any logged-out visitor can see. Reddit's terms and privacy law
(GDPR in the EU) apply to how you use the data.

**Does the Actor send anything to Quarra?** Only when a run fails or runs out of time: the Actor, its build, the error type, the line of our code where it happened, and the memory and time the run was given, so we can fix it fast. Never your input, your results, your account or the run ID.

### Related tools from Quarra

- [Reddit Scraper](https://apify.com/quarra/reddit-scraper): subreddits, searches, post URLs and users in one Actor.
- [Reddit Comments Scraper](https://apify.com/quarra/reddit-comments-scraper): all the comments of posts from their
  links.
- [Reddit Subreddit Scraper](https://apify.com/quarra/reddit-subreddit-scraper): the posts of any subreddit.

# Actor input Schema

## `searchQueries` (type: `array`):

Keywords searched on Reddit, one query per line, as typed in Reddit's search box. Quotes keep a phrase together ("home assistant"); Strict search below enforces every word.

## `commentSearchQueries` (type: `array`):

Find COMMENTS containing your keywords, anywhere on Reddit (or in the subreddit above), one query per line: each comment with its text, score, date, parentId and its post's title and URL. Strict search and excluded keywords apply to the comment's text. Reddit's comment search ignores dates except with Search sort New: use New with a time range or date window to monitor.

## `searchSubreddit` (type: `string`):

Optional. Restrict every search query and comment search to one subreddit (selfhosted, r/selfhosted or its URL).

## `strictSearch` (type: `boolean`):

Reddit's search returns loosely related posts (for home assistant, 17 of the top 100 contain it). When on, a post is kept only if its title or text contains EVERY word of the query, as whole words (ai never matches said; case and accents ignored). "Quotes" require a phrase, -word excludes, OR and parentheses group alternatives. Other sorts of the same time range are read to reach your limit. Rejected posts are never charged (counted in OUTPUT as filteredOut).

## `strictMatchIn` (type: `string`):

Where the words of a strict search and the excluded keywords must (or must not) appear.

## `maxPostsPerSource` (type: `integer`):

Posts per subreddit or search query, comments per comment search, posts and comments per user history. Reddit lists ~1,000 posts per subreddit sort and ~250 per search; enable 'Go beyond Reddit's listing cap' for more. With 'Only new', this is the window watched.

## `maxItems` (type: `integer`):

Optional hard cap for the whole run, counted in charged results (posts + comments + profiles). Respected exactly. Empty = no global cap.

## `searchSort` (type: `string`):

How search results are ordered. Comment searches use Relevance, Top or New (Hot and Most comments fall back to Relevance).

## `timeFilter` (type: `string`):

Used by the Top and Controversial subreddit sorts and by searches (comment search: with the New sort only).

## `postedAfter` (type: `string`):

Only items created after this date (2026-09-01, or relative: 7 days). Applies to posts, user history and listing URLs.

## `postedBefore` (type: `string`):

Only items created before this date.

## `includeNsfw` (type: `boolean`):

Include posts marked NSFW (18+). Off by default.

## `excludeKeywords` (type: `array`):

Drop every post whose title or text contains one of these words or phrases, one per line (whole words, case and accents ignored; a comma belongs to the phrase, as in 10,000 views). Dropped items are not charged. Comment trees are not filtered; comments found by comment search are.

## `postTypes` (type: `array`):

Keep only these post types (mediaType). Empty = all types. Dropped posts are not charged.

## `flairs` (type: `array`):

Keep only posts with one of these flairs, written as on Reddit (Question, Help; case and accents ignored). Empty = all flairs. Dropped posts are not charged. In a search, the flair:"…" operator lets Reddit filter first.

## `deepScrape` (type: `boolean`):

When you need more posts than Reddit lists (~1,000 per subreddit sort, ~250 per search), combine extra sorts and time ranges and keep unique posts only. Posts outside the chosen sort may be added: use the date filters for a precise window.

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

For every post found in subreddits, searches, user histories and listing URLs, also scrape its complete comment tree (each comment has parentId and depth). Post URLs always include their comments.

## `maxCommentsPerPost` (type: `integer`):

Empty = the complete thread, even with tens of thousands of comments. 0 returns the post only. With Only new, each run returns up to this many comments of a thread that earlier runs did not return.

## `maxCommentDepth` (type: `integer`):

Empty = all levels. 0 = top-level comments only, 1 = plus direct replies, and so on. Deeper branches are not even requested (faster).

## `commentSort` (type: `string`):

Order of comments inside each thread (Best is Reddit's default).

## `aiAnalysis` (type: `boolean`):

Adds aiAnalysis to every post and comment: language, sentiment and score (-1 to 1), emotion, intent (question, recommendation request, complaint, praise, purchase intent, comparison…), category, topics, named brands, products and people, a one-sentence English summary, the pain point, and business signals (wants help, buying signal, mentions a price, feature request, vendor). Search results also get a relevance score (0 to 1) against your query. Charged once per post or comment analyzed in full; deleted, removed, bot or empty records and failed analyses are free. Works with the items output format.

## `aiLabels` (type: `object`):

Up to 5 yes/no labels of your own, as {"label_name": "what makes it true"}. Each analyzed record gets labels: {label_name: true or false}. Example: {"switching": "The author wants to switch from one product to another", "budget": "The author states a budget"}. Included in the analysis price.

## `outputFormat` (type: `string`):

Thread Markdown: one record per post with its whole comment tree as indented Markdown (author, score, date, text), about 7 times fewer characters than the same thread as JSON. A thread too big for one record (over ~20,000 comments) comes as numbered parts. Same price: 1 post + 1 comment per comment included. Profiles stay normal records.

## `onlyNew` (type: `boolean`):

Remember what earlier runs of the same watch returned and output only new posts and new comments (with Include comments, also comments that earlier runs did not return under posts already seen; with Max comments per post, each run adds up to that many of them per thread, oldest included). Nothing already delivered is charged again, even after a run that timed out, was aborted or overlapped another. One run per watch at a time: a second one does nothing and charges nothing. Memory: key-value store quarra-reddit-watch-\<this Actor's ID, lowercase> of your account (a watch already kept in quarra-reddit-watch stays there). Set a watch name, then schedule the Actor.

## `watchName` (type: `string`):

Name of this watch's memory for 'Only new'. Recommended: runs with the same name share it even when you add or remove sources. Empty: the memory belongs to this exact set of inputs and filters, so adding a source starts a new watch that returns everything again (limits, output format and proxy don't count).

## `proxyConfiguration` (type: `object`):

Connection. Keep the default (automatic). Costs are included in the price.

## Actor input object example

```json
{
  "searchQueries": [
    "home assistant"
  ],
  "strictSearch": false,
  "strictMatchIn": "titleOrText",
  "maxPostsPerSource": 20,
  "searchSort": "relevance",
  "timeFilter": "all",
  "includeNsfw": false,
  "deepScrape": false,
  "includeComments": false,
  "commentSort": "confidence",
  "aiAnalysis": false,
  "outputFormat": "items",
  "onlyNew": false,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

Every record: posts, comments, profiles, communities and Markdown threads, each with a type field.

## `posts` (type: `string`):

Posts only (type post).

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

Comments with parentId, depth and rootCommentId (type comment).

## `threads` (type: `string`):

With outputFormat threadMarkdown: one record per post with its whole comment tree as Markdown.

## `summary` (type: `string`):

Per-input status, errors, posts dropped by filters, per-thread completeness and watch statistics.

# 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 = {
    "searchQueries": [
        "home assistant"
    ],
    "maxPostsPerSource": 20,
    "includeComments": false,
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("quarra/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 = {
    "searchQueries": ["home assistant"],
    "maxPostsPerSource": 20,
    "includeComments": False,
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("quarra/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 '{
  "searchQueries": [
    "home assistant"
  ],
  "maxPostsPerSource": 20,
  "includeComments": false,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call quarra/reddit-search-scraper --silent --output-dataset

```

## MCP server setup

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