# LinkedIn Post Comments Scraper (`fetch_cat/linkedin-post-comments-scraper`) Actor

Export public LinkedIn post comments and replies with author, thread, engagement, and incremental monitoring fields.

- **URL**: https://apify.com/fetch\_cat/linkedin-post-comments-scraper.md
- **Developed by:** [Hanna Nosova](https://apify.com/fetch_cat) (community)
- **Categories:** Social media, Marketing
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.02 / 1,000 comment or reply exporteds

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

## LinkedIn Post Comments Scraper

Use this LinkedIn comments scraper to export public post comments and replies into structured data for engagement monitoring, recruiting signals, and discussion archiving. Scrape LinkedIn post comments from known public URLs without manually copying thread data. Supply one or more public LinkedIn post URLs or URNs and receive one row per comment or reply. Export LinkedIn comments through the Apify Console, API, schedules, or integrations.

### Quick start

```json
{
  "postUrls": ["https://www.linkedin.com/posts/example_activity-7302346926123798528-example"],
  "maxComments": 50,
  "includeReplies": true,
  "maxRepliesPerComment": 20,
  "sortBy": "recent"
}
```

### Output

Each row includes stable comment and post identifiers, comment text, author attribution, timestamps, reaction and reply counts, parent-child linkage, rank and page provenance, and incremental-monitoring fields.

| Field | Description |
|---|---|
| `type` | `comment` or `reply` |
| `commentId`, `commentUrn`, `commentUrl` | Stable comment identity and URL |
| `parentCommentId`, `parentCommentUrl`, `depth` | Reply-thread relationship |
| `postId`, `postUrn`, `postUrl`, `inputPostUrl` | Source post attribution |
| `text` | Public comment text |
| `postedAt`, `postedAtTimestamp` | Publication time in ISO UTC and milliseconds |
| `authorId`, `authorName`, `authorHeadline` | Public author attribution when available |
| `authorProfileUrl`, `authorProfilePictureUrl` | Public profile references when available |
| `reactionCount`, `reactionCounts`, `replyCount` | Public engagement totals |
| `isPinned`, `isEdited`, `isPostAuthor` | Comment state flags |
| `rank`, `pageNumber`, `positionOnPage`, `sortBy` | Ordering and pagination provenance |
| `collectedAt`, `isNewSince`, `sourceKey` | Collection and incremental deduplication fields |

### Input settings

| Setting | Description | Default |
|---|---|---|
| `postUrls` | Public LinkedIn post URLs or activity, ugcPost, or share URNs | Required |
| `maxComments` | Maximum top-level comments per post (1–5,000) | `50` |
| `includeReplies` | Include replies as separate rows | `true` |
| `maxRepliesPerComment` | Maximum replies per parent comment | `50` |
| `sortBy` | `recent` or `relevant` | `recent` |
| `since` | Optional ISO date/time cutoff for incremental monitoring | None |

### Input recipes

**Monitor new discussion**

```json
{"postUrls":["urn:li:activity:7302346926123798528"],"maxComments":100,"since":"2026-08-01T00:00:00Z"}
```

**Export top-level comments only**

```json
{"postUrls":["urn:li:activity:7302346926123798528"],"maxComments":500,"includeReplies":false}
```

### Pricing and limits

The Actor uses pay-per-event pricing: one start event per run and one result event per saved comment or reply. See the [live Pricing tab](https://apify.com/fetch_cat/linkedin-post-comments-scraper/pricing) for current rates. A run accepts up to 100 posts, 5,000 top-level comments per post, and 1,000 replies per parent comment.

Public LinkedIn availability varies by post, region, and source visibility. Deleted, restricted, login-only, or challenge-protected posts may not return data. `relevant` ordering can expose fewer comments than `recent` ordering.

### Who is it for

- **Community and social teams** tracking discussion quality and recurring participants.
- **Sales teams** identifying public buying signals and follow-up opportunities.
- **Recruiters** reviewing public expertise and professional discussion signals.
- **Researchers and analysts** archiving thread structure, engagement, and authorship.
- **Developers** feeding structured LinkedIn discussion data into databases and dashboards.

The flat, linked row format supports spreadsheets and BI tools as well as databases: replies retain their parent IDs without requiring consumers to unpack nested arrays.

### API usage and integrations

Run through the Apify API using Actor ID `fetch_cat/linkedin-post-comments-scraper`, export datasets as JSON, CSV, Excel, or XML, or connect results to Zapier, Make, Google Sheets, and webhooks.

**cURL**

```bash
curl -X POST "https://api.apify.com/v2/acts/fetch_cat~linkedin-post-comments-scraper/runs?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"postUrls":["urn:li:activity:7302346926123798528"],"maxComments":20}'
```

**JavaScript**

```javascript
import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('fetch_cat/linkedin-post-comments-scraper').call({
  postUrls: ['urn:li:activity:7302346926123798528'],
  maxComments: 20,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
```

**Python**

```python
import os
from apify_client import ApifyClient
client = ApifyClient(os.environ['APIFY_TOKEN'])
run = client.actor('fetch_cat/linkedin-post-comments-scraper').call(run_input={
    'postUrls': ['urn:li:activity:7302346926123798528'],
    'maxComments': 20,
})
items = client.dataset(run['defaultDatasetId']).list_items().items
```

For AI agents, connect through [Apify MCP](https://mcp.apify.com/?tools=fetch_cat/linkedin-post-comments-scraper).

### Tips

- Prefer `recent` when completeness matters.
- Save `sourceKey` in your destination to deduplicate recurring monitoring runs.
- Use `since` with a UTC timestamp to limit output to newer comments.
- Start with a small limit to verify that each post is publicly accessible.

### FAQ

#### What data can I export with LinkedIn Post Comments Scraper?

Each row contains comment identity and text, post attribution, available author details, timestamps, reactions, reply linkage, rank, and collection metadata.

#### Can I run LinkedIn Post Comments Scraper through an API, schedule, or MCP client?

Yes. Use the API examples above, create a Console schedule, or add this Actor as a tool through Apify MCP.

#### How is usage priced?

The Actor charges once at run start and once per saved comment or reply. The live Pricing tab shows the current plan-specific rates before you run it.

#### Does it require a LinkedIn login?

No. It processes comments exposed on public post surfaces. It does not access private or login-only content.

#### Are replies nested?

No. Replies are separate dataset rows linked by `parentCommentId`, which makes filtering and database imports easier.

#### Why are some optional author fields empty?

LinkedIn does not expose every profile attribute on every public comment. The Actor preserves truthful available values rather than inventing data.

#### Can I monitor comments incrementally?

Yes. Set `since` and deduplicate by `sourceKey` in your destination.

### Related Actors

- [LinkedIn Jobs Scraper](https://apify.com/fetch_cat/linkedin-jobs-scraper)
- [LinkedIn Ad Library Scraper](https://apify.com/fetch_cat/linkedin-ad-library-scraper)
- [LinkedIn Company Profiles Scraper](https://apify.com/fetch_cat/linkedin-company-profiles-scraper)

Use only public post data you are permitted to process, and apply appropriate privacy and retention controls in your destination.

### Support

Open an issue from the Actor's Apify Console page with a public example URL, run ID, and expected result. Do not include private credentials or personal data that is not already public.

# Actor input Schema

## `postUrls` (type: `array`):

One public LinkedIn post URL, activity URL, or post URN per line.

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

Maximum top-level comments saved for each post.

## `includeReplies` (type: `boolean`):

Fetch replies and emit each as a separate linked row when publicly available.

## `maxRepliesPerComment` (type: `integer`):

Maximum replies saved for each parent comment. Use 0 for no replies.

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

Recent is best for complete incremental monitoring; relevant prioritizes engaged comments.

## `since` (type: `string`):

Optional ISO date/time cutoff for incremental runs.

## `postedLimit` (type: `string`):

Optional relative cutoff when an exact since timestamp is not supplied.

## Actor input object example

```json
{
  "postUrls": [
    "https://www.linkedin.com/posts/satyanadella_no-one-becomes-a-clinician-to-do-paperwork-activity-7302346926123798528-jitu"
  ],
  "maxComments": 20,
  "includeReplies": true,
  "maxRepliesPerComment": 20,
  "sortBy": "recent",
  "postedLimit": "any"
}
```

# Actor output Schema

## `overview` (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 = {
    "postUrls": [
        "https://www.linkedin.com/posts/satyanadella_no-one-becomes-a-clinician-to-do-paperwork-activity-7302346926123798528-jitu"
    ],
    "maxComments": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("fetch_cat/linkedin-post-comments-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 = {
    "postUrls": ["https://www.linkedin.com/posts/satyanadella_no-one-becomes-a-clinician-to-do-paperwork-activity-7302346926123798528-jitu"],
    "maxComments": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("fetch_cat/linkedin-post-comments-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 '{
  "postUrls": [
    "https://www.linkedin.com/posts/satyanadella_no-one-becomes-a-clinician-to-do-paperwork-activity-7302346926123798528-jitu"
  ],
  "maxComments": 20
}' |
apify call fetch_cat/linkedin-post-comments-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,fetch_cat/linkedin-post-comments-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/5eLObB7fzGGkTtyD3/builds/gouBclng1zhlccqve/openapi.json
