# Reddit Scraper – Posts, Full Comment Trees & Users (`ninhothedev/reddit-scraper`) Actor

$1.5/1K 🔥 Fast Reddit scraper! Posts, comments, scores, authors & full comment trees from any subreddit or search. JSON, CSV, Excel or API in seconds. Paste a subreddit or keyword & pull thousands of posts for research & trend-tracking ⚡

- **URL**: https://apify.com/ninhothedev/reddit-scraper.md
- **Developed by:** [ninhothedev](https://apify.com/ninhothedev) (community)
- **Categories:** Social media
- **Stats:** 1 total users, 1 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 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 Scraper – Posts, Full Comment Trees & Users

**Scrape Reddit posts, FULL nested comment trees, user posts and search: score, upvote ratio, awards, media, AI-ready markdown and token counts. As JSON, CSV or Excel.**

### 💵 Pricing

**Pay per result — $0.001 per item.** No subscription and **no proxy** — you only pay for the data you scrape, and new Apify accounts include free monthly credits so you can test it for **$0**.

> **Zero setup for you.** This actor is pre-configured with its own free Reddit app, so as a buyer you paste nothing — just pick a mode and run. (Actor owners: see the one-time setup below.)

### 🔎 What can it extract?

- Post: title, score, upvote ratio, awards
- **Full nested comment trees** (replies)
- Author, subreddit, flair, NSFW/stickied
- Media (gallery, video), markdown + token counts
- Modes: subreddit, post, user, search

### 🚀 How do I use it?

1. Click **Try for free**.
2. Set the input (see example below).
3. Click **Start** and download results as JSON, CSV or Excel — or pull them via the API / schedule them.

### ⚙️ Input example

```json
{
  "mode": "subreddit",
  "subreddit": "python",
  "sort": "top",
  "maxPosts": 50,
  "includeComments": true
}
```

### 📦 Output example

```json
{
  "title": "\u2026",
  "score": 4200,
  "upvote_ratio": 0.98,
  "num_comments": 351,
  "comments": [
    {
      "author": "\u2026",
      "body": "\u2026",
      "replies": []
    }
  ]
}
```

### 🎯 Use cases

- Sentiment & community research
- AI / RAG over discussions
- Brand & topic monitoring
- Lead/market research

### 💰 How much will it cost?

You pay only the per-result price (with a free Reddit app):
100 → ~$0.1 · 1,000 → ~$1 · 10,000 → ~$10

### 🆚 Why this one

| Feature | This actor | Others |
|---|---|---|
| Full comment trees | ✅ | top-level only |
| AI markdown + tokens | ✅ | ❌ |
| Runs on free plan, **no proxy** | ✅ | proxy only |

Under the hood it uses Reddit's official **application-only OAuth** on `oauth.reddit.com` (not the public `.json` endpoints, which Reddit 403s from every datacenter IP). That's why it needs no residential proxy and runs cheaply on the free plan.

### 🔗 Related actors

- [Hacker News Scraper](https://apify.com/ninhothedev/hacker-news-scraper) — tech discussions
- [Google News Scraper](https://apify.com/ninhothedev/google-news-scraper) — news
- [Devto Scraper](https://apify.com/ninhothedev/devto-scraper) — dev articles
- [Instagram Scraper](https://apify.com/ninhothedev/instagram-scraper) — social

### ❓ FAQ

**Do I need credentials or a proxy?** No. The actor ships with its own free Reddit app baked in, authenticates via `oauth.reddit.com`, and needs no proxy. (If you want to run your own copy, create a free Reddit app at https://www.reddit.com/prefs/apps — choose type **script** — and paste its Client ID + Secret into the input.)

### 🛟 Support

Found a bug or need an extra field? Open an issue on the actor — fixes and new fields ship fast.

### Legal & privacy

Public Reddit content. Respect Reddit's API terms.

***

**Keywords:** reddit scraper, posts, comments, subreddit, sentiment, AI training, social media, JSON CSV Excel

# Actor input Schema

## `mode` (type: `string`):

What to scrape: subreddit posts, specific posts (with full comments), a user's posts, or search results.

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

Subreddit name without r/ (e.g. 'python'). Used by subreddit mode, and to restrict search.

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

Sort order for posts (hot/new/top/rising/controversial; for search: relevance/top/new/comments).

## `timeFilter` (type: `string`):

Time window for 'top'/'controversial'/search sorts.

## `postUrls` (type: `array`):

Reddit post URLs to scrape with their full comment trees (mode = post).

## `username` (type: `string`):

Reddit username without u/ (mode = user).

## `searchQuery` (type: `string`):

Search keywords (mode = search). Combine with 'subreddit' to restrict.

## `maxPosts` (type: `integer`):

Maximum posts to scrape per run (paginated automatically).

## `includeComments` (type: `boolean`):

Also fetch the full nested comment tree for each post (post mode always includes them).

## `maxComments` (type: `integer`):

Cap the number of comments fetched per post (across the whole tree).

## `maxCommentDepth` (type: `integer`):

How deep to follow nested replies (1 = top-level only).

## `commentSort` (type: `string`):

How to sort comments.

## `clientId` (type: `string`):

Client ID of a free Reddit app. Create one at https://www.reddit.com/prefs/apps (choose type 'script'); the ID is the short string shown under the app name. Required: it enables the application-only OAuth API on oauth.reddit.com, so the run needs NO proxy and works on the free plan.

## `clientSecret` (type: `string`):

Client secret of your Reddit app (shown next to 'secret' on the app's page at https://www.reddit.com/prefs/apps). Required together with the Client ID for application-only OAuth.

## `userAgent` (type: `string`):

Optional custom User-Agent. Reddit recommends a unique one, e.g. 'web:myapp:v1.0 (by /u/me)'. Leave empty to use the actor's default.

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

Optional proxy, applied to BOTH HTTP transports (curl\_cffi and the urllib fallback). Normally NOT needed: this actor authenticates with application-only OAuth and fetches from oauth.reddit.com, which is not IP-blocked. Enable it only if your runs still hit HTTP 403/429 — Reddit does 403 datacenter IPs on its public reddit.com/.json endpoints.

## Actor input object example

```json
{
  "mode": "subreddit",
  "subreddit": "python",
  "sort": "hot",
  "timeFilter": "all",
  "postUrls": [],
  "maxPosts": 50,
  "includeComments": false,
  "maxComments": 200,
  "maxCommentDepth": 10,
  "commentSort": "top",
  "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 = {
    "subreddit": "python",
    "maxPosts": 50,
    "maxComments": 200,
    "maxCommentDepth": 10,
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("ninhothedev/reddit-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 = {
    "subreddit": "python",
    "maxPosts": 50,
    "maxComments": 200,
    "maxCommentDepth": 10,
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("ninhothedev/reddit-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 '{
  "subreddit": "python",
  "maxPosts": 50,
  "maxComments": 200,
  "maxCommentDepth": 10,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call ninhothedev/reddit-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/acts/9SxvofrEosJzVHwcw/builds/MdlUNb6bk4qVpxlp7/openapi.json
