# Reddit Scraper — Posts, Comments, Subreddits & Users (`rl1987/reddit-api-scraper`) Actor

Scrape Reddit posts, comments, subreddits and user profiles without a login or API key. Search any keyword, pull hot, new or top listings from any subreddit, and fetch full comment threads. Every row carries the score, author, flair, timestamp and permalink. Export to JSON, CSV or Excel.

- **URL**: https://apify.com/rl1987/reddit-api-scraper.md
- **Developed by:** [R.L.](https://apify.com/rl1987) (community)
- **Categories:** Social media
- **Features:** Limited permissions
- **Stats:** 5 total users, 4 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.54 / 1,000 dataset rows

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

## Reddit Scraper — Posts, Comments, Subreddits & Users

**Reddit Scraper** extracts **posts, comments, search results, subreddit metadata, and user profiles** from [Reddit](https://www.reddit.com) — fast, structured, and without a login. It talks directly to Reddit's official OAuth data API (the same endpoints the Reddit mobile app uses), so you get clean JSON instead of brittle HTML scraping. Point it at a subreddit, a search query, a post URL, or a username and download the results as JSON, CSV, or Excel.

Running on the Apify platform, you also get scheduling, a REST API, webhook and integration support, proxy rotation, and run monitoring out of the box.

### What can you use a Reddit scraper for?

- **Market & audience research** — track what communities are discussing around your product, niche, or competitors.
- **Brand & reputation monitoring** — surface every mention of a keyword across Reddit and read the full comment threads.
- **Content & trend discovery** — pull top/hot/rising posts from any subreddit to spot emerging topics.
- **Sentiment & NLP datasets** — collect large, structured post + comment corpora for analysis or model training.
- **Lead and community analysis** — profile users and inspect their posting history.

### How do I scrape a subreddit, a search, a post, or a user?

1. Open the Actor and go to the **Input** tab.
2. Fill in **one or more** source fields: **Subreddits**, **Search queries**, **Post URLs / IDs**, or **Usernames**.
3. Optionally set the sort order, time window, item limits, and whether to include comments.
4. Click **Start** and watch the run log.
5. When it finishes, open the **Output** / **Storage** tab and download your data as JSON, CSV, or Excel.

### What input does it take?

You can combine any of the source types in a single run. At least one is required.

| Field | Type | Description |
|-------|------|-------------|
| `subreddits` | array | Subreddit names, `r/`-prefixed names, or URLs to pull post listings from. |
| `sort` | enum | Listing sort: `hot`, `new`, `top`, `rising`, `controversial`. |
| `time` | enum | Time window for `top`/`controversial`: `hour`–`all`. |
| `searchQueries` | array | Full-text search queries to run. |
| `searchSort` | enum | Search sort: `relevance`, `hot`, `top`, `new`, `comments`. |
| `searchInSubreddits` | boolean | Restrict each search query to the listed subreddits. |
| `postUrls` | array | Individual post permalinks/IDs — fetches full self-text + comments. |
| `usernames` | array | Users to scrape (profile + history). |
| `userContent` | enum | `overview`, `submitted`, `comments`, or `about`. |
| `includeComments` | boolean | Also fetch comment trees for posts collected from subreddits/searches. |
| `maxComments` | integer | Max comments emitted per post. |
| `commentSort` | enum | Comment sort: `confidence`, `top`, `new`, `controversial`, `old`, `qa`. |
| `maxItemsPerSource` | integer | Max posts per subreddit/search/user (0 = unlimited). |
| `dateFrom` / `dateTo` | string | `YYYY-MM-DD` (UTC) bounds on post/comment creation time. |
| `includeNsfw` | boolean | Include NSFW results in search. |
| `proxyConfiguration` | object | Proxy settings (Apify Proxy recommended for larger runs). |

#### Example input

```json
{
    "subreddits": ["programming", "r/python"],
    "sort": "top",
    "time": "week",
    "maxItemsPerSource": 100,
    "includeComments": true,
    "maxComments": 50,
    "searchQueries": ["large language models"],
    "searchSort": "new"
}
```

### What does each row of scraped Reddit data contain?

Each item is pushed to the dataset with a `type` field (`post`, `comment`, `subreddit`, or `user`). You can download the dataset in various formats such as JSON, HTML, CSV, or Excel.

#### Example output (a post)

```json
{
    "type": "post",
    "id": "1ukim8j",
    "subreddit": "programming",
    "title": "Open source is a thankless job...",
    "author": "swithek",
    "selftext": "",
    "score": 1092,
    "upvoteRatio": 0.97,
    "numComments": 267,
    "createdAt": "2026-07-01T11:09:38+00:00",
    "url": "https://example.com/article",
    "permalink": "https://www.reddit.com/r/programming/comments/1ukim8j/..."
}
```

#### Example output (a comment)

```json
{
    "type": "comment",
    "id": "ouw01y8",
    "postId": "1ukim8j",
    "author": "SP-Niemand",
    "body": "As a user, you get to demand exactly nothing...",
    "score": 453,
    "depth": 0,
    "createdAt": "2026-07-01T12:30:00+00:00"
}
```

#### Data fields

| Field | Applies to | Description |
|-------|-----------|-------------|
| `type` | all | `post`, `comment`, `subreddit`, or `user`. |
| `id` | all | Base-36 Reddit ID. |
| `fullname` | post, comment | Prefixed ID (`t3_…` for posts, `t1_…` for comments). |
| `subreddit` | post, comment | Subreddit name. |
| `title` | post, subreddit | Post title / subreddit title. |
| `author` | post, comment | Username of the author. |
| `selftext` / `body` | post / comment | Full text content. |
| `score`, `ups`, `upvoteRatio` | post, comment | Vote metrics (`upvoteRatio` is posts only). |
| `numComments` | post | Comment count. |
| `linkFlairText`, `domain`, `stickied`, `locked`, `spoiler`, `over18` | post | Flair and post flags. |
| `postId`, `parentId`, `depth`, `isSubmitter` | comment | Thread position and whether the commenter is the OP. |
| `subscribers`, `activeUserCount`, `publicDescription`, `subredditType` | subreddit | Community size and type. |
| `commentKarma`, `linkKarma`, `totalKarma`, `isGold`, `isMod`, `verified` | user | Karma breakdown and account flags. |
| `createdAt` | all | ISO-8601 UTC creation time (`createdUtc` holds the raw epoch). |
| `permalink`, `url` | post, comment | Links. |

### What do the Reddit terms in the output mean?

- **Score vs. ups** — `score` is the net vote count Reddit publishes (upvotes minus downvotes, fuzzed to deter vote manipulation). `ups` is the upvote count Reddit returns alongside it.
- **Upvote ratio** — the share of a post's votes that are upvotes, from 0 to 1. `0.97` means 97% of voters upvoted. Posts only; Reddit does not expose it per comment.
- **Link karma vs. comment karma** — `linkKarma` is earned from a user's posts, `commentKarma` from their comments, and `totalKarma` is Reddit's combined figure (which also includes award karma, so it is not always the sum of the two).
- **Fullname** — Reddit's global ID: a type prefix plus the base-36 ID. `t1_` is a comment, `t3_` a post, `t5_` a subreddit. You can paste either form into **Post URLs / IDs**.
- **Flair** — a label a subreddit's moderators attach to a post, returned in `linkFlairText` (e.g. `Discussion`, `Help`). Not every subreddit uses it, so it is often `null`.
- **Depth** — how deeply nested a comment is. `0` is a top-level reply to the post, `1` a reply to that, and so on.
- **Best / confidence sort** — Reddit's default comment order, which weighs a comment's vote ratio against how many votes it has, so a new 5-of-5 comment does not outrank an established one.

### How much does it cost to scrape Reddit?

The current price of every event is on the **Pricing** tab of this Actor's page in Apify Store. That tab is generated from the Actor's own pricing record, so it is always current, and your plan's rung is applied automatically. A figure repeated here would be a second copy that drifts out of date.

You can cap what any single run may spend with **Max total charge**.

### How do I make runs faster and cheaper?

- **Fewer requests, faster runs:** leave `includeComments` off if you only need post metadata.
- **Targeted comment collection:** put specific posts in `postUrls` — their comments are always fetched.
- **Scoped search:** enable `searchInSubreddits` with a `subreddits` list to search within specific communities.
- **Unlimited collection:** set `maxItemsPerSource` to `0` to page through everything the API returns (Reddit typically caps listings around ~1000 items per source).
- **Scale past rate limits:** run with Apify Proxy and/or split large jobs into scheduled runs.

### FAQ

**Do I need a Reddit account, API key, or app credentials?** No. The Actor mints an anonymous OAuth token for itself on every run — the same anonymous grant the Reddit apps use before you sign in. You never enter a username, password, or client secret, and nothing is tied to your Reddit identity.

**Can I schedule it to run daily or weekly?** Yes, with Apify **Schedules**. For incremental collection, set `sort` to `New` and a `dateFrom` — with a chronological sort the Actor stops paginating as soon as it reaches posts older than that date instead of scanning the whole listing.

**What counts as one row?** One post, one comment, one subreddit, or one user profile. Rows are mixed in a single dataset and told apart by the `type` field, so filter on `type` (or use the dataset views) if you want posts and comments in separate files.

**Can I get every comment on a big thread?** Not always. `maxComments` caps how many comments each post emits (`0` means post only), and Reddit returns a truncated tree for very large threads — the "load more comments" stubs are skipped rather than expanded. Expect the top of the tree under your chosen `commentSort`, not a guaranteed complete thread.

**How far back in a subreddit can I go?** Reddit's own listing pagination stops at roughly 1,000 items per source, no matter how high you set `maxItemsPerSource`. To reach older material, use **Search queries** with a narrower keyword, split the job across sorts and time windows, or feed known post URLs directly.

**Does it include NSFW posts?** The `includeNsfw` option adds over-18 results to **search** output. Subreddit listings return whatever Reddit serves for that community, and every post carries an `over18` flag you can filter on.

**What happens if a subreddit is private or a user is deleted?** That source is logged as a warning and skipped; the rest of the run continues and finishes successfully with whatever it did collect. If Reddit is unreachable after all retries, the run ends with a status message explaining it rather than a silent empty dataset.

**Do I need proxies?** For small runs, no. Reddit rate-limits per IP and per token at roughly 100 requests per minute, so for large jobs enable Apify Proxy (datacenter is usually enough) to spread the load.

### Disclaimers and support

**Is scraping Reddit legal?** This Actor collects only publicly available data. You are responsible for how you use it — comply with applicable laws (including data-protection law such as GDPR) and avoid collecting personal or sensitive data without a lawful basis.

**Support:** found a bug or need a field that isn't extracted? Open an issue on the Actor's **Issues** tab. Custom scraping solutions can also be arranged.

### Community research toolkit

Part of the **Community research toolkit** — research online communities and creators across forums, link-in-bio pages, and social platforms:

- [Linktree Profile Scraper](https://apify.com/rl1987/linktree-scraper) — Scrape profile info and all links from Linktree pages.
- [Discourse Community Scraper](https://apify.com/rl1987/discourse-community-scraper) — Generalised scraper for any Discourse-based community forum.
- [phpBB Forum Scraper](https://apify.com/rl1987/phpbb-forum-scraper) — Generic scraper for phpBB-powered forums.
- [Hacker News Scraper](https://apify.com/rl1987/hacker-news-scraper) — Scrape Hacker News by search, user, listing, or thread.
- [Social Blade Scraper — YouTube, TikTok, Instagram, Twitch Stats](https://apify.com/rl1987/social-blade-lookup) — Social Blade stats and growth projections for creators.

### Did you find this useful?

Rate this actor on Apify! Your feedback helps other users find it and helps us keep improving it.

# Actor input Schema

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

Subreddits to scrape post listings from. Accepts names (`programming`), `r/`-prefixed names, or full URLs (`https://www.reddit.com/r/programming`).

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

Sort order for subreddit post listings.

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

Time window for the `top` and `controversial` sorts (ignored otherwise).

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

Full-text search queries to run against Reddit. Each query is executed and its result posts are pushed to the dataset.

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

Sort order for search results.

## `searchInSubreddits` (type: `boolean`):

When enabled, each search query is restricted to each subreddit listed in the Subreddits field (searches `r/{subreddit}/search` with `restrict_sr=true`). When disabled, searches are global.

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

Individual Reddit posts to fetch (including full self-text and comment threads). Accepts full permalinks, `comments/{id}` URLs, base-36 IDs, or `t3_`-prefixed fullnames.

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

Reddit users to scrape. Fetches the profile and, per the `User content` option, their posts and/or comments. Accepts names, `u/`-prefixed names, or profile URLs.

## `userContent` (type: `string`):

Which content to fetch for each username.

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

Fetch and output the comment tree for every post collected from subreddits and searches (in addition to posts given directly in Post URLs, whose comments are always fetched).

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

Upper bound on the number of comments emitted per post. 0 = no comments (post only).

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

Sort order for comment threads.

## `maxItemsPerSource` (type: `integer`):

Maximum posts to collect from each individual subreddit, search query, or user listing. 0 = unlimited (fetch until the API runs out).

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

Only include posts/comments created on or after this date (YYYY-MM-DD, UTC). Applies to subreddit listings, search results, and comments fetched for any post. For subreddit/search sources, set the matching sort to `New` so results are chronological — otherwise the whole listing is scanned and old items may be missed if `maxItemsPerSource` cuts it off first.

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

Only include posts/comments created on or before this date (YYYY-MM-DD, UTC, inclusive through 23:59:59).

## `includeNsfw` (type: `boolean`):

Include NSFW results in search output.

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

Proxy settings. Reddit rate-limits per IP and per OAuth token (~100 req/min); residential or datacenter proxies help distribute load. Recommended for larger runs.

## Actor input object example

```json
{
  "subreddits": [
    "programming",
    "r/news",
    "https://www.reddit.com/r/python"
  ],
  "sort": "hot",
  "time": "all",
  "searchQueries": [
    "large language models",
    "rust vs go"
  ],
  "searchSort": "relevance",
  "searchInSubreddits": false,
  "postUrls": [
    "https://www.reddit.com/r/programming/comments/1ab2cd/title/"
  ],
  "usernames": [
    "spez"
  ],
  "userContent": "overview",
  "includeComments": false,
  "maxComments": 50,
  "commentSort": "confidence",
  "maxItemsPerSource": 100,
  "includeNsfw": false,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `dataset` (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": [
        "programming"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("rl1987/reddit-api-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"] }

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

```

## MCP server setup

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