# Reddit Keyword Search with Advanced Filters (`nimbryxo-studio/reddit-keyword-search-with-advanced-filters`) Actor

Search Reddit by keyword and filter the matches by subreddit, score, date range, NSFW status, and author before they reach your dataset.

- **URL**: https://apify.com/nimbryxo-studio/reddit-keyword-search-with-advanced-filters.md
- **Developed by:** [Nimbryxo-studio](https://apify.com/nimbryxo-studio) (community)
- **Categories:** Social media, Automation, Lead generation
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.49 / 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.
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 Keyword Search with Advanced Filters

Search Reddit for one or more keywords and get back matching posts, narrowed down with subreddit allow/block lists, a minimum score, a date range, an NSFW toggle, and an author blocklist — so the dataset you export only contains the posts that actually matter to you.

### What this actor does

- Runs a separate Reddit search for each keyword you provide and tags every post with the keyword that found it
- Keeps or drops posts by subreddit (allowlist or blocklist), minimum score, maximum age in days, or an explicit date range
- Can require that a post's title/content contain every keyword at once instead of matching any single one
- Drops NSFW posts and posts from specific authors on request
- Omits any field Reddit's listing didn't provide for a post rather than returning it empty

### Output per post

- `keyword` — the keyword that matched this post
- `post_id`, `post_name` — Reddit's post ID and fullname (`t3_...`)
- `title`, `content` — post title and self-text snippet, when the post has one
- `author`, `author_fullname`
- `subreddit`, `subreddit_prefixed` — e.g. `r/geopolitics`
- `score`, `num_comments`, `num_crossposts`, `gilded_count`
- `url`, `permalink`, `external_url` — external link target, only present when it differs from the Reddit permalink
- `thumbnail_url`, `link_flair`
- `created_utc`, `created_at`
- `is_self`, `is_stickied`, `is_nsfw`, `is_spoiler`, `is_promoted`, `is_original_content`
- `post_hint` — rough content type (`self`, `image`, `gallery`, `link`, `hosted:video`, `rich:video`)
- `title_word_count`, `post_age_seconds`
- `crosspost_parent` — the original post's ID, title, author, subreddit, score, and comment count, present only when this post is a crosspost

### Output when nothing is returned

If `keywords` is empty, or every post the search found was rejected by your filters (or no posts were found at all), the actor emits a single `recordType: "error"` record instead of post records, with `reason` (`no_keywords` or `all_filters_dropped_results`), a human-readable `message`, and — for the filters case — the `keywords` searched and an `appliedFilters` summary of every filter value you set, so you can see why nothing came through.

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `keywords` | array | – | Keywords to search; each one runs as its own search (required) |
| `resultLimit` | integer | `500` | Max posts to return per keyword (1-1000) |
| `sort` | string (select) | `relevance` | `relevance`, `hot`, `top`, `new`, or `comments` |
| `subredditFilter` | array | `[]` | Only keep posts from these subreddits (no `r/` prefix); empty keeps all |
| `subredditBlocklist` | array | `[]` | Drop posts from these subreddits |
| `minScore` | integer | – | Drop posts with a score below this number |
| `maxAgeDays` | integer | – | Drop posts older than this many days |
| `excludeNsfw` | boolean | `false` | Drop posts marked NSFW |
| `authorBlocklist` | array | `[]` | Drop posts from these usernames (case-insensitive) |
| `keywordRequireAll` | boolean | `false` | With multiple keywords, keep only posts whose title/content contains all of them, instead of any one |
| `dateFrom` | string | – | Drop posts created before this date (`YYYY-MM-DD`, inclusive) |
| `dateTo` | string | – | Drop posts created after this date (`YYYY-MM-DD`, inclusive of the full day) |

#### Example: single keyword, top posts of all time

```json
{
  "keywords": ["machine learning"],
  "resultLimit": 100,
  "sort": "top"
}
```

#### Example: brand mentions, excluding NSFW and low-score noise

```json
{
  "keywords": ["mybrand", "mybrand review"],
  "minScore": 5,
  "excludeNsfw": true,
  "subredditBlocklist": ["spam"],
  "resultLimit": 200
}
```

#### Example: posts from the last 30 days that mention two terms together

```json
{
  "keywords": ["layoffs", "tech"],
  "keywordRequireAll": true,
  "maxAgeDays": 30,
  "sort": "new"
}
```

### Use cases

- Brand and product monitoring — track mentions while filtering out low-score or NSFW noise
- Lead and sentiment research — pull threads matching two or more terms at once with `keywordRequireAll`
- Subreddit-scoped research — restrict a broad keyword search to a hand-picked set of communities
- Trend tracking — compare `new` vs `top` results for the same keyword over a rolling date window
- Moderation or spam review — drop known problem authors or subreddits before they reach your dataset

### FAQ

**How is this different from a plain keyword search?**
Every filter here (subreddit allow/block, score floor, date range, NSFW exclusion, author blocklist, multi-keyword AND matching) is applied after the search, so the dataset you get already reflects your criteria instead of needing to be cleaned up afterward.

**What happens when I give several keywords?**
By default each keyword runs as an independent search and results are combined (OR). Set `keywordRequireAll` to `true` to instead keep only posts whose title or content contains every keyword you listed.

**Why do some posts have no `content`?**
Link posts and posts without a text body don't have self-text; `content` is only present for text (self) posts that have one.

**What does `external_url` mean, and why is it sometimes missing?**
It's the destination of a link post when that destination differs from the Reddit permalink. Self-posts, and link posts that just point back at Reddit, don't get this field.

**Can I combine `dateFrom`/`dateTo` with `maxAgeDays`?**
Yes — both filters are applied together, so the post must satisfy whichever ones you set.

**Does `subredditFilter` and `subredditBlocklist` work together?**
Yes. A post must pass both: it's dropped if it's in the blocklist, and dropped if an allowlist is set and the post's subreddit isn't in it.

**Do I need a Reddit account or API credentials?**
No — this actor reads Reddit's public search results directly, without a login.

**Is this affiliated with Reddit?**
No. This is an independent actor that reads Reddit's publicly available search pages.

# Actor input Schema

## `keywords` (type: `array`):

List of keywords to search. Each runs as a separate Reddit search.

## `resultLimit` (type: `integer`):

Max posts per keyword (1-1000).

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

How to sort the search results.

## `subredditFilter` (type: `array`):

Only emit posts from these subreddits (without `r/` prefix). Empty = all.

## `subredditBlocklist` (type: `array`):

Drop posts from these subreddits.

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

Drop posts with score below this number.

## `maxAgeDays` (type: `integer`):

Drop posts older than N days.

## `excludeNsfw` (type: `boolean`):

Drop NSFW posts.

## `authorBlocklist` (type: `array`):

Drop posts by these usernames (case-insensitive).

## `keywordRequireAll` (type: `boolean`):

When multiple keywords given, also dedupe & only emit posts whose title/content contains ALL of them. Default: each keyword runs independently (OR).

## `dateFrom` (type: `string`):

Drop posts with `created_at` before this date (inclusive). Format: YYYY-MM-DD.

## `dateTo` (type: `string`):

Drop posts with `created_at` after this date (inclusive end-of-day). Format: YYYY-MM-DD.

## Actor input object example

```json
{
  "keywords": [
    "python programming"
  ],
  "resultLimit": 500,
  "sort": "relevance",
  "subredditFilter": [],
  "subredditBlocklist": [],
  "excludeNsfw": false,
  "authorBlocklist": [],
  "keywordRequireAll": false
}
```

# Actor output Schema

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

Dataset containing all scraped Reddit posts.

# 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 = {
    "keywords": [
        "python programming"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("nimbryxo-studio/reddit-keyword-search-with-advanced-filters").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 = { "keywords": ["python programming"] }

# Run the Actor and wait for it to finish
run = client.actor("nimbryxo-studio/reddit-keyword-search-with-advanced-filters").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 '{
  "keywords": [
    "python programming"
  ]
}' |
apify call nimbryxo-studio/reddit-keyword-search-with-advanced-filters --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,nimbryxo-studio/reddit-keyword-search-with-advanced-filters"
        }
    }
}
```

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/SG9Ngr95n5Hkk64vN/builds/h7QrhQVhzxY2jSbRi/openapi.json
