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

Search Reddit for posts, subreddits, and users by keywords. Supports flexible filtering by time, sorting options, and NSFW content. Automatically handles pagination for large result sets.

- **URL**: https://apify.com/backhoe/reddit-search-scraper.md
- **Developed by:** [D](https://apify.com/backhoe) (community)
- **Categories:** Social media
- **Features:** Full permissions
- **Stats:** 167 total users, 4 monthly users, 100.0% runs succeeded, 9 bookmarks
- **User rating**: 4.51 out of 5 stars

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-usage

## 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

> **🆓 100% FREE** | **⚡ Fast & Reliable** | **🔒 No API Key Required**

A powerful tool for searching Reddit content by keywords. Find posts, subreddits, and users with flexible sorting and time filters.

***

### ✨ Why Choose This Scraper?

- ✅ **Completely Free** - No hidden costs or subscriptions
- ✅ **No Reddit API Key Needed** - Works out of the box
- ✅ **Residential Proxies Included** - Avoid rate limits
- ✅ **Automatic Pagination** - Get thousands of results effortlessly
- ✅ **Real-time Data** - Fresh content from Reddit

***

### 🚀 Key Features

- **Keyword Search**: Find relevant content on Reddit
- **Search Types**: Posts (link), subreddits (sr), users (user)
- **Time Filters**: hour, day, week, month, year, all
- **Sorting Options**: relevance, hot, top, new, comments
- **NSFW Content**: Optional inclusion/exclusion
- **Pagination**: Automatic handling of large result sets

### 📋 Input Parameters

```json
{
  "searches": ["python", "machine learning"],
  "type": "link",
  "sort": "new",
  "time": "week",
  "includeNSFW": false,
  "maxItems": 100,
  "debugMode": false
}
```

#### Parameters:

- **searches** (array, required): List of keywords to search for
- **type** (string): Content type - `link` (posts), `sr` (subreddits), `user` (users)
- **sort** (string): Result sorting method
- **time** (string): Time filter for publication date
- **includeNSFW** (boolean): Include NSFW content
- **maxItems** (integer): Maximum number of results
- **debugMode** (boolean): Debug mode with detailed logging

### 📤 Output Data

Each result contains:

```json
{
  "dataType": "post",
  "keyword": "python",
  "title": "New Python 3.13 features",
  "url": "https://www.reddit.com/r/Python/comments/...",
  "id": "abc123",
  "author": "username",
  "created_at_text": "2 hours ago",
  "scrapedAt": "2025-01-20T10:30:00.000Z"
}
```

### 💡 Usage Examples

#### Search for Python posts from the last week

```json
{
  "searches": ["python"],
  "type": "link",
  "sort": "top",
  "time": "week",
  "maxItems": 50
}
```

#### Find AI-related subreddits

```json
{
  "searches": ["artificial intelligence", "machine learning"],
  "type": "sr",
  "sort": "relevance",
  "maxItems": 20
}
```

### ⚙️ Technical Details

- **Memory**: 256 MB (optimized for efficiency)
- **Proxy**: Residential (automatic, included free)
- **Timeout**: 3600 seconds
- **Source**: old.reddit.com (more stable for parsing)

### 📝 Notes

- Uses HTML parsing for maximum stability
- Automatic pagination handling
- Residential proxies to avoid blocking
- All results include data collection timestamp

***

### 🎯 Perfect For

- 📊 Market research and trend analysis
- 🔬 Academic research and data collection
- 📈 Social media monitoring
- 🤖 Training AI/ML models
- 📰 Content discovery and curation

***

**💬 Questions or Issues?** Feel free to reach out or check the documentation!

## Actor input object example

```json
{}
```

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("backhoe/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 = {}

# Run the Actor and wait for it to finish
run = client.actor("backhoe/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 '{}' |
apify call backhoe/reddit-search-scraper --silent --output-dataset

```

## MCP server setup

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