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

Search Reddit posts globally or within a subreddit. Sort by relevance/hot/new/top/comments.

- **URL**: https://apify.com/axery/reddit-search-scraper.md
- **Developed by:** [Axery](https://apify.com/axery) (community)
- **Categories:** Social media, Marketing
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.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 posts by keyword — across all of Reddit, or narrowed to one subreddit — with sort mode, time window, and full pagination.

Useful for brand/topic monitoring, market research, and building a keyword-tracked dataset across many subreddits at once.

### Current access status — read before running

Reddit's own anonymous JSON endpoints (`www.reddit.com/search.json`, `old.reddit.com/search.json`) are currently answering every request with a hard login wall, verified directly and consistently across TLS fingerprints as of this Actor's last build — not a rate limit, a login requirement. The one path that still works is Reddit's own official OAuth **installed-app** grant, which needs a free `client_id` (no client secret, no personal login) registered once at [reddit.com/prefs/apps](https://www.reddit.com/prefs/apps) — choose "installed app" when creating it. Supply that value in the `redditClientId` input field.

Without a `client_id`, this Actor will currently fail on every request — that's Reddit's access wall, not a bug here, and it's stated plainly rather than left to be discovered as a silent failure.

### What makes this different

**Global or subreddit-scoped in the same input.** Search all of Reddit, or narrow to one community for higher-signal results, without switching actors.

**Every query traceable in its own results.** Each row carries the `query` that produced it, so a multi-keyword run stays separable without re-running one query at a time.

**A clean, documented schema**, not a raw API dump. Reddit's search results carry the same several-dozen-field raw post object as any other listing; this Actor keeps only the fields with real research value, consistently named.

### Input

| Field | Type | Notes |
|---|---|---|
| `queries` | array | Search terms. Each is run independently into the same dataset. |
| `subreddit` | string | Optional. Restrict to one subreddit. |
| `sort` | enum | `relevance`, `hot`, `new`, `top`, `comments`. |
| `timeFilter` | enum | `hour`, `day`, `week`, `month`, `year`, `all`. |
| `maxPosts` | integer | Per query. |
| `redditClientId` | string | Currently effectively required — see above. |
| `proxyConfiguration` | object | Defaults to Residential. |

### Output

```json
{
  "post_id": "reddit.com:1a2b3c",
  "query": "rust web server",
  "subreddit": "programming",
  "title": "Show HN: I built a blazingly fast Rust web server",
  "author": "rustacean42",
  "score": 1842,
  "num_comments": 234,
  "created_at": "2026-05-13T10:22:00Z",
  "permalink": "https://www.reddit.com/r/programming/comments/1a2b3c/..."
}
```

### Local development

```bash
pip install -r requirements.txt
python test_local.py "rust web server" --client-id YOUR_CLIENT_ID
python test_local.py "rust web server" --subreddit programming --sort top --max 20
```

No `sample_output.json` ships with this Actor — Reddit's current access wall means a live run cannot be produced without a registered `client_id`, and this project doesn't publish fabricated sample data.

# Actor input Schema

## `queries` (type: `array`):

One or more keywords or phrases to search for. Each query runs independently and its results stream into the same dataset (joinable via the `_input` field).

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

Optional subreddit name (without `r/`) to restrict the search to. Leave blank to search all of Reddit. Example: `python`, `MachineLearning`, `news`.

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

How results are ordered. `relevance` matches Reddit's default search ranking; `new` returns the freshest posts; `top` returns the highest-scoring posts within the selected time window; `comments` ranks by discussion volume.

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

Time window for results. Only meaningful with sort `top` or `comments`. Use `day` or `week` for trend monitoring; `all` returns the full archive.

## `maxPosts` (type: `integer`):

Maximum number of posts to return per query. Set to `0` for unlimited (subject to Reddit's pagination cap of about 1,000 results per query).

## `redditClientId` (type: `string`):

Currently effectively required - Reddit blocks anonymous access with a hard login wall (confirmed directly). Register a free installed-app client ID at reddit.com/prefs/apps (choose "installed app" - no client secret, no personal login) and paste it here.

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

Apify Proxy settings. Defaults to Residential - Reddit currently blocks anonymous access from Apify's own container IP range with a hard login wall (confirmed directly), so a residential-looking IP is the only realistic chance of success without an installed-app client ID.

## Actor input object example

```json
{
  "queries": [
    "python"
  ],
  "subreddit": "python",
  "sort": "new",
  "timeFilter": "all",
  "maxPosts": 25,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

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

One row per post matching the query.

# 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 = {
    "queries": [
        "python",
        "machine learning"
    ],
    "subreddit": "python",
    "sort": "new",
    "maxPosts": 25
};

// Run the Actor and wait for it to finish
const run = await client.actor("axery/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 = {
    "queries": [
        "python",
        "machine learning",
    ],
    "subreddit": "python",
    "sort": "new",
    "maxPosts": 25,
}

# Run the Actor and wait for it to finish
run = client.actor("axery/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 '{
  "queries": [
    "python",
    "machine learning"
  ],
  "subreddit": "python",
  "sort": "new",
  "maxPosts": 25
}' |
apify call axery/reddit-search-scraper --silent --output-dataset

```

## MCP server setup

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