# Best Reddit Scrpaer (`scoutlayer/reddit-scraper`) Actor

A powerful Apify Actor designed to extract comprehensive data from Reddit. This scraper can fetch subreddit feeds, collect posts with full comment trees, run keyword searches, and extract user profiles, making it perfect for social listening and market research.

- **URL**: https://apify.com/scoutlayer/reddit-scraper.md
- **Developed by:** [Scoutlayer](https://apify.com/scoutlayer) (community)
- **Categories:** Social media
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $1.99 / 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

Get subreddit feeds, posts, full comment trees, search results, and user profiles from Reddit. This actor is powered live by the [ScoutLayer](https://scoutlayer.io) API, so there's nothing to configure and no ScoutLayer account needed — just run it.

### Features

- **Subreddit Feed**: Hot/new/top/rising listing for a subreddit, paginated
- **Post**: Title, body, score, author, and metadata for one post
- **Post + Comments**: A post plus its full comment tree, flattened with depth/parentId
- **Search**: Search all of Reddit or one subreddit, paginated
- **User Profile**: Karma, account age, and badges for a public user

### Input

#### Scrape Type

Select the type of data to fetch using the `scrapeType` field:

| Value       | Description                               |
| ----------- | ----------------------------------------- |
| `subreddit` | Fetch a subreddit's post feed             |
| `post`      | Fetch one post                            |
| `comments`  | Fetch one post with its full comment tree |
| `search`    | Search Reddit (or one subreddit)          |
| `user`      | Fetch a public user profile               |

#### All Input Fields

| Field               | Type    | Required for | Default     | Description                                                                                |
| ------------------- | ------- | ------------ | ----------- | ------------------------------------------------------------------------------------------ |
| `scrapeType`        | string  | Always       | `subreddit` | Scrape type (see table above)                                                              |
| `subreddits`        | array   | `subreddit`  | —           | Subreddit names or full URLs, e.g. `["programming"]`                                       |
| `subredditSort`     | string  | —            | `hot`       | `hot`, `new`, `top`, or `rising`                                                           |
| `maxSubredditPages` | integer | —            | —           | Max pages per subreddit. Falls back to `maxPages` if not set                               |
| `postIds`           | array   | `post`       | —           | Post IDs or full permalink URLs                                                            |
| `commentPostIds`    | array   | `comments`   | —           | Post IDs or full permalink URLs to fetch with comments                                     |
| `searchQueries`     | array   | `search`     | —           | Search queries, e.g. `["typescript"]`                                                      |
| `searchSubreddit`   | string  | —            | —           | Scope search to one subreddit instead of all of Reddit                                     |
| `searchSort`        | string  | —            | `relevance` | `relevance`, `new`, `top`, or `comments`                                                   |
| `maxSearchPages`    | integer | —            | —           | Max result pages per query. Falls back to `maxPages` if not set                            |
| `usernames`         | array   | `user`       | —           | Usernames or full profile URLs                                                             |
| `maxPages`          | integer | —            | `3`         | Global fallback max pages for `subreddit`/`search` when the type-specific limit is not set |

### Output

Results are stored in the **dataset** under the key `results`. The shape varies by scrape type.

#### Subreddit Feed / Search

Each result is one post, with `page` (added by the actor) indicating which page it appeared on.

```json
{
  "subreddit": "programming",
  "subredditId": "t5_2fwo",
  "postId": "abc123",
  "title": "Show HN: my new project",
  "author": "someuser",
  "score": 1200,
  "upvoteRatio": 0.95,
  "numComments": 340,
  "url": "https://example.com/article",
  "selftext": "",
  "isSelf": false,
  "isVideo": false,
  "isStickied": false,
  "thumbnail": "https://b.thumbs.redditmedia.com/....jpg",
  "createdAt": "2026-08-10T00:00:00Z",
  "permalink": "https://www.reddit.com/r/programming/comments/abc123/show_hn/",
  "flair": null,
  "domain": "example.com",
  "page": 1
}
```

#### Post

Same shape as a Subreddit Feed item above, without `page`.

#### Post + Comments

```json
{
  "post": { "...": "same shape as Post above" },
  "comments": [
    {
      "postId": "abc123",
      "commentId": "def456",
      "parentId": "t3_abc123",
      "author": "commenter1",
      "body": "Great write-up!",
      "score": 42,
      "depth": 0,
      "createdAt": "2026-08-10T01:00:00Z",
      "permalink": "https://www.reddit.com/r/programming/comments/abc123/show_hn/def456/",
      "isStickied": false
    }
  ]
}
```

#### User Profile

```json
{
  "username": "spez",
  "userId": "1w72",
  "linkKarma": 150000,
  "commentKarma": 800000,
  "totalKarma": 950000,
  "createdAt": "2005-06-06T00:00:00Z",
  "isGold": true,
  "isMod": true,
  "iconImg": "https://styles.redditmedia.com/....png",
  "verified": true
}
```

### Usage Examples

#### Fetch a subreddit's hot posts

```json
{
  "scrapeType": "subreddit",
  "subreddits": ["programming", "typescript"],
  "subredditSort": "hot",
  "maxSubredditPages": 2
}
```

#### Fetch a post with its comments

```json
{
  "scrapeType": "comments",
  "commentPostIds": ["abc123"]
}
```

#### Search one subreddit

```json
{
  "scrapeType": "search",
  "searchQueries": ["typescript"],
  "searchSubreddit": "programming",
  "searchSort": "top"
}
```

***

Need this data outside of Apify, or coverage beyond Reddit? [ScoutLayer](https://scoutlayer.io) offers a direct REST/MCP API across many platforms — see the [docs](https://docs.scoutlayer.io) for details.

# Actor input Schema

## `scrapeType` (type: `string`):

Select what type of data to fetch from Reddit.

## `maxPages` (type: `integer`):

Global fallback for max pages across paginated types (Subreddit Feed, Search) when no type-specific limit is set.

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

Subreddit names or full URLs (e.g. "programming" or "https://reddit.com/r/programming"). Required for Scrape Type: Subreddit Feed.

## `subredditSort` (type: `string`):

Sort order for Subreddit Feed.

## `maxSubredditPages` (type: `integer`):

Maximum number of pages to fetch per subreddit. Falls back to "Max Pages (Global Default)" if not set.

## `postIds` (type: `array`):

Reddit post IDs or full permalink URLs (e.g. "abc123" or "https://reddit.com/r/programming/comments/abc123/title"). Required for Scrape Type: Post.

## `commentPostIds` (type: `array`):

Reddit post IDs or full permalink URLs to fetch with their full comment tree. Required for Scrape Type: Post + Comments.

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

Search queries to run, e.g. "typescript". Required for Scrape Type: Search.

## `searchSubreddit` (type: `string`):

Scope Search to a single subreddit instead of all of Reddit.

## `searchSort` (type: `string`):

Sort order for Search.

## `maxSearchPages` (type: `integer`):

Maximum number of result pages to fetch per query. Falls back to "Max Pages (Global Default)" if not set.

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

Reddit usernames or full profile URLs (e.g. "spez" or "https://reddit.com/u/spez"). Required for Scrape Type: User Profile.

## Actor input object example

```json
{
  "scrapeType": "subreddit",
  "maxPages": 3,
  "subreddits": [
    "programming"
  ],
  "subredditSort": "hot",
  "searchQueries": [
    "typescript"
  ],
  "searchSort": "relevance"
}
```

# Actor output Schema

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

URL of the dataset with the results

## `crawlStats` (type: `string`):

Statistics about the crawl process

# 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": [
        "programming"
    ],
    "searchQueries": [
        "typescript"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("scoutlayer/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": ["programming"],
    "searchQueries": ["typescript"],
}

# Run the Actor and wait for it to finish
run = client.actor("scoutlayer/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": [
    "programming"
  ],
  "searchQueries": [
    "typescript"
  ]
}' |
apify call scoutlayer/reddit-scraper --silent --output-dataset

```

## MCP server setup

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