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

Scrape Reddit posts, comments, and subreddit details from subreddits, post threads, user profiles, and searches.

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

## Pricing

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

![banner](https://anyx.solutions/banners/reddit-scraper.png)

## Reddit Scraper

**Pull Reddit posts, comment threads, user activity, and search results into a clean dataset — no API key, no login.**

Scrape Reddit posts, comments, and subreddit details from subreddits, post threads, user profiles, and searches. Point it at a subreddit to get the community's stats and its hot, new, top, or rising posts; at a single post to capture it with its comment tree; at a user profile to collect what they posted or commented; or at a search to gather every post matching a keyword across Reddit or inside one community. Built for social-listening teams, market and sentiment researchers, community managers, and anyone who needs Reddit data without wiring up the official API.

### ⚡ Quick start

```json
{
  "startUrls": [
    { "url": "https://www.reddit.com/r/wallstreetbets/" },
    { "url": "https://www.reddit.com/r/wallstreetbets/comments/1vy502t/" }
  ],
  "searchQueries": ["nvidia earnings"],
  "maxItems": 5,
  "maxComments": 5
}
```

### 🧩 Input

| Field                | Type    | Required | Default                                                          | Description                                                                                                                                                                                                                                                                                                        |
| -------------------- | ------- | -------- | ---------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `startUrls`          | array   | yes      | —                                                                | Reddit URLs to scrape. Subreddits (`https://www.reddit.com/r/wallstreetbets/`), posts (`https://www.reddit.com/r/wallstreetbets/comments/1vy502t/`), user profiles (`https://www.reddit.com/user/wsbapp/` or `/user/wsbapp/comments/`) and search pages (`https://www.reddit.com/search/?q=nvidia`) are supported. |
| `searchQueries`      | array   | no       | —                                                                | Search terms to look up across all of Reddit, for example `"nvidia earnings"`. Each query returns matching posts.                                                                                                                                                                                                  |
| `sort`               | string  | no       | `"hot"`                                                          | Order of posts in subreddit, user and search listings: `hot`, `new`, `top` or `rising`. Comment threads follow the same choice (new, otherwise top).                                                                                                                                                               |
| `timeFilter`         | string  | no       | `"week"`                                                         | Time window applied when Sort is Top: `hour`, `day`, `week`, `month`, `year` or `all`.                                                                                                                                                                                                                             |
| `maxItems`           | integer | no       | `5`                                                              | Maximum number of posts to return per start URL or search query. Comments are limited separately by Maximum comments.                                                                                                                                                                                              |
| `maxComments`        | integer | no       | `20`                                                             | Maximum number of comments to return for each post URL, walking the thread depth-first. Set to 0 to skip comments.                                                                                                                                                                                                 |
| `proxyConfiguration` | object  | no       | `{ "useApifyProxy": true, "apifyProxyGroups": ["RESIDENTIAL"] }` | Apify proxy settings. Reddit blocks datacenter and direct connections, so residential Apify Proxy sessions are used by default.                                                                                                                                                                                    |

### 📤 Output

Every row carries an `itemType` of `post`, `comment` or `subreddit`. A subreddit start URL pushes one `subreddit` row with the community's weekly activity, followed by its posts in the chosen order. A post start URL pushes the post itself and then its comments, depth-first, exactly as the thread reads on the site. A user profile pushes the account's posts (or, for `/comments/` URLs, its comments). Searches push matching posts.

Fields that do not apply to a row's type are `null`.

#### Fields

| Field                 | Type    | Description                                                                                                       |
| --------------------- | ------- | ----------------------------------------------------------------------------------------------------------------- |
| `itemType`            | string  | `post`, `comment` or `subreddit`.                                                                                 |
| `postId`              | string  | Post rows: the post's Reddit id, e.g. `t3_1vy502t`. Comment rows: the id of the post the comment belongs to.      |
| `title`               | string  | Post title, or the subreddit's display name for subreddit rows.                                                   |
| `link`                | string  | Permalink of the post, comment or subreddit on reddit.com.                                                        |
| `selftext`            | string  | Body text of a text post; `null` for link and media posts.                                                        |
| `author`              | string  | Username of the post or comment author.                                                                           |
| `authorId`            | string  | The author's Reddit account id, e.g. `t2_3ypbf`.                                                                  |
| `authorProfile`       | string  | URL of the author's profile.                                                                                      |
| `subreddit`           | string  | Name of the community, without the `r/` prefix.                                                                   |
| `publishingDate`      | string  | ISO 8601 timestamp of when the post or comment was created.                                                       |
| `postUpvotes`         | integer | Post score (upvotes minus downvotes).                                                                             |
| `upvoteRatio`         | number  | Share of votes that were upvotes, from 0 to 1.                                                                    |
| `commentCount`        | integer | Number of comments on the post.                                                                                   |
| `flair`               | string  | The post's flair label, e.g. `News` or `Meme`.                                                                    |
| `attachmentType`      | string  | Kind of content attached to the post: `text`, `image`, `video`, `gallery`, `link`, `multi_media` or `customPost`. |
| `attachmentLink`      | string  | URL of the attached content: the external link, the media file, or the post itself for text posts.                |
| `domain`              | string  | Domain of the attached content, e.g. `i.redd.it` or `self.wallstreetbets`.                                        |
| `commentId`           | string  | Comment rows: the comment's Reddit id, e.g. `t1_p5vok6c`.                                                         |
| `parentId`            | string  | Id of the comment being replied to, or of the post for top-level comments.                                        |
| `body`                | string  | Comment text.                                                                                                     |
| `upvotes`             | integer | Comment score.                                                                                                    |
| `depth`               | integer | Nesting level of the comment in its thread; 0 for top-level comments.                                             |
| `isSubmitter`         | boolean | Whether the comment was written by the post's author.                                                             |
| `subredditId`         | string  | Subreddit rows: the community's Reddit id, e.g. `t5_2th52`.                                                       |
| `description`         | string  | The community's public description.                                                                               |
| `weeklyVisitors`      | integer | Number of visitors the community had in the past week.                                                            |
| `weeklyContributions` | integer | Number of posts and comments made in the community in the past week.                                              |
| `iconUrl`             | string  | URL of the community icon.                                                                                        |

<details><summary>Example output</summary>

```json
{
  "itemType": "post",
  "postId": "t3_1vy502t",
  "title": "Anthropic to Tell Investors It Sees Over $30 Trillion in Potential Revenue",
  "link": "https://www.reddit.com/r/wallstreetbets/comments/1vy502t/anthropic_to_tell_investors_it_sees_over_30/",
  "selftext": null,
  "author": "wotton",
  "authorId": "t2_3ypbf",
  "authorProfile": "https://www.reddit.com/user/wotton/",
  "subreddit": "wallstreetbets",
  "publishingDate": "2026-08-25T16:39:30.269Z",
  "postUpvotes": 2058,
  "upvoteRatio": 0.9548,
  "commentCount": 663,
  "flair": "News",
  "attachmentType": "link",
  "attachmentLink": "https://www.wsj.com/tech/ai/anthropic-expected-to-tell-investors-it-sees-over-30-trillion-in-potential-revenue-a611efea",
  "domain": "wsj.com"
}
```

</details>

### 💡 Use cases

- Track sentiment and trending topics in communities such as r/wallstreetbets or r/technology for market and product research.
- Collect complete comment threads for content analysis, moderation studies, or training data.
- Monitor mentions of a brand, product, or ticker across Reddit with search queries.
- Follow what a specific account posts and comments over time.

### ❓ FAQ

- **Do I need a proxy?** Yes. Reddit rejects cloud and datacenter IP addresses, so the Actor uses residential Apify Proxy sessions by default. Keep the default unless you have your own residential proxies.
- **How many results can I get?** `maxItems` caps posts per start URL or search query and `maxComments` caps comments per post. Add more start URLs or queries to widen coverage.
- **Which sort orders are supported?** `hot`, `new`, `top` and `rising` for subreddits; searches and user profiles fall back to `hot` or `new` where Reddit offers no `rising` order. `timeFilter` applies to `top`.
- **Why are some fields empty on a post I scraped by URL?** A post fetched by its own URL comes from Reddit's post feed, which carries the title, author, date and text but no vote figures; `commentCount` is taken from the comment thread instead.
- **Why did a run return fewer items than expected?** Reddit may have changed its layout or rate-limited the session. Open an issue and we will update the Actor.

### 🔗 More scrapers by Anyx

- [Bluesky Scraper](https://apify.com/anyxsolutions/bluesky-scraper)
- [X (Twitter) Scraper](https://apify.com/anyxsolutions/x-twitter-scraper)
- [Threads Scraper](https://apify.com/anyxsolutions/threads-scraper)
- [YouTube Search Scraper](https://apify.com/anyxsolutions/youtube-search-scraper)
- [TikTok Trending Hashtags Scraper](https://apify.com/anyxsolutions/tiktok-trending-hashtags-scraper)

### 🤝 Anyx Solutions

We build custom scrapers and data-extraction pipelines.

- Email: tantosthor@gmail.com

# Actor input Schema

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

Reddit URLs to scrape. Subreddits (https://www.reddit.com/r/wallstreetbets/), posts (https://www.reddit.com/r/wallstreetbets/comments/1vy502t/), user profiles (https://www.reddit.com/user/wsbapp/ or /user/wsbapp/comments/) and search pages (https://www.reddit.com/search/?q=nvidia) are supported.

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

Search terms to look up across all of Reddit, for example "nvidia earnings". Each query returns matching posts.

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

Order of posts in subreddit, user and search listings. Comment threads follow the same choice (new, otherwise top).

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

Time window applied when Sort is Top, for example the top posts of the past week.

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

Maximum number of posts to return per start URL or search query. Comments are limited separately by Maximum comments.

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

Maximum number of comments to return for each post URL, walking the thread depth-first. Set to 0 to skip comments.

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

Apify proxy settings. Reddit blocks datacenter and direct connections, so residential Apify Proxy sessions are used by default.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www.reddit.com/r/wallstreetbets/"
    },
    {
      "url": "https://www.reddit.com/r/technology/"
    }
  ],
  "sort": "hot",
  "timeFilter": "week",
  "maxItems": 5,
  "maxComments": 20,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

## `overview` (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/wallstreetbets/"
        },
        {
            "url": "https://www.reddit.com/r/technology/"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("anyxsolutions/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/wallstreetbets/" },
        { "url": "https://www.reddit.com/r/technology/" },
    ] }

# Run the Actor and wait for it to finish
run = client.actor("anyxsolutions/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/wallstreetbets/"
    },
    {
      "url": "https://www.reddit.com/r/technology/"
    }
  ]
}' |
apify call anyxsolutions/reddit-scraper --silent --output-dataset

```

## MCP server setup

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