# Reddit Subreddit Posts Scraper (`parsebird/reddit-subreddit-posts-scraper`) Actor

Scrape posts from any subreddit feed — hot, new, top, rising, or controversial — with the full Reddit post object, plus optional comments. One subreddit, a list, or a TXT/CSV file.

- **URL**: https://apify.com/parsebird/reddit-subreddit-posts-scraper.md
- **Developed by:** [ParseBird](https://apify.com/parsebird) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.29 / 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 Subreddit Posts Scraper

Reddit Subreddit Posts Scraper collects posts from any public [subreddit](https://www.reddit.com) feed — hot, new, top, rising, or controversial — and saves the full Reddit post object for each one, with optional comment threads.

<table><tr>
<td style="border-left:4px solid #FF4500;padding:12px 16px;font-weight:600">
Scrape up to 1,000 posts per subreddit from one community, a list, or a TXT/CSV file — about 97 raw Reddit fields per post (score, upvote ratio, comments, flair, media, awards, moderation flags) plus up to 1,000 comments per post with depth, parent ID, and reply counts.
</td>
</tr></table>

<br>

<table>
<tr>
<td colspan="3" style="padding:10px 14px;background:#FF4500;border:none;border-radius:4px 4px 0 0">
<span style="color:#FFFFFF;font-size:14px;font-weight:700;letter-spacing:0.5px">ParseBird Reddit Suite</span>
<span style="color:#FFD6C7;font-size:13px">&nbsp;&nbsp;&bull;&nbsp;&nbsp;Posts, comments &amp; subreddit data</span>
</td>
</tr>
<tr>
<td style="padding:10px 14px;border:1px solid #E7E5E4;border-radius:0 0 0 4px;border-right:none;border-top:none;vertical-align:top;width:33%;background:#FFFFFF">
<a href="https://apify.com/parsebird/reddit-search-scraper" style="color:#1C1917;text-decoration:none;font-weight:700;font-size:13px">Reddit Search Scraper</a><br>
<span style="color:#78716C;font-size:11px">Posts &amp; comments by keyword</span>
</td>
<td style="padding:10px 14px;border:1px solid #E7E5E4;border-right:none;border-top:none;vertical-align:top;width:33%;background:#FFFFFF">
<a href="https://apify.com/parsebird/reddit-comments-search-scraper" style="color:#1C1917;text-decoration:none;font-weight:700;font-size:13px">Reddit Comments Search Scraper</a><br>
<span style="color:#78716C;font-size:11px">Comments by keyword &amp; subreddit</span>
</td>
<td style="padding:10px 14px;border:1px solid #E7E5E4;border-radius:0 0 4px 0;border-top:none;vertical-align:top;width:33%;background:#FFF0EA">
<a href="https://apify.com/parsebird/reddit-subreddit-posts-scraper" style="color:#FF4500;text-decoration:none;font-weight:700;font-size:13px">Reddit Subreddit Posts Scraper</a><br>
<span style="color:#FF4500;font-size:11px;font-weight:600">You are here</span>
</td>
</tr>
</table>

##### Copy to your AI assistant

Copy this block into ChatGPT, Claude, Cursor, or any LLM to start using this actor.

```
Use the Apify actor "parsebird/reddit-subreddit-posts-scraper" to scrape posts from Reddit subreddit feeds. Call it with the apify-client package: client.actor("parsebird/reddit-subreddit-posts-scraper").call(run_input={"subreddit": "technology", "sort": "top", "timeFilter": "week", "maxPostsPerSubreddit": 100}), then read results from client.dataset(run["defaultDatasetId"]).iterate_items(). Inputs: subreddit (string, name or URL), subreddits (array of names or URLs), subredditsFile (string URL to a TXT or CSV file), sort ("hot" | "new" | "top" | "rising" | "controversial", default "hot"), timeFilter ("hour" | "day" | "week" | "month" | "year" | "all", default "all", used only by top and controversial), maxPostsPerSubreddit (integer 1-1000, default 100), includeComments (boolean, default false), maxCommentsPerPost (integer 1-1000, default 1000). At least one of subreddit, subreddits, subredditsFile is required. Post rows have _type "post", _subreddit, createdAt, editedAt, full_link and every field of Reddit's post object (title, author, score, ups, upvote_ratio, num_comments, created_utc, permalink, url, selftext, selftext_html, domain, is_self, over_18, spoiler, stickied, locked, link_flair_text, preview, media, gallery_data, media_metadata, post_hint, subreddit_subscribers and more). Comment rows have _type "comment", _post_id, _subreddit, id, author, score, depth, parentId, body, createdAt, editedAt, permalink, childCount, isDeleted, isRemoved, authorId, authorIcon. Pricing: pay per post and per comment. API docs: https://apify.com/parsebird/reddit-subreddit-posts-scraper/api — get an API token at https://console.apify.com/settings/integrations
```

### What is Reddit Subreddit Posts Scraper?

**Reddit Subreddit Posts Scraper** is a **subreddit scraper and Reddit API alternative** that reads subreddit feeds exactly the way Reddit sorts them and saves every post as structured data. Enter a subreddit such as `AskReddit`, choose **hot, new, top, rising, or controversial**, and get each post's **title, text, score, upvote ratio, comment count, flair, media, and author** — plus the post's comments if you want them.

The easiest way to try it: open the Input tab, keep `AskReddit`, and click **Start**. A run with the example input finishes in under a minute.

### What can Reddit Subreddit Posts Scraper do?

- 📰 **All five subreddit feeds** — hot, new, top, rising, and controversial, with hour-to-all-time windows for top and controversial.
- 📦 **Full Reddit post object** — every field Reddit's feed returns (about 97 on a text post, more on image, video, and gallery posts), minus a few viewer-only fields.
- 💬 **Optional comments** — up to 1,000 comments per post in thread order, including hidden "load more" replies, with `depth`, `parentId`, and `childCount` so you can rebuild the threads.
- 📋 **Bulk input** — one subreddit, a list, or an uploaded TXT/CSV file. Names, `r/` names, and full URLs all work and can be mixed.
- ⚡ **Parallel scraping** — several subreddits run at the same time.
- 🛑 **Clear errors** — private, banned, quarantined, Premium-only, and non-existent subreddits are skipped with a message, and the rest of the run continues.

Because it runs on the Apify platform, you also get:

- **Scheduling** — run it every hour or day with [Apify Schedules](https://docs.apify.com/platform/schedules) to monitor communities.
- **API access** — start runs and fetch results with the [Apify API](https://docs.apify.com/api/v2) or the Python and JavaScript clients.
- **Integrations** — send data to Google Sheets, Slack, Zapier, Make, n8n, or webhooks with [Apify integrations](https://docs.apify.com/platform/integrations).
- **Export formats** — download results as JSON, CSV, Excel, XML, or HTML.

### What data can you extract from a subreddit?

**Post rows** (`_type: "post"`) — the full post object from Reddit's feed, plus a few helper fields:

| Group | Fields |
|-------|--------|
| Helpers | `_type`, `_subreddit`, `_status`, `createdAt`, `editedAt`, `full_link` |
| Content and media | `title`, `selftext`, `selftext_html`, `url`, `url_overridden_by_dest`, `thumbnail`, `preview`, `media`, `secure_media`, `media_embed`, `gallery_data`, `media_metadata`, `post_hint`, `is_video`, `is_gallery` |
| Engagement | `score`, `ups`, `downs`, `upvote_ratio`, `num_comments`, `num_crossposts`, `total_awards_received`, `gilded`, `all_awardings` |
| Author and flair | `author`, `author_fullname`, `author_flair_text`, `author_premium`, `link_flair_text`, `link_flair_css_class`, `link_flair_richtext`, `link_flair_background_color` |
| Subreddit | `subreddit`, `subreddit_id`, `subreddit_name_prefixed`, `subreddit_type`, `subreddit_subscribers` |
| Moderation and status | `stickied`, `pinned`, `locked`, `archived`, `removed_by_category`, `distinguished`, `contest_mode` |
| IDs and links | `id`, `name`, `permalink`, `domain`, `created_utc`, `edited` |
| Flags | `over_18`, `spoiler`, `is_self`, `is_original_content`, `is_meta`, `is_crosspostable`, `is_robot_indexable`, `hide_score`, `no_follow`, `send_replies` |

Viewer-only fields that describe the logged-out visitor rather than the post (`saved`, `clicked`, `hidden`, `visited`, `likes`, report fields) are left out.

**Comment rows** (`_type: "comment"`, when **Include comments** is on):

| Field | Description |
|-------|-------------|
| `_post_id`, `_subreddit` | The post (`t3_…`) and subreddit the comment belongs to |
| `id`, `author`, `body`, `score` | Comment ID (`t1_…`), author (`null` if deleted), Markdown text, and score |
| `depth`, `parentId` | Nesting level (0 = top-level) and parent comment ID (`null` for top-level) |
| `childCount` | Direct replies Reddit returned or listed for the comment |
| `createdAt`, `editedAt`, `permalink` | Dates (ISO 8601, UTC) and link |
| `isStickied`, `isLocked`, `isScoreHidden`, `distinguishedAs`, `isArchived` | Moderation and status flags |
| `isDeleted`, `isRemoved`, `isInitiallyCollapsed`, `collapsedReason` | Deleted, removed, and collapsed state |
| `isOP` | Whether the commenter wrote the post |
| `authorId`, `authorAccountType`, `authorFlair`, `authorIcon`, `authorIsCakeDay` | Author details |
| `controversiality`, `totalAwardsReceived` | Reddit's controversy flag and awards |

### How to scrape a subreddit

1. Open [Reddit Subreddit Posts Scraper](https://apify.com/parsebird/reddit-subreddit-posts-scraper) and go to the **Input** tab.
2. Enter a **Subreddit** (for example `technology`), add several under **Subreddits**, or upload a **Subreddits file**.
3. Choose **Sort by**. For Top or Controversial, pick a **Time filter**.
4. Set **Max posts per subreddit**.
5. Optionally turn on **Include comments** and set **Max comments per post**.
6. Click **Start**, then download the data from the **Output** tab as JSON, CSV, or Excel.

### Input parameters

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| `subreddit` | string | One of the three | — | A subreddit name or URL |
| `subreddits` | array | One of the three | `[]` | Several subreddit names or URLs |
| `subredditsFile` | string | One of the three | — | Uploaded or hosted TXT (one per line) or CSV (`subreddit`, `sub` or `name` column, otherwise the first column) |
| `sort` | string | No | `hot` | `hot`, `new`, `top`, `rising`, `controversial` |
| `timeFilter` | string | No | `all` | `hour`, `day`, `week`, `month`, `year`, `all` — only for top and controversial |
| `maxPostsPerSubreddit` | integer | No | `100` | Posts per subreddit (1–1,000) |
| `includeComments` | boolean | No | `false` | Also save each post's comments |
| `maxCommentsPerPost` | integer | No | `1000` | Comments per post (1–1,000) |
| `proxyConfiguration` | object | No | Residential Apify Proxy | Network settings. Keep the default |

**Sort orders:** `hot` is Reddit's default mix of recency and activity; `new` is newest first; `top` is highest score in the time window; `rising` is posts gaining traction right now (a short feed, usually about 25 posts); `controversial` is posts with a close split of upvotes and downvotes.

### Input examples

**Top posts of the past week:**

```json
{ "subreddit": "technology", "sort": "top", "timeFilter": "week", "maxPostsPerSubreddit": 200 }
```

**Rising posts to catch trends early:**

```json
{ "subreddit": "wallstreetbets", "sort": "rising" }
```

**Posts with comments:**

```json
{
    "subreddit": "AskReddit",
    "sort": "top",
    "timeFilter": "day",
    "maxPostsPerSubreddit": 50,
    "includeComments": true,
    "maxCommentsPerPost": 200
}
```

**Several subreddits in one run:**

```json
{
    "subreddits": ["AskReddit", "r/technology", "https://www.reddit.com/r/science"],
    "sort": "hot",
    "maxPostsPerSubreddit": 100
}
```

**Bulk from a file:**

```json
{ "subredditsFile": "https://example.com/my-subreddits.csv", "sort": "new", "maxPostsPerSubreddit": 500 }
```

**Most controversial posts of all time:**

```json
{ "subreddit": "unpopularopinion", "sort": "controversial", "timeFilter": "all", "maxPostsPerSubreddit": 100 }
```

### Output example

A post row (the most-used fields shown; the full row has about 97 fields):

```json
{
    "_type": "post",
    "_subreddit": "AskReddit",
    "_status": "found",
    "title": "Mike Tyson once said \"social media made people too comfortable disrespecting others and not getting punched in the face for it\" What’s a real-life example of someone learning that lesson?",
    "author": "Famism316",
    "score": 18959,
    "upvote_ratio": 0.94,
    "num_comments": 2630,
    "createdAt": "2026-09-27T12:29:58.000Z",
    "editedAt": null,
    "created_utc": 1790512198.0,
    "permalink": "/r/AskReddit/comments/1wrj0s2/mike_tyson_once_said_social_media_made_people_too/",
    "full_link": "https://www.reddit.com/r/AskReddit/comments/1wrj0s2/mike_tyson_once_said_social_media_made_people_too/",
    "url": "https://www.reddit.com/r/AskReddit/comments/1wrj0s2/mike_tyson_once_said_social_media_made_people_too/",
    "selftext": "",
    "domain": "self.AskReddit",
    "is_self": true,
    "over_18": false,
    "spoiler": false,
    "stickied": false,
    "locked": false,
    "num_crossposts": 2,
    "subreddit_subscribers": 59745441,
    "link_flair_text": null,
    "name": "t3_1wrj0s2",
    "id": "1wrj0s2"
}
```

A comment row:

```json
{
    "_type": "comment",
    "_post_id": "t3_1wrj0s2",
    "_subreddit": "AskReddit",
    "_status": "found",
    "id": "t1_pcd2mid",
    "author": "FuzzyMcBitty",
    "score": 11922,
    "depth": 0,
    "parentId": null,
    "body": "Buzz Aldrin punching a moon landing denier. \n\nhttps://www.history.com/this-day-in-history/september-9/buzz-aldrin-punches-moon-landing-conspiracy-theorist-bart-sibrel",
    "createdAt": "2026-09-27T13:24:58.000Z",
    "editedAt": null,
    "permalink": "/r/AskReddit/comments/1wrj0s2/mike_tyson_once_said_social_media_made_people_too/pcd2mid/",
    "isStickied": false,
    "isLocked": false,
    "isScoreHidden": false,
    "distinguishedAs": null,
    "authorFlair": null,
    "isDeleted": false,
    "childCount": 39,
    "authorId": "t2_561ct",
    "authorAccountType": "USER",
    "authorIsCakeDay": false,
    "authorIcon": "https://www.redditstatic.com/avatars/defaults/v2/avatar_default_5.png",
    "isArchived": false,
    "isRemoved": false,
    "isOP": false,
    "isInitiallyCollapsed": false,
    "collapsedReason": null,
    "controversiality": 0,
    "totalAwardsReceived": 0
}
```

### Use Reddit Subreddit Posts Scraper via API

**Python** ([apify-client](https://docs.apify.com/api/client/python)):

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_APIFY_TOKEN>")

run = client.actor("parsebird/reddit-subreddit-posts-scraper").call(run_input={
    "subreddits": ["technology", "science"],
    "sort": "top",
    "timeFilter": "week",
    "maxPostsPerSubreddit": 100,
    "includeComments": True,
    "maxCommentsPerPost": 50,
})

for row in client.dataset(run["defaultDatasetId"]).iterate_items():
    if row["_type"] == "post":
        print(row["_subreddit"], row["score"], row["title"][:80])
```

**JavaScript** ([apify-client](https://docs.apify.com/api/client/js)):

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: '<YOUR_APIFY_TOKEN>' });

const run = await client.actor('parsebird/reddit-subreddit-posts-scraper').call({
    subreddits: ['technology', 'science'],
    sort: 'top',
    timeFilter: 'week',
    maxPostsPerSubreddit: 100,
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.filter((r) => r._type === 'post').forEach((p) => console.log(p._subreddit, p.score, p.title));
```

### Use cases for subreddit data

- **Community monitoring** — schedule `new` or `rising` to catch fresh posts in the subreddits your brand or market lives in.
- **Trend and content research** — pull the top posts of the week or month to see what a community cares about.
- **Sentiment and NLP datasets** — collect posts and full comment threads for classification, summarization, or LLM evaluation.
- **Competitive research** — compare engagement across competing communities.
- **Moderation and community analytics** — track stickied, locked, removed, and controversial posts over time.

### How it works

1. The scraper reads each subreddit's public feed in pages of up to 100 posts, in the sort order and time window you chose.
2. Several subreddits are processed in parallel. Each post is saved as it arrives.
3. When **Include comments** is on, a second pass loads each post's comment thread (skipping posts with no comments), expands hidden replies, adds author details, and saves the comments in thread order.

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

Reddit Subreddit Posts Scraper uses **pay-per-event** pricing with two events. Comments are charged only when you turn them on.

| Event | Apify plan | Price per event | Price per 1,000 |
|-------|-----------|----------------|-----------------|
| `post-scraped` | Free | $0.00189 | **$1.89** |
| `post-scraped` | Bronze | $0.00169 | **$1.69** |
| `post-scraped` | Silver | $0.00149 | **$1.49** |
| `post-scraped` | Gold | $0.00129 | **$1.29** |
| `comment-scraped` | Free | $0.00089 | **$0.89** |
| `comment-scraped` | Bronze | $0.00079 | **$0.79** |
| `comment-scraped` | Silver | $0.00069 | **$0.69** |
| `comment-scraped` | Gold | $0.00059 | **$0.59** |

For example, 100 posts with up to 50 comments each (5,000 comments) cost about $0.19 + $4.45 = $4.64 on the Free plan. The Apify Free plan includes monthly platform credits you can use to try it, and you can set a maximum spend per run so the scraper stops at your budget.

### FAQ

**How many posts can I get from one subreddit?**
Up to 1,000 per feed — that is where Reddit's own listings stop. `rising` is much shorter (usually about 25 posts), and `top`/`controversial` with a short window only return the posts from that window.

**Does the time filter work with hot, new, or rising?**
No. Reddit only supports time windows on `top` and `controversial`, so the filter is ignored for the other feeds.

**Which comments are included?**
Comments are loaded in Reddit's "top" order and saved in thread order (each comment followed by its replies), including replies hidden behind "load more comments", until `maxCommentsPerPost` is reached. Very deep "continue this thread" branches are not expanded.

**Why was a subreddit skipped?**
Reddit refuses logged-out access to private, banned, quarantined, and Premium-only communities. The run log and status message say which ones were skipped and why; the other subreddits are still scraped.

**What file formats work for bulk input?**
A `.txt` file with one subreddit per line, or a `.csv` file with a `subreddit`, `sub`, or `name` column (otherwise the first column is used). Upload it in the Console or paste a link to a hosted file.

**Can I schedule it or use it from my code and AI tools?**
Yes. Save your input as a [task](https://docs.apify.com/platform/actors/running/tasks), add a [schedule](https://docs.apify.com/platform/schedules), and connect [integrations](https://docs.apify.com/platform/integrations). Developers can use the [API tab](https://apify.com/parsebird/reddit-subreddit-posts-scraper/api), and AI agents can call it through the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp).

**Something doesn't work or you need a feature?**
Open an issue in the [Issues tab](https://apify.com/parsebird/reddit-subreddit-posts-scraper/issues). We read and answer every report.

### Is it legal to scrape Reddit?

This scraper only collects publicly available posts and comments that anyone can see without logging in. It does not access private or restricted communities, private messages, or account data. Results can include personal data such as usernames, which regulations like the GDPR protect. Only collect personal data when you have a legitimate reason, and check Reddit's terms and your local laws if you are unsure. Read more in Apify's post [Is web scraping legal?](https://blog.apify.com/is-web-scraping-legal/).

### Other Reddit scrapers by ParseBird

- [Reddit Search Scraper](https://apify.com/parsebird/reddit-search-scraper) — search Reddit posts and comments by keyword across all of Reddit
- [Reddit Comments Search Scraper](https://apify.com/parsebird/reddit-comments-search-scraper) — find comments that mention a keyword, with a rolling age filter
- [Threads Search Scraper](https://apify.com/parsebird/threads-search-scraper) — search Threads posts by keyword
- [Bluesky Posts Scraper](https://apify.com/parsebird/bluesky-posts-scraper) — collect Bluesky posts

# Changelog

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

# Actor input Schema

## `subreddit` (type: `string`):

Enter one subreddit. Any format works: <code>AskReddit</code>, <code>r/AskReddit</code>, or <code>https://www.reddit.com/r/AskReddit</code>.

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

Add several subreddits (names or URLs, mixed freely). Use Bulk edit to paste a list. They are scraped in parallel.

## `subredditsFile` (type: `string`):

Upload a .txt file (one subreddit per line) or a .csv file (a <code>subreddit</code>, <code>sub</code> or <code>name</code> column, otherwise the first column), or paste a URL to a hosted file.

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

Choose the subreddit feed to scrape.

## `timeFilter` (type: `string`):

Choose the time window for Top and Controversial. Ignored for Hot, New, and Rising.

## `maxPostsPerSubreddit` (type: `integer`):

Set the most posts to save from each subreddit (1–1,000). Reddit feeds stop at about 1,000 posts.

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

Also save the top comments of every post (charged separately per comment).

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

Set the most comments to save per post when comments are on (1–1,000).

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

Proxy servers used to reach Reddit. Reddit blocks most datacenter IPs, so residential Apify Proxy is the default and recommended.

## Actor input object example

```json
{
  "subreddit": "AskReddit",
  "subreddits": [],
  "sort": "hot",
  "timeFilter": "all",
  "maxPostsPerSubreddit": 25,
  "includeComments": false,
  "maxCommentsPerPost": 1000,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# 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 = {
    "subreddit": "AskReddit",
    "sort": "hot",
    "maxPostsPerSubreddit": 25,
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("parsebird/reddit-subreddit-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 = {
    "subreddit": "AskReddit",
    "sort": "hot",
    "maxPostsPerSubreddit": 25,
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

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

```

## MCP server setup

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