# Reddit Keyword Search Scraper - Posts, Communities, People (`thenetaji/reddit-keyword-search-scraper`) Actor

Searches Reddit by keyword across one of five corpora: posts, communities, comments, people, or media. Each result is saved as a row stating which kind it is, with its id, author, community, creation time, score where Reddit shows one, and its address on reddit.com.

- **URL**: https://apify.com/thenetaji/reddit-keyword-search-scraper.md
- **Developed by:** [The Netaji](https://apify.com/thenetaji) (community)
- **Categories:** Social media, Marketing, Automation
- **Stats:** 1 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.55 / 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?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — 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 Keyword Search Scraper

The Actor searches Reddit by keyword and saves a structured record for every result. One of five
corpora is searched per run — posts, communities, comments, people, or media — and each returns its
own record shape, stated on every row in the `kind` field. No Reddit account, application, or API
credential is involved.

### Accepted input

| Field | Required | Default | Notes |
| --- | --- | --- | --- |
| `q` | yes | — | The words to search for. Passed through as typed, so quotes and operators behave as they do in reddit.com's own search box. |
| `searchType` | no | `posts` | One of `posts`, `communities`, `comments`, `people`, `media`. |
| `maxItems` | no | `100` | Results to save. A search is read in one request, so the effective ceiling is 200. |
| `cursor` | no | — | A search continuation token, if one is already held from elsewhere. A run does not produce one; see below. |

```json
{
  "q": "mechanical keyboard",
  "searchType": "posts",
  "maxItems": 50
}
```

### Response fields

The saved columns are the union of the four record shapes, and a run fills in the ones its corpus
uses. Every row carries `kind`, `id`, and `fullname`.

- **`posts` and `media`** return post records: `kind`, `id`, `fullname`, `title`, `permalink`,
  `author`, `author_id`, `subreddit`, `subreddit_id`, `created_at`, `score`, `comment_count`,
  `nsfw`, `spoiler`, `subreddit_nsfw`, `snippet`, `snippet_fullname`, and `media_url`.
- **`communities`** return community records: `kind`, `id`, `fullname`, `name`, `prefixed_name`,
  `url`, `description`, `weekly_visitors`, `weekly_contributions`, `icon`, `nsfw`, and
  `quarantined`.
- **`comments`** return comment records: `kind`, `id`, `fullname`, `post_fullname`, `post_title`,
  `subreddit`, `subreddit_id`, `author`, `permalink`, `created_at`, `body`, and `nsfw`.
- **`people`** return account records: `kind`, `id`, `fullname`, `name`, `prefixed_name`, `url`,
  `karma`, `description`, and `icon`.

```json
{
  "kind": "post",
  "id": "1abcdef",
  "fullname": "t3_1abcdef",
  "title": "Which switches are actually worth the money?",
  "permalink": "/r/MechanicalKeyboards/comments/1abcdef/which_switches/",
  "author": "example_user",
  "subreddit": "MechanicalKeyboards",
  "created_at": "2026-08-14T09:41:07.000Z",
  "score": 412,
  "comment_count": 86,
  "snippet": "…the switches are the part worth spending on…",
  "nsfw": false
}
```

### Why search records are thinner than feed records

Reddit renders search results in a different markup from the one its feeds use, and the fields that
markup does not carry are saved as `null` rather than filled in from elsewhere. The visible effects
are worth knowing before a column is relied on:

- `score` and `comment_count` come from the counter row Reddit draws beneath a result. Media results
  have no counter row at all, so both are `null` on every row of a `media` search. That is the
  renderer, not the post.
- A comment result carries its `body` and the title of the post it sits on, but no parent and no
  depth, because search returns a result rather than a position in a thread. The **Reddit Comment
  Tree Scraper** returns those.
- `snippet` is Reddit's own highlighted excerpt and is present only where the match was on a comment
  rather than on the title.
- `nsfw` is stated for every search result, which is unusual — on a feed the field is often unknown.
  It remains tri-state in the schema because the same column is shared with feed-shaped records, and
  a `null` there means the source said nothing rather than that the record is safe for work. No NSFW
  filter is offered on any Actor in this family for that reason.

### How deep a run goes

A search is read in a single request. Reddit ranks search results rather than paging them by id, and
the position it hands back cannot be re-aimed at a list that has been trimmed to `maxItems`, so the
Actor publishes no continuation point and prints none. `maxItems` is therefore the only control on
depth, and its ceiling is 200. A run asking for more is answered with 200 and says so in the run log
rather than quietly returning less than was asked for.

Search pages are also small — seven to fourteen results each — and they repeat across pages, so
`maxItems` counts distinct results and a deep run does more reading than the number suggests.

The `cursor` field exists because the search accepts one, not because a run produces one. It is
useful only to a caller who already holds a token from elsewhere; in normal use it is left empty and
`maxItems` is raised instead.

### The people corpus ends early, and that is the corpus

A `people` search returns one short page — a handful of accounts — and then offers nothing further.
A run asking for fifty and receiving four has not failed and has not been throttled; that is all
Reddit will serve for a person search. The run log says so before the request is made, so the small
number is not a surprise afterwards. The other four corpora page normally.

### Failures and partial results

A request that fails ends the run, and results already saved remain in the dataset. An empty result
set ends the run cleanly rather than failing: a search term that matches nothing is an answer, not
an error. Fields absent from a result are returned as `null` rather than omitted, so the column set
is the same in every record.

### Cost

Charging is per result saved to the dataset, plus the platform's one-off Actor start event. `media`
and `people` searches are charged at the same rate as any other, and a run that saves nothing is
charged for nothing beyond the start event.

### Related Actors

- **Reddit Subreddit Feed Scraper** — reading a known community in full, rather than searching
  across all of them.
- **Reddit Comment Tree Scraper** — the whole thread behind a post found here, with depth and
  parent on every comment.
- **Reddit Post Details Scraper** — the complete record for one result, including body text and
  media that search does not return.

### Support

Questions, bug reports, and requests for a field that is not here yet: thenetaji@proton.me.

# Actor input Schema

## `q` (type: `string`):

The words to search Reddit for. Passed through as typed; quotes, operators, and punctuation are treated exactly as reddit.com's own search box treats them.

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

Which corpus to search. Each returns a different record shape: posts and media return post records, communities return subreddit records, comments return comment records, and people return account records.

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

The maximum number of records to save. A value of 0 removes the bound and the run continues until the source reports it has no more to give.

## `cursor` (type: `string`):

A search continuation token, if one is already held from elsewhere. Search results are ranked rather than paged by id, so a run of this Actor cannot publish a token that resumes exactly where it stopped and does not print one; raise Max results to go deeper instead. Leave it empty in normal use.

## Actor input object example

```json
{
  "q": "mechanical keyboard",
  "searchType": "posts",
  "maxItems": 25
}
```

# Actor output Schema

## `dataset` (type: `string`):

All records scraped by this run

# 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 = {
    "q": "mechanical keyboard",
    "maxItems": 25
};

// Run the Actor and wait for it to finish
const run = await client.actor("thenetaji/reddit-keyword-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 = {
    "q": "mechanical keyboard",
    "maxItems": 25,
}

# Run the Actor and wait for it to finish
run = client.actor("thenetaji/reddit-keyword-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 '{
  "q": "mechanical keyboard",
  "maxItems": 25
}' |
apify call thenetaji/reddit-keyword-search-scraper --silent --output-dataset

```

## MCP server setup

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