# Reddit Scraper — Posts, Comments, Search & Communities (`cocoa_kit/reddit-scraper`) Actor

Collect public Reddit posts, comments, subreddit details, and optional user profiles. Search by keyword or URL. Export JSON, CSV, or Excel.

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

## Pricing

from $2.00 / 1,000 result saveds

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/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## 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.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

### Reddit data for research, content, and market insights

Turn public Reddit discussions into a dataset you can use. **Reddit Scraper collects posts, comments, subreddit details, and optional public user profiles** from keywords or Reddit URLs. Export your results as JSON, CSV, or Excel, or connect the Actor to your existing workflow through the Apify API.

Use it to track product mentions, find common questions, compare community activity, and collect source material for research. Set a total result limit to keep each run within your scope.

### What can you collect?

- **Posts:** titles, text, links, dates, scores, comment counts, flair, and available image and video URLs.
- **Comments and replies:** text, dates, scores, post IDs, and parent IDs when Reddit provides them.
- **Communities:** descriptions, weekly visitor and contribution counts, and available public details.
- **Public profiles:** karma, account creation dates, and submitted posts. Enable **Include authors** to request profile data.
- **Keyword results:** search posts or communities, with sort and time controls.

Each row has a result type, a Reddit URL, a source URL, and a collection timestamp. Duplicate results are removed within a run.

### Start in three steps

1. Add one or more Reddit URLs, search keywords, or subreddit names.
2. Set **Total result limit**. Enable comments or community details if you need them.
3. Click **Start**. Open the **Results** output to view or export your data.

For a first run, try a subreddit with a limit of 20 posts:

```json
{
    "subreddits": ["Python"],
    "maxItems": 20,
    "maxPosts": 20
}
```

You do not need a Reddit login for public targets. Private, removed, restricted, or unavailable content cannot be guaranteed.

### Input examples

#### Search for product discussions

```json
{
    "searches": ["project management software", "team calendar"],
    "searchType": "posts",
    "sort": "new",
    "time": "month",
    "maxItems": 100,
    "maxPosts": 100
}
```

Each keyword starts a separate search. Result limits apply to the **whole run**, not to each keyword.

#### Collect posts and comments

```json
{
    "subreddits": ["learnpython"],
    "maxPosts": 5,
    "includeComments": true,
    "maxCommentsPerPost": 20,
    "maxComments": 100,
    "maxItems": 105
}
```

Comments count toward the total result limit. Increase `maxItems` if you want room for both posts and comments. You can also pass a post permalink in `startUrls` to collect a specific discussion.

#### Find communities

```json
{
    "searches": ["gardening"],
    "searchType": "communities",
    "maxCommunities": 20,
    "maxItems": 20
}
```

For details about known communities, use `subreddits` with `includeCommunity: true`. Set `maxPosts: 0` if you only need community details.

#### Collect a public profile

```json
{
    "usernames": ["reddit"],
    "includeAuthors": true,
    "includeUserPosts": true,
    "maxUsers": 1,
    "maxPosts": 10,
    "maxItems": 11
}
```

Author names and IDs are omitted by default. The **Include authors** option enables these fields and public profile collection. Post and comment text can still contain information that its author included in the public text.

### Input guide

