# Reddit Post Comments (`datamagnet/reddit-comments-fetcher`) Actor

Fetch and organize comments from any Reddit post into a clean, easy-to-read list. Choose the comment order and return the main comment details in a simple table-like format.

- **URL**: https://apify.com/datamagnet/reddit-comments-fetcher.md
- **Developed by:** [Datamagnet](https://apify.com/datamagnet) (community)
- **Categories:** Social media
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.00 / 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.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

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

Get the comments from any Reddit post in a clean, easy-to-read list.

### What it does

- Pulls the comments from the Reddit post you provide.
- Lets you choose how the comments are ordered, so you can see the newest, top, or most relevant ones first.
- Shows the main comment details in a simple table-like format.
- Can return just a few comments or more, depending on what you need.
- Keeps the output tidy and easy to scan.

### Use cases

- Check how people are reacting to a news story, product launch, or announcement in the comments.
- Review the top replies on a discussion thread to quickly understand the main opinions.
- Collect comment text, scores, and reply structure for research, moderation, or content analysis.

### Input

| Field | Description | Required | Example |
|---|---|---:|---|
| Reddit post URL | The full URL of the Reddit post you want comments from. | Yes | https://www.reddit.com/r/AskReddit/comments/ablzuq/people\_who\_have\_been\_to\_prison\_what\_is\_it\_really/ |
| Sort order | Choose how the comments should be ordered. | Yes | new |
| Max results | Maximum number of comments to fetch. | No | 10 |

### Output

| Field | Description |
|---|---|
| all\_awardings | Any awards attached to the comment. |
| approved\_at\_utc | When the comment was approved, in UTC, if available. |
| approved\_by | The moderator or user who approved the comment, if available. |
| archived | Whether the comment is archived and no longer editable. |
| associated\_award | The award linked to the comment, if any. |
| author | The username of the commenter. |
| author\_flair\_background\_color | The background color of the author's flair, if set. |
| author\_flair\_css\_class | The flair CSS class, if set. |
| author\_flair\_richtext | Rich text flair details for the author, if available. |
| author\_flair\_template\_id | The flair template ID, if available. |
| author\_flair\_text | The text shown in the author's flair, if any. |
| author\_flair\_text\_color | The text color used for the author's flair. |
| author\_flair\_type | The type of flair shown on the author profile. |
| author\_fullname | The internal Reddit user ID for the author, if available. |
| author\_is\_blocked | Whether the author is blocked. |
| author\_patreon\_flair | Whether the author has a special supporter flair. |
| author\_premium | Whether the author has premium status. |
| awarders | Users who gave awards to the comment. |
| banned\_at\_utc | When the comment was banned, in UTC, if available. |
| banned\_by | The moderator or user who banned the comment, if available. |
| body | The full text of the comment. |
| body\_html | The HTML version of the comment text. |
| can\_gild | Whether the comment can receive gilding. |
| can\_mod\_post | Whether moderators can act on the comment. |
| collapsed | Whether the comment is collapsed. |
| collapsed\_because\_crowd\_control | Whether crowd control caused the collapse. |
| collapsed\_reason | The reason the comment is collapsed, if available. |
| collapsed\_reason\_code | A short code for why the comment is collapsed, if available. |
| comment\_type | The type of comment, if available. |
| controversiality | A score showing how controversial the comment is. |
| created | The comment creation time as a Unix timestamp. |
| created\_utc | The comment creation time in UTC as a Unix timestamp. |
| depth | How deep the comment is in the thread. |
| distinguished | Whether the comment is distinguished, such as by a moderator. |
| downs | The number of downvotes recorded for the comment. |
| edited | Whether the comment was edited after posting. |
| gilded | How many times the comment was gilded. |
| gildings | Details about any gildings on the comment. |
| id | The unique ID of the comment. |
| is\_submitter | Whether the commenter is also the original post author. |
| likes | The user's like status for the comment, if available. |
| link\_id | The ID of the Reddit post the comment belongs to. |
| locked | Whether the comment thread is locked. |
| mod\_note | Any moderator note attached to the comment. |
| mod\_reason\_by | Who set the moderation reason, if available. |
| mod\_reason\_title | The title of the moderation reason, if available. |
| mod\_reports | Any moderator reports on the comment. |
| name | The full Reddit name for the comment. |
| no\_follow | Whether replies are disabled for the comment. |
| num\_reports | The number of reports on the comment, if available. |
| parent\_id | The ID of the parent comment or post. |
| permalink | The direct link to the comment. |
| removal\_reason | The reason the comment was removed, if available. |
| report\_reasons | The reasons the comment was reported, if available. |
| saved | Whether the comment was saved by the user. |
| score | The comment score. |
| score\_hidden | Whether the score is hidden. |
| send\_replies | Whether replies are enabled for the comment. |
| stickied | Whether the comment is pinned to the thread. |
| subreddit | The subreddit where the comment was posted. |
| subreddit\_id | The internal ID of the subreddit. |
| subreddit\_name\_prefixed | The subreddit name with the r/ prefix. |
| subreddit\_type | The type of subreddit, such as public. |
| top\_awarded\_type | The type of top award, if any. |
| total\_awards\_received | The total number of awards received. |
| treatment\_tags | Any moderation treatment tags on the comment. |
| unrepliable\_reason | The reason the comment cannot be replied to, if available. |
| ups | The number of upvotes recorded for the comment. |
| user\_reports | Any user reports on the comment. |

### Sample output

```json
{
  "all_awardings": [],
  "approved_at_utc": null,
  "approved_by": null,
  "archived": true,
  "associated_award": null,
  "author": "HACKERB22015",
  "author_flair_background_color": null,
  "author_flair_css_class": null,
  "author_flair_richtext": [],
  "author_flair_template_id": null,
  "author_flair_text": null,
  "author_flair_text_color": null,
  "author_flair_type": "text",
  "author_fullname": "t2_7wta0av2",
  "author_is_blocked": false,
  "author_patreon_flair": false,
  "author_premium": false,
  "awarders": [],
  "banned_at_utc": null,
  "banned_by": null,
  "body": "WHAT I CAN COMMENT- WHAT THE FUUUUUUUUUUUUUUUUUUUUUUU",
  "body_html": "&lt;div class=\"md\"&gt;&lt;p&gt;WHAT I CAN COMMENT- WHAT THE FUUUUUUUUUUUUUUUUUUUUUUU&lt;/p&gt;\n&lt;/div&gt;",
  "can_gild": false,
  "can_mod_post": false,
  "collapsed": false,
  "collapsed_because_crowd_control": null,
  "collapsed_reason": null,
  "collapsed_reason_code": null,
  "comment_type": null,
  "controversiality": 0,
  "created": 1634330161,
  "created_utc": 1634330161,
  "depth": 0,
  "distinguished": null,
  "downs": 0,
  "edited": false,
  "gilded": 0,
  "gildings": {},
  "id": "hgs7jk8",
  "is_submitter": false,
  "likes": null,
  "link_id": "t3_ablzuq",
  "locked": false,
  "mod_note": null,
  "mod_reason_by": null,
  "mod_reason_title": null,
  "mod_reports": [],
  "name": "t1_hgs7jk8",
  "no_follow": false,
  "num_reports": null,
  "parent_id": "t3_ablzuq",
  "permalink": "/r/AskReddit/comments/ablzuq/people_who_havent_pooped_in_2019_yet_why_are_you/hgs7jk8/",
  "removal_reason": null,
  "report_reasons": null,
  "saved": false,
  "score": 4,
  "score_hidden": false,
  "send_replies": true,
  "stickied": false,
  "subreddit": "AskReddit",
  "subreddit_id": "t5_2qh1i",
  "subreddit_name_prefixed": "r/AskReddit",
  "subreddit_type": "public",
  "top_awarded_type": null,
  "total_awards_received": 0,
  "treatment_tags": [],
  "unrepliable_reason": null,
  "ups": 4,
  "user_reports": []
}
```

# Actor input Schema

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

How the comments should be ordered.

## `post_url` (type: `string`):

The full URL of the Reddit post you want comments from.

## `max_results` (type: `integer`):

Maximum number of comments to fetch.

## Actor input object example

```json
{
  "sort": "new",
  "post_url": "https://www.reddit.com/r/AskReddit/comments/ablzuq/people_who_have_been_to_prison_what_is_it_really/",
  "max_results": 10
}
```

# 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 = {
    "sort": "new",
    "post_url": "https://www.reddit.com/r/AskReddit/comments/ablzuq/people_who_have_been_to_prison_what_is_it_really/"
};

// Run the Actor and wait for it to finish
const run = await client.actor("datamagnet/reddit-comments-fetcher").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 = {
    "sort": "new",
    "post_url": "https://www.reddit.com/r/AskReddit/comments/ablzuq/people_who_have_been_to_prison_what_is_it_really/",
}

# Run the Actor and wait for it to finish
run = client.actor("datamagnet/reddit-comments-fetcher").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 '{
  "sort": "new",
  "post_url": "https://www.reddit.com/r/AskReddit/comments/ablzuq/people_who_have_been_to_prison_what_is_it_really/"
}' |
apify call datamagnet/reddit-comments-fetcher --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/NfMMPbcQtkfVEM3Zr/builds/7mwC9dhhVlqdZOL03/openapi.json
