# Reddit Scraper (`scrapingdino/reddit-scraper`) Actor

Crawl Reddit posts, comments, communities, and user profiles without requiring login. Pay only for the results you get, limit scraping by posts or items, and export complete datasets in multiple formats for easy analysis or integration.

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

## Pricing

from $0.70 / 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.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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 | Extract Posts, Comments, Users & Communities

Collect Reddit posts, comments, user profiles, and communities in clean, structured JSON — ready for analysis, monitoring, and automation on Apify.

Paste a URL or enter a search keyword. Get consistent fields, media links, optional nested comment threads, and separate Output tabs for each data type.

- **Scrape Reddit posts** from subreddits, users, popular feeds, and search
- **Scrape comments** as flat rows or nested trees on each post
- **Scrape communities** with subscribers, descriptions, and metadata
- **Scrape user profiles** with karma and account details
- **Search Reddit** for posts, users, and communities
- **Extract images & videos** into `imageUrls`, `videoUrls`, and `mediaType`
- **Export clean structured JSON** built for Apify workflows and downstream tools

***

### Features

| Capability | Included |
|---|:---:|
| Posts | ✓ |
| Comments | ✓ |
| User profiles | ✓ |
| Communities | ✓ |
| Keyword search | ✓ |
| Media extraction | ✓ |
| Threaded comments (`tree` mode) | ✓ |
| NSFW filtering | ✓ |
| Date filtering | ✓ |
| Multiple sort orders | ✓ |
| Pagination & result caps | ✓ |
| Structured JSON output | ✓ |
| Apify dataset tabs (Posts / Comments / Users / Communities) | ✓ |
| Compatible with Apify Actors, Tasks, and Schedules | ✓ |

***

### Supported inputs

#### Subreddit

```
https://www.reddit.com/r/AskReddit/
https://www.reddit.com/r/python/new/
https://www.reddit.com/r/technology/top/?t=week
```

#### User

```
https://www.reddit.com/user/spez/
https://www.reddit.com/user/spez/submitted/
https://www.reddit.com/user/spez/comments/
```

#### Post

```
https://www.reddit.com/r/AskReddit/comments/ablzuq/people_who_havent_pooped_in_2019_yet_why_are_you/
```

#### Popular & communities

```
https://www.reddit.com/r/popular/
https://www.reddit.com/r/popular/rising/
https://www.reddit.com/r/subreddits/
```

#### Search URL

```
https://www.reddit.com/search/?q=electric%20vehicles
```

You can also run **keyword search** without a URL via the `searches` input.

When `startUrls` are set, search keywords are ignored unless `ignoreStartUrls` is enabled.

***

### Search support

| Mode | Input flag | What you get |
|---|---|---|
| Posts | `searchPosts` | Matching posts |
| Users | `searchUsers` | Matching profiles |
| Communities | `searchCommunities` | Matching subreddits |

Combine flags in one run. Sort and time filters apply where Reddit supports them.

***

### Input options

