# Reddit Posts Scraper (`vulnv/reddit-posts-scraper`) Actor

Unlimited Reddit web scraper to crawl posts, comments and subreddits without login.

- **URL**: https://apify.com/vulnv/reddit-posts-scraper.md
- **Developed by:** [VulnV](https://apify.com/vulnv) (community)
- **Categories:** Automation, Social media, News
- **Stats:** 386 total users, 3 monthly users, 100.0% runs succeeded, 17 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

$10.00/month + usage

To use this Actor, you pay a monthly rental fee to the developer. The rent is subtracted from your prepaid usage every month after the free trial period.You also pay for the Apify platform usage, which gets cheaper the higher Apify subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#rental-actors

## 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

## Reddit Posts Scraper: Extract Reddit Data Efficiently

### Overview

The **Reddit Posts Scraper** is a powerful tool designed to extract detailed post data from Reddit. Whether you're conducting sentiment analysis, monitoring trends, or gathering insights for research, this scraper enables efficient and accurate data collection from any subreddit.

### Features

- **Comprehensive Data Extraction**: Retrieve essential details such as:
  - Post title
  - Author
  - Creation timestamp
  - Number of comments
  - Score (upvotes)
  - Permalink
  - Image and thumbnail URLs (if available)
  - Post body content
  - Comments

- **Flexible Input Parameters**: Customize your scraping with options like:
  - Subreddit name
  - Post limit
  - Post category (hot, new, top, rising)
  - Time filter (hour, day, week, month, year, all)

- **Structured Output**: Export the collected data in JSON format for seamless integration with analytical tools.

### Usage

#### Input Configuration

The scraper accepts the following input parameters:

1. **Subreddit Name**:
   - Specify the subreddit you want to scrape.
   - Example:
     ```json
     {
       "subreddit_name": "worldnews",
        "limit": 10,
        "proxy_configuration": {
            "useApifyProxy": true,
            "apifyProxyGroups": [
                "RESIDENTIAL"
            ]
        }
     }
     ```

2. **Limit**:
   - Set the number of posts to scrape (minimum: 1, default: 1).

3. **Category**:
   - Choose from "hot", "new", "top", or "rising" posts.

4. **Time Filter**:
   - Specify a time range for "top" category posts (hour, day, week, month, year, all).

5. **Proxy Configuration**:
   - Enable or disable Apify proxy settings.
   - **It is recommended to enable proxies to avoid potential bans when scraping large amounts of data.**

#### Output Data

The scraper collects the following information:

- Title
- Author
- Created UTC timestamp
- Number of comments
- Score
- Permalink (direct link to the post)
- Image URL
- Thumbnail URL
- Post body text
- Comments (if available)

The output is stored in JSON format, allowing easy data processing.

### Quick Start

1. Install the scraper from the [Apify Marketplace](https://apify.com).
2. Configure the input parameters in the input schema.
3. Run the scraper and download the output in JSON format.

### Example Use Cases

- **Trend Monitoring**: Track the most popular discussions on specific subreddits.
- **Sentiment Analysis**: Analyze user sentiment based on post and comment content.
- **Content Aggregation**: Gather data for news feeds, blogs, or research purposes.
- **Competitive Analysis**: Monitor engagement and popularity of competitors' content.

### Output Storage

The scraper stores results in a structured dataset, allowing easy access to:

- Title
- URL
- Post metadata
- Comments
- Images (if applicable)

### Output Example

```json
{
  "title": "Major news event",
  "author": "reddit_user123",
  "created_utc": 1700000000,
  "num_comments": 256,
  "score": 1500,
  "permalink": "https://www.reddit.com/r/worldnews/comments/example",
  "image_url": "https://preview.redd.it/example.jpg",
  "thumbnail_url": "https://b.thumbs.redditmedia.com/example.jpg",
  "body": "This is the post content.",
  "comments": [
    {
      "author": "commenter1",
      "body": "Interesting perspective!",
      "score": 120
    },
    {
      "author": "commenter2",
      "body": "I disagree because...",
      "score": 85
    }
  ]
}
```

### Feedback and Support

For questions, feature requests, or support, visit the [Apify community forum](https://forum.apify.com) or contact us directly through the Apify platform.

### Explore More Actors

✨ **Looking for additional solutions?** Check out more actors on Apify that can help with your web automation and data extraction needs. Discover a wide range of tools tailored for different scenarios at 🌐 [Explore Vulnv's Actors on Apify](https://apify.com/vulnv).

📧 **Need higher volume, custom fields, or a managed data pipeline?** Email us at apify@vulnv.com — we build bespoke scrapers and managed feeds for teams. Questions and support welcome too.

# Actor input Schema

## `subreddit_name` (type: `string`):

The name of the subreddit to scrape

## `limit` (type: `integer`):

The number of posts to scrape

## `category` (type: `string`):

The category of posts to scrape

## `time_filter` (type: `string`):

The time filter for the posts

## `proxy_configuration` (type: `object`):

Select proxies to be used by your crawler.

## Actor input object example

```json
{
  "subreddit_name": "worldnews",
  "limit": 1,
  "category": "hot",
  "time_filter": "day",
  "proxy_configuration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

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

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

# Run the Actor and wait for it to finish
run = client.actor("vulnv/reddit-posts-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "proxy_configuration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call vulnv/reddit-posts-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=vulnv/reddit-posts-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/acts/AhEsMsQyLfHyMLaxz/builds/LsMEeY7dxa3kuEsff/openapi.json
