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

Search Reddit submissions and comments within a subreddit. Filter by author, flair, title, body, URL, time range, and more — with automatic pagination through archived Reddit data. 🔍

- **URL**: https://apify.com/easyapi/reddit-search-scraper.md
- **Developed by:** [EasyApi](https://apify.com/easyapi) (community)
- **Categories:** Social media, Integrations, Open source
- **Stats:** 3 total users, 2 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

from $4.99 / 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.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#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 Search Scraper

Search archived Reddit submissions and comments within a subreddit. Filter by keyword, author, flair, title, body, URL, time range, and more — with automatic pagination using the last result's `created` timestamp.

### Key Features

- Search submissions (posts) or comments within a subreddit
- Filter by query, author, flair, title, selftext, URL, and more
- Support time range filters with `after` and `before`
- Automatic pagination using the last item's `created` field
- Configurable per-request `limit` (1-100) and total `maxItems`
- Optional proxy configuration

### Input

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| searchType | string | No | `submissions` or `comments` (default: submissions) |
| subreddit | string | Yes | Subreddit name without r/ |
| query | string | No | Search keyword |
| author | string | No | Filter by username |
| author\_flair\_text | string | No | Filter by author flair |
| after | string | No | Created after (Unix timestamp or date) |
| before | string | No | Created before (Unix timestamp or date) |
| limit | integer | No | Results per request, 1-100 (default: 100) |
| sort | string | No | `desc` or `asc` (default: desc) |
| crosspost\_parent\_id | string | No | Submissions only |
| over\_18 | string | No | Submissions only: `true` or `false` |
| spoiler | string | No | Submissions only: `true` or `false` |
| title | string | No | Submissions only |
| selftext | string | No | Submissions only |
| link\_flair\_text | string | No | Submissions only |
| url | string | No | Submissions only |
| url\_exact | string | No | Submissions only: `true` or `false` |
| maxItems | integer | No | Max total results (default: 100) |
| proxyConfiguration | object | No | Proxy settings |

#### Input Example

```json
 {
        "query": "ai",
        "subreddit": "AppIdeas",
        "sort": "top",
        "time": "all",
        "safeSearch": "0",
        "maxItems": 45
}
```

### Output

Each result is saved with the full Reddit post or comment payload plus metadata:

```json
{
	"searchType": "submissions",
	"subreddit": "AppIdeas",
	"all_awardings": [],
	"allow_live_comments": false,
	"approved_at_utc": null,
	"approved_by": null,
	"archived": false,
	"author": "soluble_fiber_9651",
	"author_flair_background_color": null,
	"author_flair_css_class": null,
	"author_flair_richtext": [],
	"author_flair_template_id": null,
	"author_flair_text": null,
	"author_flair_text_color": null,
	"author_flair_type": "text",
	"author_fullname": "t2_27j3b4ea6e",
	"author_is_blocked": false,
	"author_patreon_flair": false,
	"author_premium": false,
	"awarders": [],
	"banned_at_utc": null,
	"banned_by": null,
	"can_gild": false,
	"can_mod_post": false,
	"category": null,
	"clicked": false,
	"content_categories": null,
	"contest_mode": false,
	"created": 1782340907,
	"created_utc": 1782340907,
	"discussion_type": null,
	"distinguished": null,
	"domain": "self.AppIdeas",
	"downs": 0,
	"edited": false,
	"gilded": 0,
	"gildings": {},
	"hidden": false,
	"hide_score": true,
	"id": "1uesffe",
	"is_created_from_ads_ui": false,
	"is_crosspostable": false,
	"is_meta": false,
	"is_original_content": false,
	"is_reddit_media_domain": false,
	"is_robot_indexable": false,
	"is_self": true,
	"is_video": false,
	"likes": null,
	"link_flair_background_color": "",
	"link_flair_css_class": null,
	"link_flair_richtext": [],
	"link_flair_text": null,
	"link_flair_text_color": "dark",
	"link_flair_type": "text",
	"location_lat": null,
	"location_long": null,
	"location_name": null,
	"locked": false,
	"media": null,
	"media_embed": {},
	"media_only": false,
	"mod_note": null,
	"mod_reason_by": null,
	"mod_reason_title": null,
	"mod_reports": [],
	"name": "t3_1uesffe",
	"no_follow": true,
	"num_comments": 0,
	"num_crossposts": 0,
	"num_reports": null,
	"over_18": false,
	"permalink": "/r/AppIdeas/comments/1uesffe/i_have_an_app_idea_i_dont_know_how_to_build_apps/",
	"pinned": false,
	"pwls": 6,
	"quarantine": false,
	"removal_reason": null,
	"removed_by": null,
	"removed_by_category": "automod_filtered",
	"report_reasons": null,
	"retrieved_on": 1782340932,
	"saved": false,
	"score": 1,
	"secure_media": null,
	"secure_media_embed": {},
	"selftext": "[removed]",
	"send_replies": true,
	"spoiler": false,
	"stickied": false,
	"subreddit_id": "t5_2sa1z",
	"subreddit_name_prefixed": "r/AppIdeas",
	"subreddit_subscribers": 95473,
	"subreddit_type": "public",
	"suggested_sort": null,
	"thumbnail": "self",
	"thumbnail_height": null,
	"thumbnail_width": null,
	"title": "I have an app idea. I dont know how to build apps. I used an AI ti get a visual example of what i want. I need help",
	"top_awarded_type": null,
	"total_awards_received": 0,
	"treatment_tags": [],
	"ups": 1,
	"upvote_ratio": 1,
	"url": "https://www.reddit.com/r/AppIdeas/comments/1uesffe/i_have_an_app_idea_i_dont_know_how_to_build_apps/",
	"user_reports": [],
	"view_count": null,
	"visited": false,
	"websocket_url": "wss://k8s-lb.wss.redditmedia.com/link/1uesffe?m=AQAAxK49akz6uWmXyTnq5GwyY-U0FhTwzP9FzuVhRgTTotyzLbHh",
	"wls": 6,
	"scrapedAt": "2026-06-25T01:16:34.778Z"
}
```

### Use Cases

- Subreddit research and monitoring
- Content discovery by keyword
- Author and flair-based analysis
- Archived Reddit data extraction

# Actor input Schema

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

Search submissions (posts) or comments within a subreddit

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

Subreddit name without r/, e.g. chatgpt

## `query` (type: `string`):

Search keyword. For comments, this maps to the body search field

## `author` (type: `string`):

Filter by Reddit username

## `author_flair_text` (type: `string`):

Filter by author flair text

## `after` (type: `string`):

Only include results created after this time (Unix timestamp or YYYY-MM-DD)

## `before` (type: `string`):

Only include results created before this time (Unix timestamp or YYYY-MM-DD). Pagination also uses the last item created value automatically

## `limit` (type: `integer`):

Number of results per API request (1-100)

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

Sort order by created time

## `crosspost_parent_id` (type: `string`):

Filter submissions by crosspost parent ID (submissions only)

## `over_18` (type: `string`):

NSFW filter for submissions

## `spoiler` (type: `string`):

Spoiler filter for submissions

## `title` (type: `string`):

Filter submissions by title text (submissions only)

## `selftext` (type: `string`):

Filter submissions by post body text (submissions only)

## `link_flair_text` (type: `string`):

Filter submissions by link flair text (submissions only)

## `url` (type: `string`):

Filter submissions by URL (14-500 characters, submissions only)

## `url_exact` (type: `string`):

Whether the URL filter must match exactly (submissions only)

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

Maximum total number of results to scrape

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

Proxy settings for the actor

## Actor input object example

```json
{
  "searchType": "submissions",
  "subreddit": "chatgpt",
  "query": "ai",
  "author": "",
  "author_flair_text": "",
  "after": "",
  "before": "",
  "limit": 100,
  "sort": "desc",
  "crosspost_parent_id": "",
  "over_18": "",
  "spoiler": "",
  "title": "",
  "selftext": "",
  "link_flair_text": "",
  "url": "",
  "url_exact": "",
  "maxItems": 100,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# 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 = {
    "searchType": "submissions",
    "subreddit": "chatgpt",
    "query": "ai",
    "author": "",
    "author_flair_text": "",
    "after": "",
    "before": "",
    "limit": 100,
    "sort": "desc",
    "crosspost_parent_id": "",
    "over_18": "",
    "spoiler": "",
    "title": "",
    "selftext": "",
    "link_flair_text": "",
    "url": "",
    "url_exact": "",
    "maxItems": 100
};

// Run the Actor and wait for it to finish
const run = await client.actor("easyapi/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 = {
    "searchType": "submissions",
    "subreddit": "chatgpt",
    "query": "ai",
    "author": "",
    "author_flair_text": "",
    "after": "",
    "before": "",
    "limit": 100,
    "sort": "desc",
    "crosspost_parent_id": "",
    "over_18": "",
    "spoiler": "",
    "title": "",
    "selftext": "",
    "link_flair_text": "",
    "url": "",
    "url_exact": "",
    "maxItems": 100,
}

# Run the Actor and wait for it to finish
run = client.actor("easyapi/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 '{
  "searchType": "submissions",
  "subreddit": "chatgpt",
  "query": "ai",
  "author": "",
  "author_flair_text": "",
  "after": "",
  "before": "",
  "limit": 100,
  "sort": "desc",
  "crosspost_parent_id": "",
  "over_18": "",
  "spoiler": "",
  "title": "",
  "selftext": "",
  "link_flair_text": "",
  "url": "",
  "url_exact": "",
  "maxItems": 100
}' |
apify call easyapi/reddit-search-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=easyapi/reddit-search-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/acts/m9ZyCU3DJns1ztDFH/builds/ZFLoBMWpMqbhdtyYK/openapi.json