| Parameter | Type | Default | Description |
|---|---|---|---|
| `startUrls` | string\[] | — | Reddit URLs to scrape (subreddit, user, post, popular, search). |
| `searches` | string\[] | — | Keywords to search. Used when no start URLs are set, or when `ignoreStartUrls` is true. |
| `searchPosts` | boolean | `true` | Include post results when searching. |
| `searchUsers` | boolean | `false` | Include user results when searching. |
| `searchCommunities` | boolean | `false` | Include community results when searching. |
| `includeComments` | boolean | `true` | Fetch comments for posts. |
| `includeMediaLinks` | boolean | `true` | Export `imageUrls`, `videoUrls`, and `mediaType` on posts. |
| `commentOutput` | string | `flat` | `flat` = one dataset row per comment. `tree` = nest comments under each post. |
| `outputCompatibility` | string | `apify` | `apify` = lean Store-friendly fields. `extended` = richer metadata. |
| `includeUserInfo` | boolean | `true` | Fetch profile details for user URLs. |
| `includeCommunityInfo` | boolean | `true` | Fetch community metadata for subreddit URLs. |
| `includeNSFW` | boolean | `true` | Keep NSFW items. Set `false` to exclude them. |
| `sort` | string | `new` | `relevance`, `hot`, `top`, `new`, `rising`, or `comments`. |
| `time` | string | `all` | Time window for top/controversial: `hour`, `day`, `week`, `month`, `year`, `all`. |
| `maxItems` | integer | `100` | Hard cap on all exported items combined. |
| `maxPosts` | integer | `50` | Max posts per source (subreddit, user, search, popular). |
| `maxComments` | integer | `50` | Max comments per post (`0` skips comments). |
| `maxUsers` | integer | `10` | Max users per search keyword. |
| `maxCommunities` | integer | `10` | Max communities per search or community listing. |
| `postDateLimit` | string | — | Keep posts on/after this date (`YYYY-MM-DD`). |
| `commentDateLimit` | string | — | Keep comments on/after this date (`YYYY-MM-DD`). |
| `ignoreStartUrls` | boolean | `false` | Process only `searches`, ignore `startUrls`. |

***

### Output

Results land in separate Output tabs:

| Tab | Contents |
|---|---|
| **Posts** | Posts only |
| **Comments** | Comments only (flat mode) |
| **Users** | Profiles only |
| **Communities** | Subreddits only |
| **All Fields** | Everything in one combined dataset |

Every record includes `dataType`: `post`, `comment`, `user`, or `community`.

#### Post

```json
{
  "dataType": "post",
  "id": "ablzuq",
  "parsedId": "ablzuq",
  "title": "People who haven't pooped in 2019 yet, why are you still holding on to last years shit?",
  "username": "ShoddySubstance",
  "communityName": "r/AskReddit",
  "parsedCommunityName": "AskReddit",
  "upVotes": 221992,
  "upVoteRatio": 0.91,
  "numberOfComments": 7898,
  "over18": false,
  "isVideo": false,
  "mediaType": "text",
  "imageUrls": [],
  "videoUrls": [],
  "createdAt": "2019-01-01T21:06:27.000Z",
  "url": "https://www.reddit.com/r/AskReddit/comments/ablzuq/people_who_havent_pooped_in_2019_yet_why_are_you/"
}
```

#### Comment

```json
{
  "dataType": "comment",
  "id": "ed1ap8n",
  "parsedId": "ed1ap8n",
  "body": "It's all I have",
  "username": "example_user",
  "communityName": "r/AskReddit",
  "parentId": "t3_ablzuq",
  "depth": 0,
  "upVotes": 46487,
  "createdAt": "2019-01-01T21:07:31.000Z",
  "url": "https://www.reddit.com/r/AskReddit/comments/ablzuq/.../ed1ap8n/"
}
```

#### User

```json
{
  "dataType": "user",
  "id": "1w72",
  "username": "spez",
  "karma": 940838,
  "linkKarma": 184381,
  "commentKarma": 756457,
  "createdAt": "2005-06-06T04:00:00.000Z",
  "url": "https://www.reddit.com/user/spez/"
}
```

#### Community

```json
{
  "dataType": "community",
  "id": "2qh1i",
  "displayName": "AskReddit",
  "communityName": "r/AskReddit",
  "parsedCommunityName": "AskReddit",
  "title": "Ask Reddit...",
  "subscribers": 59336494,
  "over18": false,
  "createdAt": "2008-01-25T03:52:15.000Z",
  "url": "https://www.reddit.com/r/AskReddit/"
}
```

***

### Media extraction

Set `includeMediaLinks: true` (default) to export media fields on posts.

