# Reddit Scraper — Posts, Search & Subreddits (`automly/reddit-scraper`) Actor

Being retired: please use Reddit Scraper - Posts, Comments, Users, Subreddits & Search (apify.com/automly/reddit-ultimate-scraper). It does everything this actor does and more. Your current runs keep working for now.

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

## Pricing

$1.30 / 1,000 post produceds

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 Scraper - Posts, Search & Subreddits

> **This actor is being retired.** Please switch to **[Reddit Scraper - Posts, Comments, Users, Subreddits & Search](https://apify.com/automly/reddit-ultimate-scraper)**. It does everything this actor does (subreddit posts by hot, new, top or rising, and keyword search inside one or more subreddits) and adds comments, user profiles and Reddit-wide search. Your current runs, schedules and integrations keep working for now.

### What is Reddit Scraper?

**Reddit Scraper** is a tool that lets you **scrape posts from Reddit subreddits**: title, author, score, upvote ratio, comment count, post text, link, flair, date and media. Add subreddits, click **Start**, and download the posts as Excel, CSV or JSON.

- 🔍 **Search inside subreddits:** get only the posts that match your keyword
- 📊 **Four feeds:** hot, new, top of all time or rising
- 🔓 **No login:** no Reddit account, cookies or API key needed
- 💸 **Free to try:** the $5 of free usage every Apify account gets each month covers about 3,800 posts

### What can Reddit Scraper do?

- Scrape posts from any public subreddit
- Scrape **several subreddits** in one run
- Get the **hot, new, top or rising** posts of a subreddit
- Search Reddit posts by **keyword inside a subreddit**
- Get up to **1,000 posts from each subreddit**
- Get each post's score, upvote ratio and number of comments
- Download Reddit posts to Excel, CSV, JSON, HTML or XML, or send them to Google Sheets, Make, Zapier and more

### What data can you extract from Reddit posts?

| | | |
|---|---|---|
| 📝 Post title | 📄 Post text | 👤 Author username |
| ⬆️ Score | 📈 Upvote ratio | 💬 Number of comments |
| 📅 Publish date | 🏷️ Flair | 🔗 Post link and linked URL |
| 🌐 Domain | 🖼️ Thumbnail, preview and gallery images | 🎥 Video post flag |
| 🔞 NSFW and spoiler flags | 📌 Pinned and locked flags | 🏆 Awards |
| 🛡️ Moderator flag | 🏠 Subreddit name and ID | 🆔 Post ID |

### How to scrape Reddit posts

1. [Create a free Apify account](https://console.apify.com/sign-up) (no credit card needed).
2. Open **Reddit Scraper**.
3. Add one or more **subreddits**, for example `python` or `technology`.
4. Pick a sort order, add a keyword if you want to search, set how many posts you want, then click **Start**.
5. When the run finishes, download your posts as Excel, CSV, JSON, HTML or XML.

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

Reddit Scraper costs **$1.30 per 1,000 posts**. You pay only for the posts you get, and the same post is never charged twice in a run.

For example, **1,000 posts cost $1.30**, and 100 posts from each of 5 subreddits (500 posts) cost $0.65.

Every Apify account gets **$5 of free usage each month**, which covers about 3,800 posts. See the **Pricing** tab for the details.

### ⬇️ Input

Add subreddits as a name (`python`), with the prefix (`r/python`) or as a full link (`https://www.reddit.com/r/python/`).

| Setting | What it does |
|---|---|
| Subreddits | The subreddits to scrape (required) |
| Sort By | Hot (default), New, Top (all time) or Rising |
| Search Query | Only posts that match this keyword, searched inside each subreddit and ranked by relevance. Leave it empty to get the normal feed |
| Max Posts | How many posts to get from each subreddit, from 1 to 1,000 (default 100) |

Example: the 10 hottest posts from two subreddits.

```json
{
  "subreddits": ["python", "technology"],
  "sortBy": "hot",
  "maxPosts": 10
}
```

Example: posts about FastAPI in r/python.

```json
{
  "subreddits": ["python"],
  "searchQuery": "fastapi",
  "maxPosts": 200
}
```

### ⬆️ Output

You get one row per post. You can view the rows as a table in Apify Console or download them as Excel, CSV, JSON, HTML or XML. Here is a real row (text shortened):

```json
{
  "postId": "1wv4f0d",
  "title": "New Python releases are out, 3.10.x reaches EOL, (and 3.15.0 is scheduled for today)!",
  "author": "initcommit",
  "subreddit": "Python",
  "subredditId": "t5_2qh0y",
  "score": 33,
  "upvoteRatio": 0.93,
  "numComments": 11,
  "createdUtc": 1790872964,
  "permalink": "/r/Python/comments/1wv4f0d/new_python_releases_are_out_310x_reaches_eol_and/",
  "url": "https://www.reddit.com/r/Python/comments/1wv4f0d/new_python_releases_are_out_310x_reaches_eol_and/",
  "selftext": "The new releases announced today, including EOL for 3.10.x: ...",
  "isSelf": true,
  "isVideo": false,
  "isNSFW": false,
  "linkFlairText": "News",
  "domain": "self.Python",
  "stickied": false,
  "postHint": "self"
}
```

Each row also has `isSpoiler`, `locked`, `distinguished`, `thumbnail`, `preview`, `mediaMetadata`, `galleryData`, `gilded`, `gildings` and `totalAwardsReceived`. `createdUtc` is the publish time in seconds since 1 January 1970 (UTC). `url` is the post itself for text posts, or the page the post links to for link posts. A post that shows up in more than one place is saved once.

Each run also saves a short report that lists any subreddit it could not scrape, with the reason (for example, a private or banned subreddit).

### How can I use Reddit posts data?

- **Market research:** see what a community talks about, asks for and complains about
- **Brand monitoring:** search subreddits for your brand, product or competitors
- **Content ideas:** find the top posts of all time in your niche and what made them work
- **Trend tracking:** follow the new and rising posts of a subreddit as they appear
- **Sentiment analysis and AI:** build post datasets for topic, sentiment or trend analysis
- **Community analysis:** compare scores, comment counts and flairs across subreddits

### How to monitor new Reddit posts

1. Set **Sort By** to **New**.
2. Set **Max Posts** to about the number of posts the subreddit gets between two runs.
3. [Schedule the actor](https://docs.apify.com/platform/schedules) to run every hour or every day.

Each run gives you the newest posts, ready to send to Slack, email or a spreadsheet with an [integration](https://apify.com/integrations).

### Use it from your own code

You can run Reddit Scraper with the [Apify API](https://docs.apify.com/api/v2) or the Python and JavaScript clients:

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_API_TOKEN>")
run = client.actor("automly/reddit-scraper").call(run_input={
    "subreddits": ["python", "technology"],
    "sortBy": "top",
    "maxPosts": 100,
})
for post in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(post["score"], post["title"])
```

### Scrape more Reddit data

| Actor | What it does |
|---|---|
| [Reddit Scraper - Posts, Comments, Users, Subreddits & Search](https://apify.com/automly/reddit-ultimate-scraper) | The all-in-one Reddit scraper: posts, full comment threads, user profiles, subreddits and search |
| [Reddit Comments Scraper - Post Threads & Subreddits](https://apify.com/automly/reddit-comment-scraper) | All the comments and replies of Reddit posts, or of the posts in a subreddit |
| [Reddit Keyword + Comment Thread Monitor](https://apify.com/automly/reddit-keyword-comment-monitor) | Posts and comments that mention your keywords, across the subreddits you choose |

### ❓FAQ

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

$1.30 per 1,000 posts, and you pay only for the posts you get. Every Apify account gets $5 of free usage each month. See [the cost section above](#how-much-does-it-cost-to-scrape-reddit-posts) and the **Pricing** tab.

#### How many posts can I scrape from one subreddit?

Up to 1,000 posts from each subreddit in one run. Set **Max Posts** to the number you need. A small subreddit or a narrow search can give fewer posts than that, and Reddit ends a keyword search at 300 posts per subreddit.

#### Can I get the top posts of this week or this month?

Not with this actor. **Top** gives the top posts of all time, and keyword searches cover all time too. To get the newest posts, use **New**.

#### Can I scrape the comments of these posts?

Not with this actor, which gets posts only. Use [Reddit Comments Scraper](https://apify.com/automly/reddit-comment-scraper) for comments and replies, or the [all-in-one Reddit Scraper](https://apify.com/automly/reddit-ultimate-scraper) for posts and comments together.

#### Do I need a Reddit account or API key?

No. You don't need a Reddit account, cookies or a Reddit API key.

#### Can I scrape private subreddits?

No. Only public subreddits can be scraped. Private, banned or quarantined subreddits and subreddits that don't exist are skipped and listed in the run report with the reason.

#### Can I connect Reddit Scraper to other tools or AI agents?

Yes. You can start runs and read the results with the Apify API or the Python and JavaScript clients. You can also send the posts to Make, Zapier, n8n, Google Sheets or Slack, or call a webhook when a run finishes, with [Apify integrations](https://apify.com/integrations). AI assistants and agents can use Reddit Scraper through the [Apify MCP server](https://mcp.apify.com).

#### Is it legal to scrape Reddit?

This scraper only collects posts that people chose to publish in public subreddits. It does not collect private data such as email addresses or phone numbers. Posts can still contain personal data, which may be protected by laws such as GDPR, so only scrape it for a legitimate reason and ask a lawyer if you are unsure. You can read more in [Is web scraping legal?](https://blog.apify.com/is-web-scraping-legal/)

Reddit Scraper is an independent tool. It is not affiliated with, endorsed by or sponsored by Reddit.

#### Something isn't working. What should I do?

Open the **Issues** tab and tell us the subreddit, your settings and what you expected.

### ⭐ Your feedback

Have an idea or found a problem? Tell us on the **Issues** tab. If Reddit Scraper saved you time, a short review on the **Reviews** tab helps other people find it.

# Actor input Schema

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

List of subreddits to scrape (e.g. \['python', 'machinelearning'])

## `sortBy` (type: `string`):

How to sort posts

## `searchQuery` (type: `string`):

Optional keyword search within subreddits. Leave empty to fetch all posts.

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

Maximum number of posts to return (1-1000)

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

Proxy servers used to reach Reddit. The default works for most runs.

## Actor input object example

```json
{
  "subreddits": [
    "python",
    "technology"
  ],
  "sortBy": "hot",
  "maxPosts": 100,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

## `records` (type: `string`):

All posts produced by this run.

# 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": [
        "python",
        "technology"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("automly/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": [
        "python",
        "technology",
    ],
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("automly/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": [
    "python",
    "technology"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call automly/reddit-scraper --silent --output-dataset

```

## MCP server setup

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