# SubReddit Posts Search Scraper (`easyapi/subreddit-posts-search-scraper`) Actor

Scrape Reddit search results from any subreddit with advanced filtering options. Extract post titles, URLs, votes, comments, timestamps and more. Perfect for market research, content analysis and trend monitoring.

- **URL**: https://apify.com/easyapi/subreddit-posts-search-scraper.md
- **Developed by:** [EasyApi](https://apify.com/easyapi) (community)
- **Categories:** Social media
- **Features:** Limited permissions
- **Stats:** 119 total users, 2 monthly users, 100.0% runs succeeded, 5 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $2.99 / 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

## SubReddit Posts Search Scraper 🔍

Powerful Reddit scraper that extracts search results from any subreddit with advanced filtering capabilities.

### 🎯 Features

- Search any subreddit for specific keywords or phrases
- Advanced sorting options (relevance, top, new, comments, hot)
- Customizable time range filtering (hour, day, week, month, year, all)
- Safe search toggle
- Configurable maximum items limit

### 📊 Output Data

The actor extracts the following data for each post:

- Post title
- Full Reddit URL
- Creation timestamp
- Number of upvotes
- Number of comments
- Subreddit name
- Thumbnail URL (if available)

### 💡 Use Cases

- Market research and trend analysis
- Content monitoring and curation
- Community engagement tracking
- Competitive analysis
- Academic research
- Social media monitoring

### 🔧 Input Parameters

| Parameter | Type | Description |
|-----------|------|-------------|
| query | String | Search keyword or phrase |
| subReddit | String | Target subreddit name (without 'r/') |
| sort | String | Sort results by: 'relevance', 'top', 'new', 'comments', or 'hot' |
| time | String | Time range filter: 'hour', 'day', 'week', 'month', 'year', or 'all' |
| safeSearch | String | Enable/disable safe search ('0' for safe, '1' for unsafe) |
| maxItems | Integer | Maximum number of items to scrape |

#### Input Example

A full explanation of an input example in JSON.

```
{
    "query": "ai",
    "subReddit": "r/AppIdeas",
    "sort": "top",
    "time": "all",
    "safeSearch": "1",
    "maxItems": 30
}
```

#### Output sample

The results will be wrapped into a dataset which you can always find in the **Storage** tab. Here's an excerpt from the data you'd get if you apply the input parameters above:

And here is the same data but in JSON. You can choose in which format to download your data: JSON, JSONL, Excel spreadsheet, HTML table, CSV, or XML.

```
[
	{
		"title": "AI-Powered Audio-to-Text Organizer and Formatter App",
		"url": "https://www.reddit.com/r/AppIdeas/comments/14xmec9/aipowered_audiototext_organizer_and_formatter_app/",
		"created_time": "2023-07-12T11:52:32.673000+0000",
		"votes": 47,
		"comments": 13,
		"subreddit": "r/AppIdeas"
	},
	{
		"title": "A messaging app where AI converts your sentence to a single image that perfectly conveys your message. Communication is exclusively visual.",
		"url": "https://www.reddit.com/r/AppIdeas/comments/vb8sdf/a_messaging_app_where_ai_converts_your_sentence/",
		"created_time": "2022-06-13T10:11:23.725000+0000",
		"votes": 36,
		"comments": 8,
		"subreddit": "r/AppIdeas",
		"thumbnail": "https://a.thumbs.redditmedia.com/ynraYPga9t2QMtBcoZ36z4gFgP41zInOTD4MZccadJ0.jpg"
	},
    ...
]
```

### Related Actors

- 🔍 [Reddit Comments Scraper](https://apify.com/easyapi/reddit-comments-scraper) - Extract Reddit comments with complete thread structure and engagement metrics
- 🔍 [SubReddit Comments Search Scraper](https://apify.com/easyapi/subreddit-comments-search-scraper) - Extract Reddit comments from any subreddit's search results with advanced filtering
- 🔍 [Reddit Communities Search Scraper](https://apify.com/easyapi/reddit-communities-search-scraper) - Extract Reddit communities with comprehensive metadata and member counts
- 🔍 [Reddit Media Search Scraper](https://apify.com/easyapi/reddit-media-search-scraper) - Extract media posts from Reddit's search results with rich metadata
- 🔍 [Reddit Trends Scraper](https://apify.com/easyapi/reddit-trends-scraper) - Extract trending posts and discussions from Reddit with advanced filtering
- 📥 [Reddit Media Downloader](https://apify.com/easyapi/reddit-media-downloader) - Download high-quality videos, GIFs, and images from Reddit posts
- 🔍 [SubReddit Media Search Scraper](https://apify.com/easyapi/subreddit-media-search-scraper) - Extract media content from Reddit subreddit search results
- 🔍 [Facebook Posts Search Scraper](https://apify.com/easyapi/facebook-posts-search-scraper) - Extract posts from Facebook search results with detailed information
- 🔍 [Twitter/X Video Downloader](https://apify.com/easyapi/twitter-x-video-downloader) - Download high-quality videos from Twitter/X platform
- 📱 [Facebook Post Comments Scraper](https://apify.com/easyapi/facebook-post-comments-scraper) - Extract comments from public Facebook posts with detailed information
- 🔍 [Medium Posts Search Scraper](https://apify.com/easyapi/medium-posts-search-scraper) - Extract comprehensive article data from Medium's search results
- 🎯 [Social Media Hashtag Generator](https://apify.com/easyapi/social-media-hashtag-generator) - Generate relevant hashtags for multiple social media platforms
- 📊 [Text Sentiment Analysis](https://apify.com/easyapi/text-sentiment-analysis) - Analyze sentiment of text content with detailed breakdown
- 📄 [Article Content Extractor](https://apify.com/easyapi/article-content-extractor) - Extract clean article content and metadata from web pages
- 🔍 [AI-powered Search](https://apify.com/easyapi/ai-powered-search) - Get AI-enhanced search summaries with references and optimization tips

# Actor input Schema

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

Keyword or phrase to search for

## `subReddit` (type: `string`):

Target subreddit name (without 'r/')

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

How to sort the search results

## `time` (type: `string`):

Time range for the search results

## `safeSearch` (type: `string`):

Enable or disable safe search

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

Maximum number of items to scrape

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

Optionally, use Apify Proxy or custom HTTP proxy to avoid IP address-based blocking.

## Actor input object example

```json
{
  "query": "ai",
  "subReddit": "AppIdeas",
  "sort": "relevance",
  "time": "all",
  "safeSearch": "0",
  "maxItems": 30,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# 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 = {
    "query": "ai",
    "subReddit": "AppIdeas",
    "sort": "relevance",
    "time": "all",
    "safeSearch": "0",
    "maxItems": 30,
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("easyapi/subreddit-posts-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 = {
    "query": "ai",
    "subReddit": "AppIdeas",
    "sort": "relevance",
    "time": "all",
    "safeSearch": "0",
    "maxItems": 30,
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("easyapi/subreddit-posts-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 '{
  "query": "ai",
  "subReddit": "AppIdeas",
  "sort": "relevance",
  "time": "all",
  "safeSearch": "0",
  "maxItems": 30,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call easyapi/subreddit-posts-search-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,easyapi/subreddit-posts-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/66pzBc8gb5YxPCPca/builds/t5uwzX2vHHh1ybMe2/openapi.json
