# Example: a Reddit post with its first 50 comments

**Use case:** 

Runs the Reddit Comments Scraper on one post and returns the post with the first 50 comments of its thread as JSON.

## Input

```json
{
  "postUrls": [
    "https://www.reddit.com/r/learnpython/comments/1rahj9l/what_is_the_most_complex_thing_you_have_ever_coded/"
  ],
  "maxComments": 50,
  "sort": "best",
  "includePost": true,
  "commentedAfter": "2026-01-01",
  "commentedBefore": "2026-06-01",
  "includeNSFW": false,
  "startUrls": [
    {
      "url": "https://www.reddit.com/r/learnpython/comments/1rahj9l/what_is_the_most_complex_thing_you_have_ever_coded/"
    }
  ],
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

## Output

```json
{
  "type": {
    "label": "Row type",
    "format": "string"
  },
  "id": {
    "label": "ID",
    "format": "string"
  },
  "postId": {
    "label": "Post ID",
    "format": "string"
  },
  "depth": {
    "label": "Depth",
    "format": "integer"
  },
  "parentId": {
    "label": "Parent ID",
    "format": "string"
  },
  "author": {
    "label": "Author",
    "format": "string"
  },
  "score": {
    "label": "Score",
    "format": "integer"
  },
  "body": {
    "label": "Body",
    "format": "string"
  },
  "title": {
    "label": "Title",
    "format": "string"
  },
  "createdUtc": {
    "label": "Created (UTC, ISO)",
    "format": "string"
  },
  "permalink": {
    "label": "Permalink",
    "format": "string"
  },
  "subreddit": {
    "label": "Subreddit",
    "format": "string"
  }
}
```

## How it works

### 1. Sign up on Apify or log in

The Reddit Comments Scraper: Full Threads, $2/1K Comments Actor is ready to run with the inputs already set for "Example: a Reddit post with its first 50 comments". [Sign up or log in](https://console.apify.com/create-task-from-example/69bhcHXcXlzLktL24) and you'll land in Apify Console with a copy of this exact task.

### 2. Start the "Example: a Reddit post with its first 50 comments" task

The Reddit Comments Scraper: Full Threads, $2/1K Comments Actor will start running based on the input automatically. You can also change all the input fields, like post urls, max comments per post, and more, to match your specific use case.

### 3. Receive the "Example: a Reddit post with its first 50 comments" output

Monitor the progress in real time. You will be notified as soon as your dataset is complete and ready for review. Each result includes data such as row type, ID, post id, and more.

### 4. Integrate into your workflow

The final output is delivered in JSON, CSV, or Excel format, ready to be plugged into your workflow. You can also [run the "Example: a Reddit post with its first 50 comments" task via API](https://apify.com/actorforgehq/reddit-comments-scraper.md).

## FAQ

### What does the Reddit comments example task return?

The Reddit comments example task returns one Reddit post and the first 50 comments of its thread, as set by maxComments 50. The post row is extra and does not count toward maxComments.

### What does one row of the Reddit comments example task contain?

The Reddit comments example task returns comment rows with id, postId, subreddit, author, score, body, createdUtc, permalink, depth and parentId. Deleted authors appear as [deleted]. A hidden score is left absent.

### How do I get more comments or another post with the Reddit comments example task?

In the Reddit comments example task, paste other post links in postUrls and raise maxComments. The default is 1,000 and the hard cap is 10,000 per post. sort decides which comments you get under a limit.

### How can I rebuild the thread tree from the Reddit comments example task output?

In the Reddit comments example task, depth is 0 for a top-level comment. parentId is t3_ plus the post id for top-level comments and t1_ plus the comment id for replies. Replies always come after their parent.

### Why does the Reddit comments example task return fewer comments than Reddit's counter?

The Reddit comments example task cannot return comments deleted by authors or removed by moderators and spam filters. Reddit's counter includes them, but Reddit serves them to no one, so rows can be fewer.

### How long does the Reddit comments example task take, and how do I call it from code?

The Reddit comments example task loads replies branch by branch, at most 20 requests per minute, so large limits take longer: raise the run timeout for big jobs. Call it through the Apify API, or let AI agents use the Apify MCP server.

### Does the Reddit comments example task need a Reddit account or API key?

The Reddit comments example task needs no Reddit account or API key. The Actor reads public pages as a logged-out visitor. An NSFW post is skipped with its comments unless includeNSFW is true.

## About this Actor

This example demonstrates how to use [Reddit Comments Scraper: Full Threads, $2/1K Comments](https://apify.com/actorforgehq/reddit-comments-scraper.md) with a specific input configuration. Visit the [Actor detail page](https://apify.com/actorforgehq/reddit-comments-scraper.md) to learn more, explore other use cases, and run it yourself.


## How to integrate an Actor?

This Task's input is already configured above. Use it as-is rather than inventing a new one.

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 full API examples (JavaScript, Python, CLI, MCP, OpenAPI), see this Task's Actor page: https://apify.com/actorforgehq/reddit-comments-scraper.md

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`).