| Field | Meaning |
|---|---|
| `imageUrls` | Direct image URLs (including gallery images when available) |
| `videoUrls` | Direct video URLs when Reddit exposes them |
| `mediaType` | High-level type such as `image`, `video`, `gallery`, `text`, or `link` |

The actor detects galleries, hosted video, and common link thumbnails. When `includeMediaLinks` is `false`, those export fields are omitted for a leaner dataset.

***

### Comment modes

#### Flat (default)

Each comment is its own dataset row — ideal for tables, CSV, and pipelines.

```json
{ "dataType": "comment", "id": "abc", "parentId": "t3_post", "depth": 0, "body": "…" }
{ "dataType": "comment", "id": "def", "parentId": "t1_abc", "depth": 1, "body": "…" }
```

#### Tree

Comments attach to each post as a nested `comments` array with `replies`. Scraping behavior is unchanged — only the export shape changes.

```json
{
  "dataType": "post",
  "id": "ablzuq",
  "title": "…",
  "comments": [
    {
      "id": "abc",
      "parentId": "t3_ablzuq",
      "depth": 0,
      "body": "Top-level reply",
      "replies": [
        { "id": "def", "parentId": "t1_abc", "depth": 1, "body": "Nested reply", "replies": [] }
      ]
    }
  ]
}
```

Use `tree` only when `includeComments` is true.

***

### Filtering

| Option | Behavior |
|---|---|
| `includeNSFW` | `false` drops items flagged `over18`. |
| `postDateLimit` | Keeps posts created on or after `YYYY-MM-DD`. |
| `commentDateLimit` | Keeps comments created on or after `YYYY-MM-DD`. |

Combine with `maxPosts`, `maxComments`, and `maxItems` to control cost and run time.

***

### Performance

- Uses optimized backend APIs instead of full browser crawling
- Paginates listings until your limits are reached, then stops
- Skips unnecessary follow-up requests when caps or filters are hit
- Suited to both small sample runs and larger monitoring jobs

Throughput depends on Reddit availability, selected limits, and whether comments/media are enabled.

***

### Perfect for

- **Market research** — Track topics, questions, and engagement across communities
- **Brand monitoring** — Watch mentions, threads, and sentiment signals
- **Sentiment analysis** — Build labeled post and comment corpora
- **Lead generation** — Find active users and niche communities
- **Academic research** — Collect structured public Reddit data at scale
- **Content discovery** — Surface trending posts and discussions
- **AI training** — Export clean text and media metadata for models
- **Competitive intelligence** — Compare presence across subreddits and creators

***

### Limitations

- Keyword search for **comments** is not supported
- Keyword search for **media-only** results is not supported
- Private or restricted communities return only what Reddit makes publicly available
- Deleted or suspended accounts may return partial or empty profiles
- Very large comment threads are bounded by `maxComments` and `maxItems`

***

### FAQ

**Can I scrape NSFW content?**\
Yes. Keep `includeNSFW: true`, or set it to `false` to exclude NSFW items.

**Can I scrape multiple URLs in one run?**\
Yes. Add as many URLs as you need to `startUrls`.

**Can I scrape a single post and its comments?**\
Yes. Paste the post URL, keep `includeComments: true`, and set `maxComments` as needed.

**Can I scrape user profiles?**\
Yes. Use a `/user/…` URL or enable `searchUsers` with keywords.

**Can I scrape communities / subreddits?**\
Yes. Use a `/r/…` URL or enable `searchCommunities`.

**Does it support media?**\
Yes. With `includeMediaLinks: true`, posts include `imageUrls`, `videoUrls`, and `mediaType`.

**Can I export nested comment threads?**\
Yes. Set `commentOutput: "tree"`.

**Can I export flat comments for CSV?**\
Yes. That is the default (`commentOutput: "flat"`).

**How many posts can I collect?**\
As many as your limits allow. Use `maxPosts` per source and `maxItems` as a global cap.

**Can I filter by date?**\
Yes. Use `postDateLimit` and `commentDateLimit` (`YYYY-MM-DD`).

