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

Scrape posts from any subreddit on Reddit. Get titles, body text, images, videos, upvotes, comment counts, flair, author info, crossposts, and thumbnails. Sort by hot, new, top, rising, or controversial. Filter by date and NSFW. Deep scrape all sorts at once. No login or cookies needed.

- **URL**: https://apify.com/scrapesmith/reddit-posts-scraper.md
- **Developed by:** [Scrape Smith](https://apify.com/scrapesmith) (community)
- **Categories:** Social media, Automation, Developer tools
- **Features:** Limited permissions
- **Stats:** 18 total users, 1 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.80 / 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.

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 Posts Scraper — Subreddit Posts and Community Data

Export public subreddit posts with titles, text, scores, comment counts, author names and available media. Compare communities, follow new discussions or collect top posts for research.

### Quick start

1. Open an example below or enter your own public Reddit targets.
2. Choose a per-target result limit and `maxItems` for the whole run.
3. Run the Actor and export the dataset as JSON, CSV or Excel.

```json
{
  "subreddits": [
    "Python"
  ],
  "sort": "new",
  "maxPostCount": 20,
  "maxItems": 20
}
```

### Example tasks

Copy a ready-to-use configuration and customize its targets or limits:

- [Monitor recent Python posts on Reddit](https://apify.com/scrapesmith/reddit-posts-scraper/examples/reddit-posts-monitor-python-posts)
- [Find top technology posts from the past week](https://apify.com/scrapesmith/reddit-posts-scraper/examples/reddit-posts-discover-top-technology-posts)
- [Research small business questions on Reddit](https://apify.com/scrapesmith/reddit-posts-scraper/examples/reddit-posts-research-small-business-questions)
- [Compare posts across developer communities](https://apify.com/scrapesmith/reddit-posts-scraper/examples/reddit-posts-compare-developer-communities)
- [Discover rising gaming discussions on Reddit](https://apify.com/scrapesmith/reddit-posts-scraper/examples/reddit-posts-track-rising-gaming-discussions)
- [Export public Reddit community metadata and posts](https://apify.com/scrapesmith/reddit-posts-scraper/examples/reddit-posts-export-community-metadata)

### Inputs

| Input | Type | Purpose |
|---|---|---|
| `subreddits` | array | Subreddit names to scrape (without the r/ prefix, e.g. 'python'). |
| `sort` | string | Sort order for posts. Ignored if 'Scrape all sorts' is enabled. |
| `time` | string | Time period for 'top' and 'controversial' sorts. |
| `maxPostCount` | integer | Maximum number of posts to collect per subreddit (per sort, if 'Scrape all sorts' is enabled). |
| `postDateLimit` | string | Only collect posts newer than this date (format YYYY-MM-DD). Leave empty to disable. Forces sort to 'new'. |
| `scrapeAllSorts` | boolean | Scrape every sort (hot, new, top for all time periods, controversial, rising) for each subreddit instead of just one sort. |
| `includeNSFW` | boolean | Include posts marked as NSFW/over 18. |
| `includeCommunityInfo` | boolean | Include one extra item per subreddit with community metadata (subscriber count, description, icons, etc.). Costs one additional request per subreddit. |
| `maxItems` | integer | Maximum total dataset rows across all inputs, including any profile, community or original-post rows. |

### Output fields

| Field | Description |
|---|---|
| `id` / `parsedId` | Reddit's internal post ID |
| `url` | Direct link to the post |
| `username` | Post author |
| `title` | Post title |
| `communityName` | Subreddit name (e.g. `r/python`) |
| `subredditSubscribers` | Subscriber count of the subreddit |
| `body` | Post text content (self-posts) |
| `html` | Rendered HTML of the post body |
| `link` | External link (for link posts) |
| `domain` | Source domain of the linked content |
| `numberOfComments` | Total comment count |
| `numberOfCrossposts` | Number of times the post was crossposted |
| `flair` | Post flair tag |
| `authorFlair` | Author's flair in the subreddit |
| `upVotes` / `upVoteRatio` | Post score and like ratio |
| `isSelf` / `isVideo` / `isStickied` / `isLocked` / `isSpoiler` / `isOriginalContent` | Post type flags |
| `over18` | NSFW flag |
| `videoUrl`, `videoDuration`, `videoWidth`, `videoHeight` | Video metadata (if applicable) |
| `thumbnailUrl`, `thumbnailWidth`, `thumbnailHeight` | Thumbnail metadata |
| `imageUrls` | Array of image URLs (galleries and previews) |
| `createdAt` | Post creation timestamp (ISO format) |
| `scrapedAt` | Time the data was scraped |
| `dataType` | `post` or `community` |

Optional fields depend on the record type and what Reddit makes public. Deleted authors, unavailable media and absent profile details can have empty values. Scores and comment counts are snapshots, not permanent totals.

### API, MCP and AI workflows

Use the Actor through the [Apify API](https://docs.apify.com/api/v2) or select it in the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp). An AI agent can supply the same JSON inputs shown above, then use the returned dataset for summarization, classification or research. Sentiment analysis and summaries are downstream tasks; this Actor returns source data.

Connect datasets to n8n, Make, Zapier or your own Python and JavaScript workflows. Use Apify schedules for recurring runs and webhooks to trigger processing after completion. ChatGPT, Claude and LangChain workflows can consume the exported data through their configured integrations.

### Limits and frequently asked questions

**Do I need a Reddit account?** No Reddit login or personal Reddit API key is required. Apify API calls require your own Apify token.

**How many results can I collect?** The free allowance is 25 dataset rows. Paid runs honor your input and platform result limits, with a 100,000-row dataset ceiling. Per-target limits do not override the total cap. Set your Apify run timeout and budget to suit the job.

**Does a requested maximum guarantee that many rows?** No. Public availability, source pagination, filtering, duplicate removal and deleted content can reduce the count. This is not a complete historical archive.

**Are results unique?** IDs are deduplicated across the inputs in a run. Separate new runs can return the same records; use their IDs when maintaining a historical database.

**Can bulk runs continue while producing results?** Yes. There is no fixed internal runtime, request-count or page-count cutoff. Requested result limits still apply. Repeated failures, unavailable data or pagination without progress stop collection while preserving confirmed results.

**What does resume mean?** Saved checkpoints support continuation of the same run. Starting a fresh run creates a new dataset and does not automatically resume an older run.

**What is the price?** Check the current Pricing tab on this Actor. Your plan, result allowance and run budget determine which limits apply.

# Actor input Schema

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

Subreddit names to scrape (without the r/ prefix, e.g. 'python').

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

Sort order for posts. Ignored if 'Scrape all sorts' is enabled.

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

Time period for 'top' and 'controversial' sorts.

## `maxPostCount` (type: `integer`):

Maximum number of posts to collect per subreddit (per sort, if 'Scrape all sorts' is enabled).

## `postDateLimit` (type: `string`):

Only collect posts newer than this date (format YYYY-MM-DD). Leave empty to disable. Forces sort to 'new'.

## `scrapeAllSorts` (type: `boolean`):

Scrape every sort (hot, new, top for all time periods, controversial, rising) for each subreddit instead of just one sort.

## `includeNSFW` (type: `boolean`):

Include posts marked as NSFW/over 18.

## `includeCommunityInfo` (type: `boolean`):

Include one extra item per subreddit with community metadata (subscriber count, description, icons, etc.). Costs one additional request per subreddit.

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

Hard cap on total items collected across all subreddits in this run.

## Actor input object example

```json
{
  "subreddits": [
    "python"
  ],
  "sort": "hot",
  "time": "day",
  "maxPostCount": 100,
  "scrapeAllSorts": false,
  "includeNSFW": false,
  "includeCommunityInfo": false,
  "maxItems": 5000
}
```

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

// Run the Actor and wait for it to finish
const run = await client.actor("scrapesmith/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 = { "subreddits": ["python"] }

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

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,scrapesmith/reddit-posts-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/8BCWASg3obvGgnnjq/builds/vOxypRTCRswIc0AxF/openapi.json
