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

- **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, 9.1% 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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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:
• Search URLs — https://www.reddit.com/search/?q=ai\&sort=new
• Subreddit URLs — https://www.reddit.com/r/python/
• Subreddit search URLs — https://www.reddit.com/r/python/search/?q=django\&restrict\_sr=1

Leave empty if you want to use the keyword field below instead.

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

Keyword to search across all of Reddit. Used only when the URLs field above is empty. Example: 'artificial intelligence'.

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

How Reddit orders the search results.
• Relevance — best match to the query
• Hot — trending now
• Top — highest score
• New — newest first
• Comments — most comments

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

Whether to include NSFW (over-18) posts in the results.

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

Hard cap on the total number of posts returned across all input URLs. The archive returns up to 100 posts per request and the scraper paginates until this cap is reached.

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

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

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

Default is no proxy — the data archives usually serve fine without one. If an archive rate-limits the request IP (403/429), the scraper auto-escalates: direct → datacenter → residential. Once it falls back to residential, it stays there for the rest of the run.

## Actor input object example

```json
{
  "urls": [
    "https://www.reddit.com/r/technology/search/?q=ai&restrict_sr=1&sort=new"
  ],
  "sort": "relevance",
  "safeSearch": "off",
  "maxItems": 10,
  "maxRetries": 3,
  "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"
    ],
    "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"],
    "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("💾 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 '{
  "urls": [
    "https://www.reddit.com/r/technology/search/?q=ai&restrict_sr=1&sort=new"
  ],
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call scraper-engine/reddit-comments-search-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Reddit Comments Search Scraper",
        "description": null,
        "version": "0.1",
        "x-build-id": "mXCZ3nRZzgYB2DFmh"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/scraper-engine~reddit-comments-search-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-scraper-engine-reddit-comments-search-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/scraper-engine~reddit-comments-search-scraper/runs": {
            "post": {
                "operationId": "runs-sync-scraper-engine-reddit-comments-search-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/scraper-engine~reddit-comments-search-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-scraper-engine-reddit-comments-search-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "urls": {
                        "title": "🌐 Reddit URLs (bulk)",
                        "type": "array",
                        "description": "One or more Reddit URLs. Supports:\n• Search URLs — https://www.reddit.com/search/?q=ai&sort=new\n• Subreddit URLs — https://www.reddit.com/r/python/\n• Subreddit search URLs — https://www.reddit.com/r/python/search/?q=django&restrict_sr=1\n\nLeave empty if you want to use the keyword field below instead.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "query": {
                        "title": "🔎 Search Query (fallback)",
                        "type": "string",
                        "description": "Keyword to search across all of Reddit. Used only when the URLs field above is empty. Example: 'artificial intelligence'."
                    },
                    "sort": {
                        "title": "📊 Sort By",
                        "enum": [
                            "relevance",
                            "hot",
                            "top",
                            "new",
                            "comments"
                        ],
                        "type": "string",
                        "description": "How Reddit orders the search results.\n• Relevance — best match to the query\n• Hot — trending now\n• Top — highest score\n• New — newest first\n• Comments — most comments",
                        "default": "relevance"
                    },
                    "safeSearch": {
                        "title": "🔞 Safe Search",
                        "enum": [
                            "off",
                            "on"
                        ],
                        "type": "string",
                        "description": "Whether to include NSFW (over-18) posts in the results.",
                        "default": "off"
                    },
                    "maxItems": {
                        "title": "📦 Maximum Items",
                        "minimum": 1,
                        "maximum": 50000,
                        "type": "integer",
                        "description": "Hard cap on the total number of posts returned across all input URLs. The archive returns up to 100 posts per request and the scraper paginates until this cap is reached.",
                        "default": 10
                    },
                    "maxRetries": {
                        "title": "🔁 Max Retries Per Request",
                        "minimum": 1,
                        "maximum": 10,
                        "type": "integer",
                        "description": "How many times to retry a failed Reddit API request (per proxy tier) before falling back to the next tier.",
                        "default": 3
                    },
                    "proxyConfiguration": {
                        "title": "🛡️ Proxy Configuration",
                        "type": "object",
                        "description": "Default is no proxy — the data archives usually serve fine without one. If an archive rate-limits the request IP (403/429), the scraper auto-escalates: direct → datacenter → residential. Once it falls back to residential, it stays there for the rest of the run.",
                        "default": {
                            "useApifyProxy": false
                        }
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
