# Reddit Comments Scraper: Full Thread to JSON or CSV

Collects posts and attaches each post's comment tree: every comment's author, body, score, depth, parent id and date, so the thread can be rebuilt. Paste any post or subreddit link in startUrls.

- Actor: openclawai/reddit-scraper (Reddit Scraper), https://datapika.com/actors/reddit-scraper
- Run on Apify: https://apify.com/openclawai/reddit-scraper
- Tested: 2026-11-23, 5 rows in 16 seconds, $0.13 at free-plan prices

## Input

```json
{
  "startUrls": [
    "https://www.reddit.com/r/Python/top/?t=month"
  ],
  "includeComments": true,
  "maxCommentsPerPost": 200,
  "maxItems": 5
}
```

## Output fields

- `title`: Title
- `subreddit`: Subreddit
- `author`: Author
- `score`: Score
- `upvoteRatio`: Upvote %
- `numComments`: Comments
- `flair`: Flair
- `createdAt`: Posted
- `url`: Link

## Sample rows (personal data masked)

```json
[
  {
    "title": "Tim Peters has passed away",
    "subreddit": "Python",
    "author": "ExoticMandibles",
    "score": 2516,
    "upvoteRatio": 0.99,
    "numComments": 77,
    "flair": "News",
    "createdAt": "2026-11-11T02:33:08Z",
    "url": "https://www.reddit.com/r/Python/comments/1xt65ah/tim_peters_has_passed_away/"
  },
  {
    "title": "microsoft agent-framework on PyPI was compromised twice in 33 minutes last night",
    "subreddit": "Python",
    "author": "BattleRemote3157",
    "score": 452,
    "upvoteRatio": 0.98,
    "numComments": 57,
    "flair": "News",
    "createdAt": "2026-11-18T03:28:24Z",
    "url": "https://www.reddit.com/r/Python/comments/1xz4v1j/microsoft_agentframework_on_pypi_was_compromised/"
  },
  {
    "title": "Microsoft's PyPI package got compromised without a GitHub code change. How is this even possible?",
    "subreddit": "Python",
    "author": "enterthearena44",
    "score": 249,
    "upvoteRatio": 0.93,
    "numComments": 54,
    "flair": "Discussion",
    "createdAt": "2026-11-19T03:43:29Z",
    "url": "https://www.reddit.com/r/Python/comments/1xzzjn8/microsofts_pypi_package_got_compromised_without_a/"
  }
]
```

Full sample: https://datapika.com/data/tasks/reddit-post-with-comments.json

## How to run it

1. **Open the actor on Apify.** Click Copy input, then Run on Apify to open the Reddit Scraper. Sign in or create a free account, open the JSON tab of the input form and paste the input.
2. **Start the "Reddit Comments Scraper: Full Thread to JSON or CSV" task.** Press Start. Change any input field first if you need a different topic, account or size; the fields are listed above.
3. **Get the results.** Rows arrive in a dataset while the run works. Our test returned 5 rows in 16 seconds.
4. **Use the data.** Download JSON, CSV or Excel, call the run from the API, schedule it, or let an AI agent run it through MCP.

API (replace the token):

```bash
curl -X POST \
  "https://api.apify.com/v2/acts/openclawai~reddit-scraper/run-sync-get-dataset-items?maxTotalChargeUsd=1" \
  -H "Authorization: Bearer $APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"startUrls":["https://www.reddit.com/r/Python/top/?t=month"],"includeComments":true,"maxCommentsPerPost":200,"maxItems":5}'
```

## Change it

- startUrls takes any reddit.com link: a subreddit, a post, a user or a search page.
- includeComments attaches each post's comment thread; maxCommentsPerPost caps it.
- maxCommentsPerPost sets how many comments come with each post.
- Raise maxItems for a bigger dataset; you pay per result delivered.

## FAQ

### How many comments do I get per post?

Set maxCommentsPerPost. Small threads come back complete; very big threads return about 120 to 220 comments per post, the top of the tree first.

### Can I paste a single post link?

Yes. Put any reddit.com post URL in startUrls and turn on includeComments to export that one thread.

### Do I need a Reddit account or API key?

No. It reads public Reddit data anonymously, with no login, cookie, app registration or API key.

### How much does it cost?

You pay per result delivered to your dataset: posts, comments, users or communities. There is no start fee. The current prices are on the Pricing tab.