| Setting              | Purpose                                                                   | Default      |
| -------------------- | ------------------------------------------------------------------------- | ------------ |
| `startUrls`          | Reddit post, subreddit, search, or user URLs                              | None         |
| `searches`           | Keywords to search                                                        | None         |
| `subreddits`         | Community names or URLs                                                   | None         |
| `usernames`          | Public usernames or profile URLs; requires `includeAuthors`               | None         |
| `searchType`         | `posts` or `communities`                                                  | `posts`      |
| `sort`               | `new`, `hot`, `top`, `relevance`, or `comments`                           | `new`        |
| `time`               | `all`, `hour`, `day`, `week`, `month`, or `year`                          | `all`        |
| `commentSort`        | `confidence`, `new`, `top`, `old`, or `controversial`                     | `confidence` |
| `maxItems`           | Total stored rows across all types                                        | `100`        |
| `maxPosts`           | Posts across all targets                                                  | `100`        |
| `maxComments`        | Comments across all targets                                               | `500`        |
| `maxCommentsPerPost` | Comments and replies per post                                             | `50`         |
| `maxCommunities`     | Community rows                                                            | `20`         |
| `maxUsers`           | Profile rows                                                              | `20`         |
| `includeComments`    | Collect comments for selected posts                                       | `false`      |
| `includeCommunity`   | Add details for subreddit targets                                         | `false`      |
| `includeUserPosts`   | Add submitted posts for profile targets                                   | `true`       |
| `includeAuthors`     | Include public usernames, author IDs, and requested profiles              | `false`      |
| `includeNSFW`        | Include results marked as adult content                                   | `false`      |
| `dateFrom`, `dateTo` | Filter post and comment creation dates                                    | No filter    |
| `minScore`           | Minimum score for posts and comments                                      | `0`          |
| `dataMode`           | `auto`, `html`, `json`, or `rss`                                          | `auto`       |
| `proxy`              | Apify or custom proxy configuration                                       | Residential  |
| `maxConcurrency`     | Requests in progress                                                      | `3`          |
| `requestDelayMillis` | Minimum delay between request starts                                      | `1000`       |
| `maxRequests`        | Maximum crawl jobs; post details, retries, and fallbacks can add requests | `1000`       |
| `maxRetries`         | Retries per failed job                                                    | `2`          |
| `requestTimeoutSecs` | Timeout for each network request                                          | `30`         |

Set a type limit to `0` to disable that result type. `maxItems` must be at least `1`. Date filters accept ISO 8601 timestamps. A date without a time means midnight UTC, including for `dateTo`.

**Relevance** and **Comments** sort apply to search results. Subreddit lists use **New** for these choices. Time filters apply where Reddit supports them, such as search and Top lists. For a user's comment history, add `https://www.reddit.com/user/USERNAME/comments/` to `startUrls` and enable `includeAuthors`.

### Output

Results appear as separate rows. Use `dataType` to distinguish `post`, `comment`, `community`, and `user`.

A post row has this shape. The values below are illustrative:

```json
{
    "id": "t3_example",
    "parsedId": "example",
    "dataType": "post",
    "title": "Which Python tools do you use?",
    "body": "Share the tools that help with your projects.",
    "communityName": "r/Python",
    "url": "https://www.reddit.com/r/Python/comments/example/",
    "sourceUrl": "https://www.reddit.com/r/Python/new",
    "createdAt": "2026-10-01T12:00:00.000Z",
    "scrapedAt": "2026-10-08T01:00:00.000Z",
    "score": 42,
    "numberOfComments": 12,
    "upVoteRatio": 0.95,
    "over18": false,
    "dataSource": "html",
    "isPartial": true,
    "imageUrls": [],
    "videoUrls": []
}
```

Additional post fields include `flair`, `isVideo`, `isSelf`, `isLocked`, `isPinned`, `isSpoiler`, `isArchived`, `outboundUrl`, and `domain`.

Comment rows include `postId`, `parentId`, `depth`, `isSubmitter`, `isPinned`, and `isEdited`. Community rows include `title`, `description`, `weeklyVisitors`, `weeklyContributions`, and `iconUrl`. Legacy JSON results can also include `numberOfMembers`, `activeUsers`, and `communityType`. Profile rows include `username`, `postKarma`, `commentKarma`, `totalKarma`, `description`, `iconUrl`, and `isVerified`. Author-enabled rows can also contain `username` and `userId`.

Unavailable fields are `null` or omitted. A missing score is never reported as zero. Media fields contain links; the Actor does not download media files.

The **Run summary** output contains result counts, request counts, warnings, failed targets, and the reason a configured limit stopped the run.

### Data sources and available fields