**Can I sort by hot, top, or new?**\
Yes. Use `sort` and, for top/controversial windows, `time`.

**Can I export JSON?**\
Yes. Download any Output tab or the combined **All Fields** dataset as JSON, CSV, Excel, and more.

**What if a user is deleted?**\
You may get partial fields or empty profile data. The run continues.

**Can I scrape private communities?**\
Only public data Reddit exposes. Private communities are not accessible.

**Do start URLs override search?**\
Yes. When `startUrls` are present, `searches` are ignored unless `ignoreStartUrls` is true.

**Where do communities appear in the Output tab?**\
In the **Communities** tab — not under Posts.

***

### Why this actor?

Choose this scraper when you want Reddit data that is ready to use without cleanup gymnastics.

- **Clean, consistent fields** — `username`, `communityName`, `upVoteRatio`, `createdAt`, and clear `dataType` tags
- **Rich metadata** — scores, flair, NSFW flags, permalinks, and community stats
- **Media that ships** — image, video, and gallery URLs when you need them
- **Comments your way** — flat rows for analytics, or trees for thread structure
- **Separate Output tabs** — Posts, Comments, Users, and Communities stay cleanly separated
- **Built for Apify** — schedules, tasks, webhooks, and dataset exports work out of the box
- **Production-minded controls** — limits, date filters, NSFW filters, and search modes that scale with you

Paste a URL. Hit Start. Get structured Reddit data.

# Actor input Schema

## `startUrls` (type: `array`):

Full Reddit URLs: subreddits, users, posts, search results, or popular feeds. When provided, search parameters are ignored unless ignoreStartUrls is true.

## `searches` (type: `array`):

Keywords to search on Reddit. Used when startUrls is empty or ignoreStartUrls is true.

## `searchPosts` (type: `boolean`):

When using searches, include post results.

## `searchUsers` (type: `boolean`):

When using searches, include user results.

## `searchCommunities` (type: `boolean`):

When using searches, include subreddit/community results.

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

Fetch comments for scraped posts.

## `includeMediaLinks` (type: `boolean`):

When enabled, exported posts include imageUrls, videoUrls, mediaType, and upVoteRatio. Media is always processed internally; this only controls dataset export.

## `outputCompatibility` (type: `string`):

apify: lean dataset aligned with trudax/reddit-scraper field names. extended: richer internal fields (source, createdAtUtc, authorFlairDetail).

## `commentOutput` (type: `string`):

flat: export each comment as its own dataset row. tree: attach nested comment trees to posts (scraping behavior unchanged).

## `includeUserInfo` (type: `boolean`):

When scraping user URLs, fetch profile metadata.

## `includeCommunityInfo` (type: `boolean`):

When scraping subreddit URLs, fetch community metadata (title, subscribers, etc.).

## `includeNSFW` (type: `boolean`):

When false, items with over18=true are excluded from the dataset.

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

Sort for search and some listings: relevance, hot, top, new, rising, or comments (post search).

## `time` (type: `string`):

Time window for top/controversial listings and search when sort is top.

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

Hard cap on all dataset items combined (posts, comments, users, communities).

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

Max posts per subreddit, user, search query, or popular feed.

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

Max comments fetched for each post when includeComments is true. Set to 0 to skip comments.

## `maxUsers` (type: `integer`):

Max user results per search keyword.

## `maxCommunities` (type: `integer`):

Max community results per search keyword or community listing.

## `postDateLimit` (type: `string`):

Only keep posts created on or after this ISO date (e.g. 2024-01-01). Forces chronological filtering on created\_utc.

## `commentDateLimit` (type: `string`):

Only keep comments created on or after this ISO date (e.g. 2024-01-01).

## `ignoreStartUrls` (type: `boolean`):

If true, only searches are processed (ignores startUrls).

## Actor input object example

