# Reddit Comment Scraper (`datascrapers/reddit-comment-scraper`) Actor

Collect Reddit comments from post IDs or post URLs, including author, text, score, timestamps, reply depth, and parent-post metadata.

- **URL**: https://apify.com/datascrapers/reddit-comment-scraper.md
- **Developed by:** [Farhan Ali](https://apify.com/datascrapers) (community)
- **Categories:**
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.70 / 1,000 comments

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?

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 Comment Scraper** creates a structured dataset of comments collected from [Reddit](https://www.reddit.com) post pages. Each dataset item represents one comment and can include author, body text, score, reply depth, parent and post identifiers, timestamps, and permalinks. Query the source with post IDs or post URLs (`searchQueries`, `postIds`, or `startUrls`). Control the per-post limit with `maxComments`, and retrieve records through the Apify Dataset API or export them as JSON, CSV, Excel, XML, or another supported format.

### Dataset at a glance

| Property | Value |
|---|---|
| Source | reddit.com public post comment threads |
| Record unit | One Reddit comment |
| Input methods | Post IDs or URLs (`searchQueries`), post IDs (`postIds`), or post URLs (`startUrls`) |
| Main identifiers | `id`, comment URL (`fullUrl`), parent post (`postId`) |
| Delivery | Apify Dataset and API |
| Export formats | JSON, CSV, Excel, XML, HTML (Apify dataset exports) |
| Update model | Fresh records per Actor run |
| Pricing | $3 / 1,000 comments; Actor start $0.00005 |

### Coverage and available records

The Actor collects public comments from one or more Reddit posts. Provide at least one of `searchQueries`, `postIds`, or `startUrls`.

- **Post IDs or URLs**: `searchQueries` accepts a bare post ID (`1vcvjb9`) or a full post URL. Preferred for agent-style input.
- **Post IDs**: `postIds` accepts bare IDs; post URLs are built automatically.
- **Post URLs**: `startUrls` accepts `reddit.com` post URLs or `redd.it` short links.

Record types and limits:

- **Comment records** are always collected: identifiers, author, body, score, depth, subreddit, parent post fields, timestamps, and state flags.
- **Sort**: `sortBy` selects Reddit's comment sort (`confidence` / Best, `top`, `new`, `controversial`, `old`, `qa`, `live`). Default is `confidence`.
- **Result cap**: `maxComments` limits comments **per post** (`0` means unlimited per post). `maxItems` is an alias used only when `maxComments` is omitted. Three posts with `maxComments: 10` can return up to 30 comments.

Known exclusions: content Reddit only shows after login is not collected; deleted or removed comments may have empty `body` or `[deleted]` authors; each run captures thread state at run time (no historical snapshots). A Reddit account is not an input.

### Data dictionary

Field names below match dataset record JSON properties exactly. Values come from Reddit. `sourceUrl` and `sourceQuery` record the seed that produced the comment.

| Field | Type | Nullable | Description | Example |
|---|---|---:|---|---|
| `id` | string | No | Comment identifier; recommended deduplication key | `l8c2m3` |
| `name` | string | Yes | Reddit fullname (`t1_` + comment id) | `t1_l8c2m3` |
| `parentId` | string | Yes | Parent fullname (post `t3_…` or comment `t1_…`) | `t3_1vcvjb9` |
| `postId` | string | Yes | Parent post identifier | `1vcvjb9` |
| `postTitle` | string | Yes | Parent post title | `I think people seriously underestimate how easy...` |
| `postUrl` | string | Yes | Parent post URL | `https://www.reddit.com/r/AI_Agents/comments/1vcvjb9/i_think_people_seriously_underestimate_how_easy/` |
| `sourceUrl` | string | Yes | Seed URL used for the run | Same as `postUrl` |
| `sourceQuery` | string | Yes | Seed ID or URL as supplied | Same as `postUrl` |
| `subreddit` | string | Yes | Subreddit name without `r/` | `AI_Agents` |
| `subredditNamePrefixed` | string | Yes | Subreddit with `r/` prefix | `r/AI_Agents` |
| `author` | string | Yes | Comment author username | `reddit_user_123` |
| `body` | string | Yes | Comment text | `This is a really underrated workflow...` |
| `score` | number | Yes | Vote score | `214` |
| `ups` | number | Yes | Ups count as returned by Reddit | `214` |
| `depth` | number | Yes | Reply depth (`0` = top-level) | `0` |
| `createdAt` | string | Yes | Created timestamp (ISO 8601) | `2026-08-07T14:32:10+00:00` |
| `editedAt` | string | Yes | Last-edited timestamp, or null if never edited | `null` |
| `permalink` | string | Yes | Site-relative permalink | `/r/AI_Agents/comments/1vcvjb9/.../l8c2m3/` |
| `fullUrl` | string | Yes | Absolute comment URL; secondary key | `https://www.reddit.com/r/AI_Agents/comments/1vcvjb9/.../l8c2m3/` |
| `url` | string | Yes | Absolute comment URL (same role as `fullUrl`) | Same as `fullUrl` |
| `isSubmitter` | boolean | Yes | Whether the author is the original poster | `false` |
| `distinguished` | string | Yes | Mod / admin distinction, or empty | `""` |
| `stickied` | boolean | Yes | Whether the comment is stickied | `false` |
| `gilded` | number | Yes | Gilding count | `0` |
| `controversiality` | number | Yes | Reddit controversiality flag | `0` |
| `scoreHidden` | boolean | Yes | Whether score is hidden | `false` |
| `collapsed` | boolean | Yes | Whether the comment is collapsed | `false` |
| `locked` | boolean | Yes | Whether the comment is locked | `false` |
| `archived` | boolean | Yes | Whether the comment is archived | `false` |

### Example dataset record

Top-level comment from post `1vcvjb9` with `sortBy` `confidence`.

```json
{
  "id": "l8c2m3",
  "name": "t1_l8c2m3",
  "parentId": "t3_1vcvjb9",
  "postId": "1vcvjb9",
  "postTitle": "I think people seriously underestimate how easy...",
  "postUrl": "https://www.reddit.com/r/AI_Agents/comments/1vcvjb9/i_think_people_seriously_underestimate_how_easy/",
  "sourceUrl": "https://www.reddit.com/r/AI_Agents/comments/1vcvjb9/i_think_people_seriously_underestimate_how_easy/",
  "sourceQuery": "https://www.reddit.com/r/AI_Agents/comments/1vcvjb9/i_think_people_seriously_underestimate_how_easy/",
  "subreddit": "AI_Agents",
  "subredditNamePrefixed": "r/AI_Agents",
  "author": "reddit_user_123",
  "body": "This is a really underrated workflow. I've been using agents like this for weeks and the difference is night and day.",
  "score": 214,
  "ups": 214,
  "depth": 0,
  "createdAt": "2026-08-07T14:32:10+00:00",
  "editedAt": null,
  "permalink": "/r/AI_Agents/comments/1vcvjb9/i_think_people_seriously_underestimate_how_easy/l8c2m3/",
  "fullUrl": "https://www.reddit.com/r/AI_Agents/comments/1vcvjb9/i_think_people_seriously_underestimate_how_easy/l8c2m3/",
  "url": "https://www.reddit.com/r/AI_Agents/comments/1vcvjb9/i_think_people_seriously_underestimate_how_easy/l8c2m3/",
  "isSubmitter": false,
  "distinguished": "",
  "stickied": false,
  "gilded": 0,
  "controversiality": 0,
  "scoreHidden": false,
  "collapsed": false,
  "locked": false,
  "archived": false
}
```

The record above was produced with this input:

```json
{
  "searchQueries": ["1vcvjb9"],
  "maxComments": 100,
  "sortBy": "confidence"
}
```

### Query and input reference

| Input | Type | Required | Default | Accepted values | Description |
|---|---|---:|---|---|---|
| `searchQueries` | array (string) | No\* | — (prefill `1vcvjb9`) | Post IDs or post URLs | Preferred seed list; IDs and URLs are resolved automatically |
| `postIds` | array (string) | No\* | — | Bare post IDs | Alternative seed list; URLs are built automatically |
| `startUrls` | array (requestListSources) | No\* | — | `reddit.com` or `redd.it` post URLs | URL seed list |
| `maxComments` | integer | No | `0` | `0` or any positive integer | Maximum comments **per post**; `0` = unlimited (console prefill `100`) |
| `maxItems` | integer | No | `0` | `0` or any positive integer | Alias for `maxComments` when `maxComments` is omitted |
| `sortBy` | string | No | `confidence` | `confidence`, `top`, `new`, `controversial`, `old`, `qa`, `live` | Reddit comment sort |
| `proxyConfiguration` | object | No | Apify proxy, `RESIDENTIAL` | Apify proxy groups or custom proxies | Residential proxies are recommended; datacenter IPs are often blocked |

\* Provide `searchQueries`, `postIds`, and/or `startUrls` — at least one source is required.

Minimal request:

```json
{ "searchQueries": ["1vcvjb9"] }
```

Advanced request (URL seeds, capped, sorted by new):

```json
{
  "startUrls": [{ "url": "https://www.reddit.com/r/AI_Agents/comments/1vcvjb9/i_think_people_seriously_underestimate_how_easy/" }],
  "maxComments": 10,
  "sortBy": "new",
  "proxyConfiguration": { "useApifyProxy": true, "apifyProxyGroups": ["RESIDENTIAL"] }
}
```

### Retrieve the data through the API

Records are delivered through the Apify Actor and Dataset APIs — not an official Reddit API.

1. Start the Actor with a JSON input (console or API).
2. Wait for the run to finish, or use a synchronous endpoint if you want the response inline.
3. Retrieve items from the run's default dataset.
4. Paginate or export the dataset.

Python example:

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR-APIFY-TOKEN")

run_input = {
    "searchQueries": ["1vcvjb9"],
    "maxComments": 100,
    "sortBy": "confidence",
}

run = client.actor("datascrapers/reddit-comment-scraper").call(run_input=run_input)
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item["id"], item["author"], item["score"])
```

Apify generates ready-to-run Python, JavaScript, and cURL examples on the Actor's [API tab](https://apify.com/datascrapers/reddit-comment-scraper/api). Do not put a real API token in shared code or URLs.

### Data quality and record handling

- **Thread structure**: `parentId` and `depth` preserve reply relationships. A reply is a separate dataset item, not a nested array.
- **Source changes**: Reddit page structure and values can change; unreadable fields are omitted or returned empty rather than fabricated.
- **Deduplication**: within a run, comments are identified by `id`. Across runs, records are appended. Use `id` as the stable key.
- **Failures**: one failed post does not stop the run. Residential proxies are recommended; datacenter IPs are often blocked.
- **Normalization**: timestamps are ISO 8601. Scores and flags come from Reddit.

### Export and pipeline examples

| Destination | Recommended method | Typical use |
|---|---|---|
| PostgreSQL / Supabase | Dataset API poll or webhook consumer | Store threads for sentiment and research |
| Google Sheets | Apify Google Sheets integration | Share short comment extracts |
| NLP / LLM pipelines | Dataset API JSON export | Training or RAG corpora |
| S3 / cloud storage | Scheduled export via Apify scheduler + integration | Archival of discussion snapshots |

### Pricing and cost examples

The Actor uses pay-per-event pricing. Each run also charges a one-time Actor start. Residential proxies are recommended. Proxy and compute are billed by your Apify plan. Comment charges may be tiered on Apify paid plans.

| Event | Trigger | Rate |
|---|---|---|
| Actor start | Once per run | $0.00005 |
| `dataset-item` (Comment) | Each comment written to the dataset | $0.003 / comment ($3 / 1,000) |

Example costs (Actor start negligible; plan-tier discounts not applied):

| Records | Configuration | Estimated base cost |
|---:|---|---:|
| 1,000 | Comments | $3.00 |
| 10,000 | Comments | $30.00 |

Estimates depend on the verified pricing model and the number of comments collected.

### Limitations and responsible data use

- The Actor collects publicly accessible Reddit comments only.
- Field availability depends on what Reddit renders at run time; deleted comments and hidden scores can produce empty or placeholder values.
- The Actor does not provide historical snapshots unless you store them yourself.
- Large runs should use residential proxies; without them, coverage may degrade.
- You are responsible for compliance with Reddit's terms of service, applicable privacy law, and any contractual obligations before using the data.

### Dataset questions

#### What does one dataset item represent?

One Reddit comment. Replies are separate items linked by `parentId` and `depth`.

#### Which field should I use as a unique identifier?

`id` is the recommended deduplication key. `fullUrl` is a reasonable secondary key. Use `postId` to group comments from the same thread.

#### Are fields nullable or conditional?

Yes. `editedAt` is null when the comment was never edited. `body` and `author` can be empty or placeholder values for deleted comments. Other flags follow what Reddit returns.

#### Can I retrieve the records as CSV or JSON?

Yes. The dataset can be exported as JSON, CSV, Excel, XML, or HTML from the Apify Console, and queried through the Dataset API.

#### Does the Actor return historical data?

No. Each run captures the thread at run time. To track new comments, schedule repeated runs and store the outputs yourself.

#### What counts as a billable result?

Two pay-per-event charges apply: Actor start once per run ($0.00005) and a `dataset-item` charge for every comment ($0.003, or $3 per 1,000).

### Related datasets from Data Scrapers

- **[Reddit Scraper](https://apify.com/datascrapers/reddit-scraper)** — Broader Reddit records that can be joined to these comments through post identifiers.
- **[Instagram Comment Scraper](https://apify.com/datascrapers/instagram-comment-scraper)** — Instagram comments for the same social-listening pipelines.
- **[TikTok Comment Scraper](https://apify.com/datascrapers/tiktok-comment-scraper)** — TikTok comments for cross-platform discussion analysis.
- **[YouTube Comment Scraper](https://apify.com/datascrapers/youtube-comment-scraper)** — YouTube comments that pair with Reddit threads on the same topics.
- **[Twitter/X Profile Scraper](https://apify.com/datascrapers/twitter-x-profile-scraper)** — Profile-level social records for accounts discussed in Reddit threads.

### Data Scrapers support

Need an additional field, record type, or export workflow? Contact Data Scrapers at stardustspotlight@gmail.com. Include a sample source URL, required fields, expected record volume, and preferred delivery format.

# Actor input Schema

## `searchQueries` (type: `array`):

Reddit post IDs or post URLs to scrape comments from (e.g. 1vcvjb9 or https://www.reddit.com/r/AI\_Agents/comments/1vcvjb9/). Preferred for agents — post pages are resolved automatically.

## `postIds` (type: `array`):

Reddit post IDs to scrape comments from (e.g. 1vcvjb9). Alternative to searchQueries/startUrls — post URLs are built automatically.

## `startUrls` (type: `array`):

Reddit post URLs to scrape comments from, e.g. https://www.reddit.com/r/AI\_Agents/comments/1vcvjb9/... or https://redd.it/1vcvjb9. Optional when searchQueries or postIds is provided.

## `maxComments` (type: `integer`):

Maximum number of comments to scrape from each post (0 = unlimited per post). Example: 3 posts with maxComments=10 returns up to 30 comments total. Preferred over maxItems.

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

Alias for maxComments (per post) for agent compatibility. Used only when maxComments is omitted (0 = unlimited per post).

## `sortBy` (type: `string`):

How to sort comments on each post

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

Apify proxy for the browser session. Residential proxies are strongly recommended — datacenter IPs are often blocked by Reddit.

## Actor input object example

```json
{
  "searchQueries": [
    "1vcvjb9"
  ],
  "postIds": [
    "1vcvjb9"
  ],
  "startUrls": [
    {
      "url": "https://www.reddit.com/r/AI_Agents/comments/1vcvjb9/i_think_people_seriously_underestimate_how_easy/"
    }
  ],
  "maxComments": 100,
  "maxItems": 0,
  "sortBy": "confidence",
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

## `results` (type: `string`):

Dataset containing scraped Reddit comments

## `kvsRecords` (type: `string`):

Key-value store run statistics produced by the Actor

# 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 = {
    "searchQueries": [
        "1vcvjb9"
    ],
    "postIds": [
        "1vcvjb9"
    ],
    "startUrls": [
        {
            "url": "https://www.reddit.com/r/AI_Agents/comments/1vcvjb9/i_think_people_seriously_underestimate_how_easy/"
        }
    ],
    "maxComments": 100,
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("datascrapers/reddit-comment-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 = {
    "searchQueries": ["1vcvjb9"],
    "postIds": ["1vcvjb9"],
    "startUrls": [{ "url": "https://www.reddit.com/r/AI_Agents/comments/1vcvjb9/i_think_people_seriously_underestimate_how_easy/" }],
    "maxComments": 100,
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("datascrapers/reddit-comment-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 '{
  "searchQueries": [
    "1vcvjb9"
  ],
  "postIds": [
    "1vcvjb9"
  ],
  "startUrls": [
    {
      "url": "https://www.reddit.com/r/AI_Agents/comments/1vcvjb9/i_think_people_seriously_underestimate_how_easy/"
    }
  ],
  "maxComments": 100,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call datascrapers/reddit-comment-scraper --silent --output-dataset

```

## MCP server setup

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