**Auto mode** reads Reddit's public web pages. It collects available post text, scores, comment counts, media links, and nested replies. If access to a post or listing is restricted, it can use the public RSS feed. **Web pages only** (`html`) reports an access failure instead of using RSS.

Web results have `dataSource: "html"` and `isPartial: true`. Reddit does not show every field on every page. For example, community member counts and exact creation times can be absent. Weekly visitors and weekly contributions are separate fields, not member counts. The Actor leaves unavailable values as `null` or omits them.

**RSS mode** requests feeds directly. RSS rows have `dataSource: "rss"` and `isPartial: true`. They do not provide scores, reliable adult-content flags, complete media, or complete comment trees. User comment history uses RSS in Auto mode. RSS pagination can stop before your requested limit. Community and profile details need Auto or Web pages mode.

**JSON mode** is a legacy option. Reddit can block anonymous JSON access. Use Auto mode for normal collection.

The adult-content filter excludes results that Reddit marks as adult content. It cannot infer a flag that the source does not provide. A `minScore` above zero excludes results with unknown scores, including RSS rows.

### Pricing

**$2.00 per 1,000 saved results, plus a start fee of $0.01 per GB of run memory (one-GB minimum).** Each stored post, comment, community, or profile counts as one result. Standard platform usage and the default proxy are included in this price.

At the default 512 MB memory setting, a run that saves 100 results costs $0.21. A run that saves 1,000 results costs $2.01. Duplicate rows are not stored or charged again within the same run. Failed requests are not result events; the start fee still applies.

Use the total result limit and Apify's maximum cost per run to control spending. Check the **Pricing** tab for the current rate. Separate services you choose to connect, including your own proxy provider, can have their own charges.

### Automate your workflow

Run the Actor on demand, through the Apify API, or on a schedule. Export the dataset to a spreadsheet or connect it to Make, Zapier, or n8n. Use webhooks to start the next step when a run finishes.

The input is the same JSON object whether you use the Console or the API. The dataset API provides machine-readable results for your application.

### Frequently asked questions

#### Why did I receive fewer results than requested?

Limits are maximums, not guaranteed counts. Reddit can return fewer matches, stop pagination, or restrict a target. Filters can remove results. Individual Reddit listings often expose only a limited history. Use more specific keywords, multiple communities, or scheduled collection for broader coverage.

#### Does the Actor collect every comment?

It collects the available comment tree and expands additional comments through Reddit's public endpoints, within your limits. Deleted, restricted, or unavailable comments cannot be recovered. RSS returns a limited set of comments with fewer fields.

#### What if a run fails?

Open **Run summary** to find failed targets. Results already saved remain available. Check the target in Reddit, reduce concurrency, or retry with a suitable proxy. A failed request causes a failed run status so your workflow can detect incomplete collection.

#### Can I collect private or deleted content?

No. The Actor works with public content available at the time of the run. Use the data in accordance with Reddit's terms and the permissions that apply to your use.

#### How can I get support?

Open an issue on this Actor's **Issues** tab. Include the run URL and a short description of the expected result. Do not include credentials.

# Actor input Schema

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

Enter subreddit, post, search, or public user URLs. User URLs require Include authors.

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

Each keyword starts a separate Reddit search.

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

Enter community names or URLs.

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

Enter usernames or profile URLs. Requires Include authors.

## `searchType` (type: `string`):

Choose posts or communities for keyword searches.

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

Select the result order. Relevance and Comments apply to search; subreddit lists use New for those choices.

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

Applies to keyword search and Top or Controversial lists.

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

Choose the order for comments in a post.

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

Maximum dataset rows across all result types and targets.

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

Maximum results of this type for the entire run. Zero disables this type.

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

Maximum results of this type for the entire run. Zero disables this type.

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

Maximum results of this type for the entire run. Zero disables this type.

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

Maximum results of this type for the entire run. Zero disables this type.

## `maxCommentsPerPost` (type: `integer`):

Maximum stored comments for each post. Includes replies.

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

