# Reddit Scraper: Posts, Comments, Search and Full History (`locaihost/reddit-scraper`) Actor

Scrape Reddit posts and comments from subreddits, searches, post and user links. No login needed. Full history by date from a public archive, threads found through Google, free lead flags and summary row, only-new mode. Keeps working when Reddit blocks. $0.90 per 1,000 posts.

- **URL**: https://apify.com/locaihost/reddit-scraper.md
- **Developed by:** [locaihost data](https://apify.com/locaihost) (community)
- **Categories:** Social media, Lead generation
- **Features:** Limited permissions
- **Stats:** 1 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.50 / 1,000 posts

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, Search and Full History

Get Reddit posts and comments as clean rows from subreddits, searches, post links and user links, with no account needed. When Reddit stops a listing, blocks a page or only keeps the newest 1,000 posts, the run carries on from a public Reddit archive, so you still get your rows. Posts cost $0.90 per 1,000 and comments $0.50 per 1,000.

### What can I get from Reddit with it?

- **Subreddit feeds.** Hot, new, top or rising posts from any public community, like r/webdev or r/personalfinance.
- **Search results.** Posts matching your words across all of Reddit, or only inside the subreddits you list.
- **Single posts and their comments.** Paste a post link, or turn on comments for any feed. Each comment is its own row, with depth and parent ID so you can rebuild the thread.
- **A user's posts.** Paste a user link or type a handle to get the public posts that account submitted, plus one free row with its public karma and join date.
- **Full history by date.** Set **Posted after** and **Posted before** to read any month or year of a subreddit, even years back. Reddit's own pages stop at about 1,000 posts; the archive doesn't.
- **Old threads through Google.** Turn on **Also find threads through Google** to find matching threads from every year, not just the ones Reddit's search ranks first.
- **Subreddit facts, free.** Every subreddit you read gives one free row with members, description, rules count, creation date and, if you ask, posts per day for the last weeks.
- **Lead flags, free.** Each post is marked when it asks for a recommendation, mentions a price, sounds like a complaint, asks a question, is a hiring post, or names a brand from your list.

### How do I use it?

1. Paste Reddit links into **Reddit links**, or type community names into **Subreddits**, or words into **Search terms**.
2. Set **Posts per source** (25 by default).
3. Turn on **Include comments** if you want the conversations too.
4. Click Start. Rows appear in the Output tab as they arrive, and you can export them as JSON, CSV or Excel.

The prefill reads 25 hot posts on r/webdev with no comments, which is a quick way to see the output.

### How does it keep working when Reddit blocks scrapers?

Every source tries three routes in turn, and each row says which one it came from in `dataSource`:

1. **Reddit's own data feed** (`reddit-json`), when Reddit answers it.
2. **The Reddit page in a real browser** (`reddit-page`), on residential addresses, scrolling the feed like a visitor would.
3. **A public Reddit archive** (`archive`, from Arctic Shift), when the first two give nothing, or when you ask for more than Reddit's pages keep.

A blocked page gets a fresh connection before the run moves on. If a source fails every route, the run still ends normally, the summary row says why, and nothing is charged for that source. The archive lags Reddit by about a day, so the newest posts always come from Reddit itself. Text an author deleted stays deleted: it is never filled back in from the archive.

### Which links does it accept?

Any of these, from www, old, new, np or m reddit.com, and short redd.it links:

| Link | What you get |
|---|---|
| `https://www.reddit.com/r/webdev/` | The feed, in the order you choose, plus the free subreddit row |
| `https://www.reddit.com/r/webdev/top/?t=month` | Top posts of the past month (a sort in the link wins over the Sort setting) |
| `https://www.reddit.com/r/webdev/comments/<id>/...` | That post, and its comments when comments are on |
| `https://redd.it/<id>` | Same as a post link |
| `https://www.reddit.com/user/<handle>/` | Public posts by that handle, plus a free user row |
| `https://www.reddit.com/search/?q=standing+desk` | Search results |
| `https://www.reddit.com/r/webdev/search/?q=react&restrict_sr=1` | Search inside one subreddit |

### Can I use input from another Reddit scraper?

Yes. Common field names from other Reddit tools are read as well, so most saved inputs and API calls work unchanged. For example `urls`, `directUrls` or `postUrls` for links; `searches`, `queries` or `keywords` for search terms; `maxItems`, `maxResults` or `limit` for posts per source; `maxComments` for comments per post; `skipComments` and `scrapeComments`; `postDateLimit`, `startDate` and `endDate` for dates; `sortBy` and `timeFilter`. When both names are given, our own field wins.

### How do I read a subreddit's full history?

Set **Posted after** and **Posted before** (for example 2023-01-01 and 2023-01-31) with a subreddit. The run reads that range newest first from the archive, which keeps posts back to 2005 with score, comment count, flair and text. Without dates, a feed asked for more than 1,000 posts, or a "new" feed that Reddit stops early, carries on in the archive from the oldest post Reddit showed, so a big ask still fills up.

### How does "Also find threads through Google" work?

It runs a `site:reddit.com` Google search for each search term (inside your subreddits if you list them, and within your dates), then reads every thread it finds by its ID. This finds the threads people actually land on from Google, from any year, which Reddit's own search often misses. It adds a few seconds per Google page, because Google makes a visitor wait briefly before it hands over each link. The posts from Google count toward **Posts per source** like any other.

### Can I log in for more data?

You can, with your own account. Paste the cookies from a browser where you're logged in to Reddit into **Your Reddit cookies** (a secret field). The run then reads Reddit's data feed as you, which answers more often, reaches more comments and shows adult posts when **Include adult posts** is on. Your cookies are used only during that run: they are never saved to the dataset, the logs or any store. Without cookies everything still works logged out. Use an account you own; the run sees only what that account can see.

### What does a post row look like?

```json
{
    "type": "post",
    "id": "1x6lz7z",
    "url": "https://www.reddit.com/r/webdev/comments/1x6lz7z/...",
    "subreddit": "webdev",
    "subredditSubscribers": 3100000,
    "title": "What do you all use for client invoicing?",
    "selftext": "The post body as plain text, with paragraphs kept.",
    "bodyHtml": "<p>The post body as HTML.</p>",
    "author": "example_handle",
    "flair": "Discussion",
    "score": 120,
    "upvoteRatio": 0.93,
    "numComments": 24,
    "createdAt": "2026-10-15T13:42:01.907Z",
    "editedAt": null,
    "postType": "text",
    "domain": "self.webdev",
    "linkUrl": null,
    "media": [],
    "isNsfw": false,
    "isLocked": false,
    "isStickied": false,
    "removedBy": null,
    "crosspostParentId": null,
    "signals": ["asks-recommendation", "question", "mentions-brand"],
    "brandsMentioned": ["QuickBooks"],
    "dataSource": "reddit-json",
    "source": "r/webdev",
    "scrapedAt": "2026-11-17T09:00:00.000Z"
}
```

Posts carry about 45 fields in all, including awards, author flair, video link and length, thumbnail, crosspost count, and whether the post is archived, original content or marked by a moderator. Empty values are `null`, never missing.

### What does a comment row look like?

```json
{
    "type": "comment",
    "id": "peurpv7",
    "postId": "1x1lwo8",
    "postTitle": "What do you all use for client invoicing?",
    "parentId": null,
    "depth": 0,
    "author": "example_handle",
    "body": "The comment as plain text.",
    "score": 176,
    "createdAt": "2026-10-09T14:23:38.893Z",
    "isSubmitter": false,
    "url": "https://www.reddit.com/r/webdev/comments/1x1lwo8/comment/peurpv7/",
    "subreddit": "webdev",
    "dataSource": "reddit-json",
    "source": "r/webdev",
    "scrapedAt": "2026-11-17T09:00:00.000Z"
}
```

`parentId` is empty for top-level comments and holds the parent comment's ID for replies. `isSubmitter` is true when the comment's author also wrote the post. Comments come in the order Reddit shows them, best first, with replies under their parent. Deleted comments keep their place in the thread with an empty author and body.

### What are the lead flags?

Every post gets a `signals` list, worked out from its title and text, free:

| Flag | When it's set |
|---|---|
| `asks-recommendation` | "any recommendations", "alternatives to", "best X for", "what do you use" |
| `mentions-price` | a price, a budget, "pricing", "subscription", "per month" |
| `complaint` | "frustrated", "broken", "refund", "switching from", "doesn't work" |
| `question` | the title is a question |
| `hiring` | "\[Hiring]", "we're hiring", "need a developer" |
| `mentions-brand` | a name from **Brands to flag** appears; the names are in `brandsMentioned` |

Filter on these in the Output tab or in your own sheet to find people asking for a tool like yours, or complaining about a rival's.

### What is in the free summary row?

The last row of every run has `type: "summary"` and is never charged. It holds the number of posts and comments returned, a count per subreddit, the five top posts by score, the oldest and newest post dates, which routes were used, and what was left out (adult posts, repeats, keyword misses, posts returned in an earlier run). It also has a line per source, with a note when a source gave nothing, such as "no results" or "private". Turn it off with **Add a summary row** if you don't want it.

### How does "only posts not returned before" work?

Turn on **Only posts not returned before** and run the same input on a schedule. Each run remembers the post IDs it returned in a named store in your account, and the next run leaves those posts out. So a daily run of r/personalfinance new posts only brings posts you haven't seen yet, and you're never charged twice for the same post. The memory belongs to that input: change the subreddits, search words or links and it starts fresh. When a post is left out, its comments are too.

### How do I filter by keyword?

- **Must contain one of**: keep only posts whose title or text has at least one of these words.
- **Leave out posts with**: drop posts that have any of these words.
- **Every search word must appear**: Reddit's search also returns loose matches; this keeps only posts that contain all your search words.

Posts left out by a filter are never charged.

### How much does it cost?

You pay per row you get, plus a small start fee:

| Event | Price |
|---|---|
| Post | $0.90 per 1,000 |
| Comment | $0.50 per 1,000 |
| Start of a run | $0.002 |

Subreddit, user and summary rows are free. Higher Apify plans pay less per row. On the free Apify plan a run returns up to 200 rows, then stops with a message. Set a maximum charge on the run and it stops cleanly when the next row would go over it.

### How fast is it, and what does a real run look like?

Measured on 17 November 2026, one run each:

| What it read | Rows | Seconds | Price (Starter plan) |
|---|---|---|---|
| The prefill: 25 hot posts on r/webdev | 25 posts | 39 | $0.025 |
| 50 new posts on r/personalfinance | 50 posts | 23 | $0.047 |
| 1,000 new posts on r/AskReddit (the last 39 from the archive) | 999 posts | 433 | $0.90 |
| 5 posts on r/news with up to 100 comments each | 5 posts, 342 comments | 136 | $0.18 |
| Search "standing desk" across Reddit | 30 posts | 26 | $0.029 |
| Search "crm" inside r/sales, flagging HubSpot and Salesforce | 20 posts | 7 | $0.020 |
| A user's posts (u/spez) | 20 posts | 7 | $0.020 |
| r/BuyItForLife in January 2023, from the archive | 100 posts | 12 | $0.092 |
| "best crm for small business" found through Google | 20 posts | 87 | $0.020 |
| Another tool's input (`startUrls`, `maxItems`, `skipComments`) on a top-of-month link | 15 posts | 16 | $0.016 |
| 500 posts with comments on r/AskReddit, with a 60-second time limit | 500 posts, 75 comments, stopped cleanly at the limit | 51 | $0.49 |

Every run ended normally, and every charge matched a returned row. Subreddit, user and summary rows came free on top.

A plain subreddit or search run with no comments usually ends in under a minute. Comments take longer, because each post's thread is read separately.

### Why are some adult posts missing even with them turned on?

Logged out, Reddit hides most adult posts and communities from visitors. Turn on **Include adult posts** and add your own cookies to see them; without cookies the run returns what a logged-out visitor sees.

### What doesn't it collect?

- Private or restricted communities, votes, saved posts, messages and anything else only a logged-in member can see, unless you give your own cookies (then only what your account sees).
- Profile details about people beyond public account stats: no profile text, avatars, links or comment histories.
- Separate email or phone fields. Post and comment text is returned as written.
- Comments past the per-post limit you set.

### Is it legal to scrape Reddit?

It reads public pages that anyone can see, and returns usernames as the public handles Reddit shows. You are responsible for how you use the data. Respect people's privacy, follow the laws that apply to you (GDPR in Europe, for example), and don't use the data to identify, profile or contact individual people. If you're unsure, ask a lawyer.

### What if something goes wrong?

- **"No posts found"**: check the subreddit name or link, try a wider time window, or check whether the community is private or adult-only.
- **"Reddit did not show the page; posts read from the public archive"**: Reddit blocked that source, so the posts came from the archive. They are real posts, but up to a day old.
- **Fewer rows than asked**: the feed may have ended, the run's time limit may have been reached (the status message says so), or your maximum charge was reached.

Found a problem? Open an issue on the Issues tab with the input you used, and it will be looked at.

### Can I call it from my own code or an agent?

Yes. Start it from the [Apify API](https://docs.apify.com/api/v2), the [Apify client](https://docs.apify.com/api/client/js) or Apify's MCP server with the same input fields you see in the form, then read the dataset. A minimal input:

```json
{
    "subreddits": ["webdev"],
    "sort": "new",
    "maxPosts": 50,
    "onlyNew": true
}
```

# Changelog

This Actor's version history is a separate document: https://apify.com/locaihost/reddit-scraper/changelog.md

# Actor input Schema

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

Any mix of subreddit, post, user and search links. www, old, new and short redd.it links all work. A subreddit link also returns a free row of facts about the community.

## `searchTerms` (type: `array`):

Words to search for, one per line. Searched across all of Reddit, or only inside the subreddits below when you list any.

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

Community names without "r/", one per line. On their own they return each community's feed; with search terms they limit the search to these communities.

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

How many posts to return from each subreddit, search or user, up to 10,000. Past the newest 1,000 (as far back as Reddit lists) the rest come from the public Reddit archive. 0 returns only the free subreddit facts. A post link always returns that post.

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

Open each post and return its comments as their own rows, with depth and parent so you can rebuild the thread. Slower: each post is one more page.

## `onlyNew` (type: `boolean`):

Remembers which posts this exact input returned in earlier runs and leaves them out, so a daily schedule only brings new posts. Repeats are never charged.

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

Order of posts. Subreddit feeds know hot, new, top and rising; search knows relevance, hot, top, new and most comments. A sort a page does not know falls back to its default. A sort inside a link wins over this.

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

For top and search results: how far back to look.

## `users` (type: `array`):

Usernames without "u/", one per line. Returns their public posts, plus a free row with their public karma and account age.

## `postedAfter` (type: `string`):

Only posts from this date on: 2026-11-01, an ISO time, or a span back from now like "7 days" or "3 months". Older history comes from the public Reddit archive.

## `postedBefore` (type: `string`):

Only posts up to this date, same formats as above.

## `includeKeywords` (type: `array`):

Keep only posts whose title, text or flair has at least one of these words (not case sensitive). Posts left out are not charged.

## `excludeKeywords` (type: `array`):

Drop posts whose title, text or flair has any of these words. Not charged.

## `requireQueryTerms` (type: `boolean`):

Reddit's search also returns loose matches. On, a search result is kept only when every word of the search is in its title or text.

## `brands` (type: `array`):

Brand or rival names. Each post lists the ones it mentions in brandsMentioned and gets a mentions-brand flag. Free; does not filter.

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

Most comments returned for one post, in the order Reddit shows them (best first, replies under their parent).

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

Adult (NSFW) posts are left out unless this is on. Reddit hides many of them from logged-out visitors, so some may still be missing.

## `summaryRow` (type: `boolean`):

A free last row with rows per subreddit, the top posts by score, the date range and what was left out. Never charged.

## `useArchive` (type: `boolean`):

Fills date ranges older than Reddit lists, full comment trees on old posts, and anything Reddit refuses to show. Rows from it say dataSource "archive". The archive runs about a day behind Reddit.

## `googleSearch` (type: `boolean`):

For search terms: finds Reddit threads of any age through Google's site:reddit.com results, then reads each one from Reddit. Good for research on older threads that Reddit's own search no longer shows. Adds about $0.0025 of our cost per Google page (10 results), which counts toward your run's spend limit. Dates and a community, when given, go into the Google query. Google makes each page of links wait up to about a minute, so allow extra run time.

## `activityDays` (type: `integer`):

Adds posts per day for each subreddit, for this many days back, to its free subreddit row. 0 skips it.

## `redditCookies` (type: `string`):

Optional. Paste your own reddit.com cookies (a JSON export from a cookie extension, or the Cookie header) to read as your account: Reddit's search, more comments, and communities your account can see. Only the token_v2 cookie is used; it is encrypted by Apify, never stored by this tool and never written to the log. Use your own account only.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www.reddit.com/r/webdev/top/?t=week"
    },
    {
      "url": "https://old.reddit.com/r/personalfinance/"
    },
    {
      "url": "https://www.reddit.com/search/?q=standing%20desk"
    }
  ],
  "searchTerms": [
    "standing desk",
    "budget app"
  ],
  "subreddits": [
    "webdev",
    "personalfinance"
  ],
  "maxPosts": 25,
  "includeComments": false,
  "onlyNew": false,
  "sort": "hot",
  "time": "week",
  "users": [
    "AutoModerator"
  ],
  "requireQueryTerms": false,
  "brands": [
    "HubSpot",
    "Pipedrive"
  ],
  "maxCommentsPerPost": 50,
  "includeNsfw": false,
  "summaryRow": true,
  "useArchive": true,
  "googleSearch": false,
  "activityDays": 0
}
```

# Actor output Schema

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

Post rows

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

Comment rows, when comments are on

## `subreddits` (type: `string`):

Free subreddit fact rows

## `summary` (type: `string`):

The free summary row

# 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/webdev/"
        }
    ]
};

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

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

```

## MCP server setup

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