# Reddit Scraper - Posts, Comments & Subreddits (`admo-solutions/reddit-scraper`) Actor

Scrape Reddit posts, comments, subreddits, and user profiles using Reddit's public JSON API. No API key required.

- **URL**: https://apify.com/admo-solutions/reddit-scraper.md
- **Developed by:** [Admo Solutions](https://apify.com/admo-solutions) (community)
- **Categories:**
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 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 Scraper - Posts, Comments & Subreddits

Scrape **Reddit posts, comments, subreddits, and user profiles** using Reddit's public RSS feeds. No API key required. Extract structured data from any subreddit, search results, or user histories.

[Reddit](https://www.reddit.com) is one of the largest social platforms with millions of active communities. This Actor lets you extract that data at scale for research, analysis, and monitoring.

### Why use this Reddit Scraper?

- **No API key needed** — uses Reddit's public RSS endpoints
- **Fast & lightweight** — HTTP-based, no browser automation required
- **Multiple modes** — scrape subreddits, search, or user profiles
- **Structured output** — clean JSON with all important fields extracted
- **Rate-limit aware** — built-in retry logic and request throttling
- **Pay per result** — only pay for the data you actually scrape

### How to use

1. Choose a **Scrape Mode**: Subreddit, Search, or User Posts
2. Configure the mode-specific fields (subreddit name, search query, or username)
3. Set max items and sorting preferences
4. Run the Actor — results appear in the Dataset tab
5. Download as JSON, CSV, Excel, or HTML

### Input

| Field | Type | Required | Default | Description |
|-------|------|----------|---------|-------------|
| `mode` | enum | ✅ | `subreddit` | `subreddit`, `search`, or `user_posts` |
| `subreddits` | array | ❌ | `["python"]` | Subreddit names without r/ prefix |
| `searchQueries` | array | ❌ | `[]` | Keywords to search for on Reddit |
| `usernames` | array | ❌ | `[]` | Reddit usernames without u/ prefix |
| `sortBy` | enum | ❌ | `hot` | `hot`, `new`, `top`, `rising`, `relevance` |
| `maxItems` | integer | ❌ | `100` | Maximum items to scrape per query |
| `proxyConfiguration` | object | ✅ | `{"useApifyProxy": true}` | Required: Reddit blocks server IPs |

#### Example Input

```json
{
  "mode": "subreddit",
  "subreddits": ["python", "javascript"],
  "sortBy": "hot",
  "maxItems": 100
}
```

### Output

```json
{
  "id": "t3_1w78kp5",
  "subreddit": "python",
  "title": "Showcase Thread",
  "author": "/u/AutoModerator",
  "url": "https://www.reddit.com/r/Python/comments/1w78kp5/showcase_thread/",
  "score": 1542,
  "numComments": 234,
  "contentHtml": "<div>Post content...</div>"
}
```

You can download the dataset in various formats such as JSON, HTML, CSV, or Excel.

### Data fields

| Field | Description |
|-------|-------------|
| `id` | Reddit post ID (e.g., t3\_1w78kp5) |
| `subreddit` | Subreddit name |
| `title` | Post title |
| `author` | Reddit username |
| `url` | Post URL |
| `score` | Upvotes minus downvotes |
| `numComments` | Number of comments |
| `contentHtml` | Post content (HTML) |

### Pricing

This Actor uses Reddit's public RSS feeds. Cost depends on items scraped:

- **Subreddit mode**: ~100 posts per request, ~1s delay between requests
- **Search mode**: Similar to subreddit
- **User Posts**: Posts from specific users

**Recommended pricing**: $0.003 per result ($3.00 per 1,000 items)

### Tips

- Use `maxItems` to control costs — set a reasonable limit
- For large subreddits, use `sortBy: "new"` to get recent posts
- Reddit rate-limits requests — the Actor handles this automatically
- Residential proxy is required (Reddit blocks server IPs)

### Limitations

- Reddit may block requests if too many are made in a short period
- Some subreddits are private/restricted and cannot be scraped
- NSFW content requires age verification
- RSS feeds limited to ~100 items per request

### Support

For issues or feature requests, please open an issue on the Apify platform.

# Actor input Schema

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

What to scrape from Reddit

## `subreddits` (type: `array`):

Subreddit names to scrape (without r/ prefix). One per line.

## `searchQueries` (type: `array`):

Keywords to search for on Reddit. One per line.

## `usernames` (type: `array`):

Reddit usernames to scrape (without u/ prefix). One per line.

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

Reddit post URLs or IDs to fetch with comments. One per line.

## `sortBy` (type: `string`):

How to sort results

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

Maximum number of items to scrape per subreddit/query/user

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

Maximum number of top-level comments to fetch per post (only for Post & Comments mode)

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

REQUIRED: Reddit blocks server IPs. Enable Apify proxy to avoid blocks.

## Actor input object example

```json
{
  "mode": "subreddit",
  "subreddits": [
    "python"
  ],
  "searchQueries": [
    "machine learning"
  ],
  "usernames": [
    "spez"
  ],
  "postUrls": [],
  "sortBy": "hot",
  "maxItems": 100,
  "maxComments": 50,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `results` (type: `string`):

No description

# 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 = {
    "subreddits": [
        "python"
    ],
    "searchQueries": [
        "machine learning"
    ],
    "usernames": [
        "spez"
    ],
    "postUrls": []
};

// Run the Actor and wait for it to finish
const run = await client.actor("admo-solutions/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 = {
    "subreddits": ["python"],
    "searchQueries": ["machine learning"],
    "usernames": ["spez"],
    "postUrls": [],
}

# Run the Actor and wait for it to finish
run = client.actor("admo-solutions/reddit-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 '{
  "subreddits": [
    "python"
  ],
  "searchQueries": [
    "machine learning"
  ],
  "usernames": [
    "spez"
  ],
  "postUrls": []
}' |
apify call admo-solutions/reddit-scraper --silent --output-dataset

```

## MCP server setup

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