Collect comments and available replies for each selected post.

## `includeCommunity` (type: `boolean`):

Add community details for subreddit targets.

## `includeUserPosts` (type: `boolean`):

Add submitted posts for profile targets.

## `includeAuthors` (type: `boolean`):

Explicitly enable public usernames, author IDs, and requested profile data.

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

Include results marked as adult content. Unknown flags remain null and do not prove that a result is safe for work.

## `dateFrom` (type: `string`):

Optional ISO 8601 date or timestamp. Applies to posts and comments. Dates without a time mean midnight UTC.

## `dateTo` (type: `string`):

Optional ISO 8601 date or timestamp. Applies to posts and comments. Dates without a time mean midnight UTC.

## `minScore` (type: `integer`):

Exclude posts and comments below this score. A value above zero also excludes RSS rows because their scores are unavailable.

## `dataMode` (type: `string`):

Auto reads public web pages and can use RSS when a post or listing is restricted. Web pages include scores and comments. JSON is a legacy option and can be blocked. RSS has partial fields.

## `proxy` (type: `object`):

Residential proxies are recommended for Reddit. You can use your own proxy URLs.

## `maxConcurrency` (type: `integer`):

Maximum requests in progress at one time.

## `requestDelayMillis` (type: `integer`):

Minimum delay between all request starts.

## `maxRequests` (type: `integer`):

Maximum crawl jobs. A search job can read several post pages. Retries and fallback requests are additional network requests.

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

Retry failed requests up to this many times.

## `requestTimeoutSecs` (type: `integer`):

Maximum time for each network request.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www.reddit.com/r/Python/"
    }
  ],
  "searches": [
    "python"
  ],
  "subreddits": [
    "Python"
  ],
  "usernames": [
    "reddit"
  ],
  "searchType": "posts",
  "sort": "new",
  "time": "all",
  "commentSort": "confidence",
  "maxItems": 100,
  "maxPosts": 100,
  "maxComments": 500,
  "maxCommunities": 20,
  "maxUsers": 20,
  "maxCommentsPerPost": 50,
  "includeComments": false,
  "includeCommunity": false,
  "includeUserPosts": true,
  "includeAuthors": false,
  "includeNSFW": false,
  "dateFrom": "2026-01-01T00:00:00Z",
  "dateTo": "2026-01-01T00:00:00Z",
  "minScore": 0,
  "dataMode": "auto",
  "proxy": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  },
  "maxConcurrency": 3,
  "requestDelayMillis": 1000,
  "maxRequests": 1000,
  "maxRetries": 2,
  "requestTimeoutSecs": 30
}
```

# Actor output Schema

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

No description

## `summary` (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 = {
    "startUrls": [
        {
            "url": "https://www.reddit.com/r/Python/"
        }
    ],
    "searches": [
        "python"
    ],
    "subreddits": [
        "Python"
    ],
    "usernames": [
        "reddit"
    ],
    "dateFrom": "2026-01-01T00:00:00Z",
    "dateTo": "2026-01-01T00:00:00Z"
};

// Run the Actor and wait for it to finish
const run = await client.actor("cocoa_kit/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": [{ "url": "https://www.reddit.com/r/Python/" }],
    "searches": ["python"],
    "subreddits": ["Python"],
    "usernames": ["reddit"],
    "dateFrom": "2026-01-01T00:00:00Z",
    "dateTo": "2026-01-01T00:00:00Z",
}

# Run the Actor and wait for it to finish
run = client.actor("cocoa_kit/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": [
    {
      "url": "https://www.reddit.com/r/Python/"
    }
  ],
  "searches": [
    "python"
  ],
  "subreddits": [
    "Python"
  ],
  "usernames": [
    "reddit"
  ],
  "dateFrom": "2026-01-01T00:00:00Z",
  "dateTo": "2026-01-01T00:00:00Z"
}' |
apify call cocoa_kit/reddit-scraper --silent --output-dataset

```

## MCP server setup

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