# Reddit Comments Search Scraper (`scraper-engine/reddit-comments-search-scraper`) Actor

Search and scrape Reddit comments by keywords to extract comment text, usernames, subreddits, timestamps, scores, post details, and engagement data. Discover relevant discussions, analyze audience sentiment, research trends, monitor competitors, and uncover valuable content and marketing insights.

- **URL**: https://apify.com/scraper-engine/reddit-comments-search-scraper.md
- **Developed by:** [Scraper Engine](https://apify.com/scraper-engine) (community)
- **Categories:** Social media, Developer tools, Automation
- **Stats:** 2 total users, 1 monthly users, 75.9% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $4.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?

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

Scrape **Reddit search results and subreddit listings at scale** — paste any Reddit URL (search, subreddit, or subreddit search) and the actor pulls clean structured records from public Reddit data archives (no Reddit login or API key required) and live-saves each post to the dataset.

> ℹ️ **How it works:** Reddit shut down unauthenticated access to its public `.json` endpoints. This actor instead reads from two public Reddit data archives — **PullPush** (primary, full-text + subreddit search) and **Arctic Shift** (fallback for subreddit/author queries) — so it keeps working without you registering a Reddit OAuth app.

> 💡 Built for marketers, researchers, AI/LLM data pipelines, and competitive-intelligence teams who need clean, structured Reddit data without scraping headaches.

***

### ✨ Why choose this Actor?

- 🚀 **Fast** — pure async HTTP, no headless browser overhead.
- 🔓 **No credentials needed** — reads public Reddit archives, so there's no OAuth app, client ID, or rate-limited Reddit key to manage.
- 🛡️ **Smart proxy ladder** — starts direct, auto-falls-back to **datacenter → residential** if an archive rate-limits the request IP, and stays on residential once it kicks in.
- 🔁 **Resilient** — per-request retries with jittered backoff, and 3 retries on the residential tier before giving up.
- 💾 **Live saving** — every post is pushed to the dataset as it's scraped, so a mid-run crash never loses work.
- 🧱 **Bulk URLs** — feed it any number of Reddit URLs in one run.
- 📊 **Pre-built dataset views** — Overview, Post, Subreddit, Author, Content, and Full Record tabs in the Apify Console.

***

### 🎯 Key features

- 🌐 Bulk URL input (search URLs, subreddit URLs, subreddit search URLs)
- 🔎 Optional keyword fallback when no URLs are supplied
- 📊 Sort by **Relevance / Hot / Top / New / Most Comments**
- 🔞 Safe-search toggle
- 📦 Hard cap on total items via `maxItems`
- 🛡️ Default no-proxy, auto-escalating fallback ladder
- 📝 Detailed real-time logs so you can watch progress live

***

### 📥 Input

```json
{
  "urls": [
    { "url": "https://www.reddit.com/search/?q=ai&sort=new" },
    { "url": "https://www.reddit.com/r/python/" }
  ],
  "query": "artificial intelligence",
  "sort": "relevance",
  "safeSearch": "off",
  "maxItems": 300,
  "maxRetries": 3,
  "proxyConfiguration": { "useApifyProxy": false }
}
```

| Field | Type | Description |
|---|---|---|
| `urls` | array | Reddit URLs to scrape (search, subreddit, or subreddit search). |
| `query` | string | Keyword fallback used only when `urls` is empty. |
| `sort` | enum | `relevance` / `hot` / `top` / `new` / `comments`. |
| `safeSearch` | enum | `off` (include NSFW) or `on` (hide NSFW). |
| `maxItems` | integer | Hard cap on total posts across all URLs. |
| `maxRetries` | integer | Per-request retries before escalating proxy tier. |
| `proxyConfiguration` | object | Standard Apify proxy input. Defaults to no proxy. |

***

### 📤 Output

Each dataset record matches the original reference shape exactly, plus a few top-level mirror fields so the table views work without nested-path lookups:

```json
{
  "post": {
    "title": "The more young people use AI, the more they hate it",
    "url": "https://www.reddit.com/r/technology/comments/1szusu6/the_more_young_people_use_ai_the_more_they_hate_it/",
    "score": 22036,
    "comment_count": 1612
  },
  "subreddit": { "name": "technology" },
  "author":    { "name": "spherocytes" },
  "contentText": "",
  "content_type": "link",
  "created_timestamp": "2026-04-30T12:34:21.000000+0000",

  "title": "The more young people use AI, the more they hate it",
  "subreddit_name": "technology",
  "author_name": "spherocytes",
  "score": 22036,
  "comment_count": 1612,
  "url": "https://www.reddit.com/r/technology/comments/1szusu6/the_more_young_people_use_ai_the_more_they_hate_it/"
}
```

***

### 🚀 How to use the Actor (via Apify Console)

1. 🔐 Log in at [console.apify.com](https://console.apify.com) → **Actors**.
2. 🔎 Find **Reddit Search Scraper** and open it.
3. 📝 Paste one or more Reddit URLs (or type a keyword in the `query` field).
4. ⚙️ Pick a `sort` (Relevance / Hot / Top / New / Most Comments) and set `maxItems`.
5. 🛡️ Leave **Proxy** on default (no proxy) — the scraper auto-escalates if Reddit pushes back.
6. ▶️ Click **Start**.
7. 📊 Watch logs in real time; open the **Output** tab as records stream in.
8. 📁 Export to JSON / CSV / Excel.

***

### 🛡️ Proxy strategy

The scraper uses a three-tier ladder (the archives can rate-limit a busy IP):

| Tier | When it's used |
|---|---|
| 🌐 **Direct** | Default — the archives usually serve fine without a proxy. |
| 🏢 **Datacenter** | Auto-engaged if direct requests get 403 / 429 / rate-limited. |
| 🏠 **Residential** | Auto-engaged if datacenter still fails. Retries then sticks for the rest of the run. |

You can also start higher up the ladder by selecting a proxy group in the input.

***

### 📊 Sort & data-source notes

- **Source:** PullPush handles global keyword search and subreddit/author search; Arctic Shift serves subreddit- and author-scoped queries as a fast fallback. Both are public Reddit archives.
- **Sort mapping** — Reddit's sort intents map onto the archives' sort fields:
  - 🎯 Relevance / ⭐ Top / 🔥 Hot → highest **score** first
  - 🆕 New → newest **created** first
  - 💬 Most Comments → highest **comment count** first
- **Coverage:** archives index publicly posted content; very recent posts (last few minutes) or removed content may not appear. Pagination walks backward in time, so large `maxItems` runs are ordered newest-to-oldest within each time window.

***

### 💼 Best use cases

- 🤖 Building AI / LLM training datasets from Reddit discussion
- 📊 Brand monitoring & sentiment analysis
- 🧠 Market research and competitive intelligence
- 📝 Content trend discovery
- 🔬 Academic research on online communities

***

### ❓ Frequently asked questions

**Q: Does it scrape comments?**
A: This actor returns post-level metadata (title, score, comment count, body text). For per-post comment threads, use an additional actor or extend this one to fetch `<permalink>.json`.

**Q: Does it support private subreddits?**
A: No — only publicly accessible subreddits and search results.

**Q: Do I need a Reddit account or API key?**
A: No. The actor reads public Reddit data archives, so there's nothing to register or authenticate.

**Q: What happens if an archive rate-limits me?**
A: The scraper auto-escalates the proxy tier (direct → datacenter → residential) and retries. If every tier still fails, the run ends with a clear status message.

***

### 📨 Support and feedback

For issues, custom features, or feedback: **dev.scraperengine@gmail.com**

***

### ⚠️ Legal & ethical use

- Only collect data from **publicly accessible** Reddit pages.
- Respect Reddit's terms of service and applicable privacy laws (GDPR / CCPA).
- The end user is responsible for downstream use of the data.

# Actor input Schema

## `urls` (type: `array`):

One or more Reddit URLs. Supports:
• Subreddit search — https://www.reddit.com/r/technology/search/?q=ai\&restrict\_sr=1
• Post URL — https://www.reddit.com/r/technology/comments/<id>/...
• Subreddit URL — https://www.reddit.com/r/python/
• Global search — https://www.reddit.com/search/?q=ai\&type=comment

Leave empty to use the keyword field below.

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

Keyword to search in comment bodies across Reddit. Used only when the URLs field is empty. Global keyword search relies on PullPush and may be rate-limited — prefer a subreddit-scoped URL when possible.

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

Preferred ordering for results (archives primarily support score / newest).

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

Whether to include NSFW (over-18) comments when the archive marks them.

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

Hard cap on the total number of comments returned across all input URLs.

## `maxRetries` (type: `integer`):

How many times to retry a failed archive request (per proxy tier) before falling back to the next tier.

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

Default is no proxy — Arctic Shift usually works direct. If an archive rate-limits (403/429), the scraper auto-escalates: direct → datacenter → residential.

## Actor input object example

```json
{
  "urls": [
    "https://www.reddit.com/r/technology/search/?q=ai&restrict_sr=1&sort=new"
  ],
  "sort": "new",
  "safeSearch": "off",
  "maxItems": 10,
  "maxRetries": 2,
  "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 = {
    "urls": [
        "https://www.reddit.com/r/technology/search/?q=ai&restrict_sr=1&sort=new"
    ],
    "maxItems": 10,
    "maxRetries": 2,
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("scraper-engine/reddit-comments-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 = {
    "urls": ["https://www.reddit.com/r/technology/search/?q=ai&restrict_sr=1&sort=new"],
    "maxItems": 10,
    "maxRetries": 2,
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("scraper-engine/reddit-comments-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 '{
  "urls": [
    "https://www.reddit.com/r/technology/search/?q=ai&restrict_sr=1&sort=new"
  ],
  "maxItems": 10,
  "maxRetries": 2,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call scraper-engine/reddit-comments-search-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,scraper-engine/reddit-comments-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/KC8ZbKSaQXHhmhXuD/builds/TJGx4fSSAiX7CGvoG/openapi.json