```json
{
  "startUrls": [
    "https://www.reddit.com/r/AskReddit/",
    "https://www.reddit.com/r/AskReddit/comments/ablzuq/people_who_havent_pooped_in_2019_yet_why_are_you/"
  ],
  "searches": [
    "python"
  ],
  "searchPosts": true,
  "searchUsers": false,
  "searchCommunities": false,
  "includeComments": true,
  "includeMediaLinks": true,
  "outputCompatibility": "apify",
  "commentOutput": "flat",
  "includeUserInfo": true,
  "includeCommunityInfo": true,
  "includeNSFW": true,
  "sort": "new",
  "time": "all",
  "maxItems": 100,
  "maxPosts": 50,
  "maxComments": 50,
  "maxUsers": 10,
  "maxCommunities": 10,
  "ignoreStartUrls": false
}
```

# Actor output Schema

## `posts` (type: `string`):

Post rows only.

## `comments` (type: `string`):

Comment rows only (flat mode).

## `users` (type: `string`):

User profile rows only.

## `communities` (type: `string`):

Subreddit / community rows only.

## `dataset` (type: `string`):

Every scraped row in one dataset.

# 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 = {
    "startUrls": [
        "https://www.reddit.com/r/AskReddit/",
        "https://www.reddit.com/r/AskReddit/comments/ablzuq/people_who_havent_pooped_in_2019_yet_why_are_you/"
    ],
    "searches": [
        "python"
    ],
    "searchPosts": true,
    "searchUsers": false,
    "searchCommunities": false,
    "includeComments": true,
    "includeMediaLinks": true,
    "outputCompatibility": "apify",
    "commentOutput": "flat",
    "includeUserInfo": true,
    "includeCommunityInfo": true,
    "includeNSFW": true,
    "sort": "new",
    "time": "all",
    "maxItems": 100,
    "maxPosts": 50,
    "maxComments": 50,
    "maxUsers": 10,
    "maxCommunities": 10,
    "ignoreStartUrls": false
};

// Run the Actor and wait for it to finish
const run = await client.actor("scrapingdino/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 = {
    "startUrls": [
        "https://www.reddit.com/r/AskReddit/",
        "https://www.reddit.com/r/AskReddit/comments/ablzuq/people_who_havent_pooped_in_2019_yet_why_are_you/",
    ],
    "searches": ["python"],
    "searchPosts": True,
    "searchUsers": False,
    "searchCommunities": False,
    "includeComments": True,
    "includeMediaLinks": True,
    "outputCompatibility": "apify",
    "commentOutput": "flat",
    "includeUserInfo": True,
    "includeCommunityInfo": True,
    "includeNSFW": True,
    "sort": "new",
    "time": "all",
    "maxItems": 100,
    "maxPosts": 50,
    "maxComments": 50,
    "maxUsers": 10,
    "maxCommunities": 10,
    "ignoreStartUrls": False,
}

# Run the Actor and wait for it to finish
run = client.actor("scrapingdino/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 '{
  "startUrls": [
    "https://www.reddit.com/r/AskReddit/",
    "https://www.reddit.com/r/AskReddit/comments/ablzuq/people_who_havent_pooped_in_2019_yet_why_are_you/"
  ],
  "searches": [
    "python"
  ],
  "searchPosts": true,
  "searchUsers": false,
  "searchCommunities": false,
  "includeComments": true,
  "includeMediaLinks": true,
  "outputCompatibility": "apify",
  "commentOutput": "flat",
  "includeUserInfo": true,
  "includeCommunityInfo": true,
  "includeNSFW": true,
  "sort": "new",
  "time": "all",
  "maxItems": 100,
  "maxPosts": 50,
  "maxComments": 50,
  "maxUsers": 10,
  "maxCommunities": 10,
  "ignoreStartUrls": false
}' |
apify call scrapingdino/reddit-scraper --silent --output-dataset

```

## MCP server setup

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