# LinkedIn Post Comments Scraper (`automation-lab/linkedin-comments-scraper`) Actor

Scrape public comments from LinkedIn posts without cookies or login: commenter name, profile URL, text, exact time, reactions, comment URN and post context. Returns the logged-out view, about 10 top comments per post.

- **URL**: https://apify.com/automation-lab/linkedin-comments-scraper.md
- **Developed by:** [Automation Lab](https://apify.com/automation-lab) (community)
- **Categories:** Social media, Lead generation
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.08 / 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?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## 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.

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 examples already wired to this Actor's own input schema, see the [API](#api) section below.

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

# README

## LinkedIn Post Comments Scraper

Scrape the public comments of LinkedIn posts **without cookies, login or a LinkedIn account**. Paste post links, URNs or activity IDs and get one clean row per comment: commenter name, profile URL, comment text, exact time, reaction count, the stable comment URN, and the post it belongs to.

> **What logged-out visitors see.** LinkedIn shows people who are not signed in about the **10 most relevant comments** of each post, without replies. This Actor returns exactly that public view, so it gives up to about 10 comments per post. If you need every comment and reply of a post with hundreds of comments, this is not the right tool.

### What does LinkedIn Post Comments Scraper do?

For each LinkedIn post you give it, the Actor opens the public post page the way a logged-out visitor sees it and saves every visible comment as a row:

- 💬 **Comment**: text, exact creation time, relative age, total reactions, position on the post
- 👤 **Commenter**: name, public profile or company page URL, vanity ID, person or company, avatar
- 🔑 **Stable IDs**: comment ID, comment URN and a direct link to the comment
- 📝 **Post context**: post URN, author, text, publish time, total reactions and total comment count

It needs no LinkedIn account, cookie or session from you. The Actor gets its own anonymous guest session for every proxy identity.

### Who is it for?

- **B2B sales and social-selling teams** who turn the top commenters on competitor and thought-leader posts into warm lead lists every week.
- **Agencies and ghostwriters** who track which comments rise to the top of their clients' posts.
- **Recruiters** who spot active voices in a niche from the comments on industry posts.
- **Market and brand researchers** who collect public reactions to product launches and announcements.
- **RevOps and data teams** who feed commenters into a CRM or enrichment pipeline through the API.

### Why use this LinkedIn comments scraper?

- ✅ **No cookies, no login, no account risk.** You never hand over a LinkedIn session.
- ✅ **Stable comment URN on every row.** Deduplicate across weekly runs on `commentUrn` instead of fuzzy text matching.
- ✅ **Exact timestamps.** `createdAt` comes from LinkedIn's own structured data, not from "3w ago".
- ✅ **Clean profile URLs.** Country subdomains and tracking parameters are removed, so the same person always has the same URL.
- ✅ **Honest run summary.** Posts that show no public comments, posts hidden from logged-out visitors and posts that could not be loaded are counted and named in the status message and the `RUN_SUMMARY` record. You pay only for comments saved.
- ✅ **Cheap datacenter route.** No browser, so runs are fast and cost little.

### What LinkedIn comment data is extracted?

| Field | Description |
|---|---|
| `commentId` | Numeric LinkedIn comment ID |
| `commentUrn` | Stable comment URN, e.g. `urn:li:comment:(urn:li:activity:…,…)` |
| `commentUrl` | Link that opens the post at this comment |
| `position` | 1-based position in LinkedIn's public (most relevant first) order |
| `text` | Full comment text, line breaks kept |
| `createdAt` | Exact time the comment was written (ISO 8601, UTC) |
| `commentAge` | Relative age as LinkedIn shows it (`3d`, `2w`, `1y`) |
| `reactionCount` | Total reactions on the comment, all types together |
| `commenterName` | Name of the commenter (LinkedIn sometimes shortens surnames for logged-out visitors) |
| `commenterProfileUrl` | Canonical profile or company page URL |
| `commenterId` | Public vanity ID from the profile URL |
| `commenterType` | `person`, `company` or `other` |
| `commenterAvatarUrl` | Profile photo URL, or null |
| `isPostAuthor` | True when the post author replied in the comments |
| `postId`, `postUrn`, `postUrl` | The post the comment belongs to |
| `postAuthorName`, `postAuthorUrl` | Who published the post |
| `postText`, `postPublishedAt` | Post text and publish time |
| `postReactionCount`, `postCommentCount` | Post totals as LinkedIn reports them, including comments not shown publicly |
| `scrapedAt` | When the row was collected |

Not included, because LinkedIn does not show them to logged-out visitors: replies to comments, the commenter's headline, reactions split by type, and comments beyond the top ~10.

### How much does it cost to scrape LinkedIn post comments?

The Actor uses pay-per-event pricing. You pay a small fee per run and a fee per comment saved. Posts with no public comments, unavailable posts and failed posts cost nothing per row.

| Event | Free | Bronze | Silver | Gold | Platinum | Diamond |
|---|---|---|---|---|---|---|
| Run start (once per run) | $0.002 | $0.002 | $0.002 | $0.002 | $0.002 | $0.002 |
| Comment saved | $0.00135 | $0.00135 | $0.001215 | $0.00108 | $0.00108 | $0.00108 |

The start fee is charged together with the first saved comment, so a run that saves nothing costs nothing.

Examples at the Bronze tier:

- 1 post, 10 comments: $0.002 + 10 × $0.00135 = **$0.0155**
- 50 posts, about 450 comments: $0.002 + 450 × $0.00135 = **about $0.61**
- Apify's free plan ($5 monthly credit) covers roughly 3,700 comments a month.

Set **Maximum cost per run** in the run options to cap spending; the Actor stops cleanly at that limit and keeps every saved row.

### How to scrape comments from LinkedIn posts

1. Open the Actor in Apify Console and click **Try for free**.
2. Paste one or more LinkedIn post links into **Post URLs**.
3. Optionally lower **Max comments per post**.
4. Click **Start** and wait a few seconds per post.
5. Download the comments as JSON, CSV, Excel or HTML, or read them through the API.

### Input parameters

| Parameter | Type | Default | Description |
|---|---|---|---|
| `postUrls` | array of strings | required | Post links (`/posts/…`, `/feed/update/urn:li:activity:…`), URNs (`urn:li:activity:…`, `urn:li:ugcPost:…`, `urn:li:share:…`) or 19-digit activity IDs. Up to 1,000 per run; repeats are read once. |
| `maxCommentsPerPost` | integer | 10 | Most comments saved per post (1–100). LinkedIn shows logged-out visitors about 10, so a post gives at most about 10 rows. |

Example input:

```json
{
    "postUrls": [
        "https://www.linkedin.com/feed/update/urn:li:activity:7320867199693246465/",
        "https://www.linkedin.com/posts/noahw_scuba-activity-7515811958189658113-5j6x",
        "urn:li:ugcPost:7396563121059872768"
    ],
    "maxCommentsPerPost": 10
}
```

### Output example

```json
{
    "commentId": "7396649692761186304",
    "commentUrn": "urn:li:comment:(urn:li:ugcPost:7396563121059872768,7396649692761186304)",
    "commentUrl": "https://www.linkedin.com/feed/update/urn:li:ugcPost:7396563121059872768?commentUrn=urn%3Ali%3Acomment%3A(urn%3Ali%3AugcPost%3A7396563121059872768%2C7396649692761186304)",
    "position": 1,
    "text": "This is the clearest sign yet that compute and frontier models are becoming tightly coupled infrastructure. …",
    "createdAt": "2025-11-18T20:45:09.861Z",
    "commentAge": "11mo",
    "reactionCount": 6,
    "commenterName": "Monica K.",
    "commenterProfileUrl": "https://www.linkedin.com/in/monicaking",
    "commenterId": "monicaking",
    "commenterType": "person",
    "commenterAvatarUrl": null,
    "isPostAuthor": false,
    "postId": "7396563121059872768",
    "postUrn": "urn:li:ugcPost:7396563121059872768",
    "postUrl": "https://www.linkedin.com/feed/update/urn:li:ugcPost:7396563121059872768/",
    "postAuthorName": "Satya Nadella",
    "postAuthorUrl": "https://www.linkedin.com/in/satyanadella",
    "postText": "10 PRINT \"ANTHROPIC + MICROSOFT + NVIDIA = MORE COMPUTE, COGNITION, AND CHOICE.\"",
    "postPublishedAt": "2025-11-18T15:09:38.152Z",
    "postReactionCount": 17761,
    "postCommentCount": 756,
    "scrapedAt": "2026-11-12T07:52:48.425Z"
}
```

### Limits and how failures are reported

- **About 10 comments per post.** LinkedIn's logged-out page lists the most relevant comments only; `postCommentCount` tells you how many exist in total.
- **No replies.** Replies are not shown to logged-out visitors.
- **Some posts are members-only.** LinkedIn sends logged-out visitors to a sign-in page for some posts (often older posts or reposts). The same happens for a deleted post or a wrong ID, and the two cannot be told apart. These posts are listed as unavailable in the status message and `RUN_SUMMARY`, and cost nothing per row.
- **Blocked requests are retried** on up to five fresh guest identities across several proxy pools before a post is reported as failed.
- **Run status.** The run succeeds when every post was answered. Entries that are not LinkedIn posts (a profile or company link, another website) are skipped, named in the status message and `RUN_SUMMARY`, and not charged. It fails only when the list has no LinkedIn post at all, when no post could be loaded, or when saving or charging breaks; saved rows are always kept.
- The `RUN_SUMMARY` record in the default key-value store lists posts read, posts with and without public comments, unavailable, failed and skipped (invalid) entries and the reason for each.

### Integrations and workflows

- **Weekly lead lists:** schedule the Actor on your competitors' latest posts and send new `commentUrn`s to Google Sheets, HubSpot or Salesforce through Make, Zapier or n8n.
- **Find the posts first:** use [LinkedIn Post Scraper](https://apify.com/automation-lab/linkedin-post-scraper) or [LinkedIn Profile Posts Scraper](https://apify.com/automation-lab/linkedin-profile-posts-scraper) to collect post URLs, then pass them here.
- **Enrich commenters:** send `commenterProfileUrl` to [LinkedIn Profile Scraper](https://apify.com/automation-lab/linkedin-profile-scraper) for headline, company and experience.
- **Webhooks:** trigger your own endpoint when a run finishes and fetch the dataset.

### Use the API

#### cURL

```bash
curl -X POST "https://api.apify.com/v2/acts/automation-lab~linkedin-comments-scraper/run-sync-get-dataset-items?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"postUrls":["https://www.linkedin.com/feed/update/urn:li:activity:7320867199693246465/"],"maxCommentsPerPost":10}'
```

#### JavaScript

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('automation-lab/linkedin-comments-scraper').call({
    postUrls: ['https://www.linkedin.com/feed/update/urn:li:activity:7320867199693246465/'],
    maxCommentsPerPost: 10,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items.map((c) => `${c.commenterName}: ${c.text}`));
```

#### Python

```python
import os
from apify_client import ApifyClient

client = ApifyClient(os.environ["APIFY_TOKEN"])
run = client.actor("automation-lab/linkedin-comments-scraper").call(run_input={
    "postUrls": ["https://www.linkedin.com/feed/update/urn:li:activity:7320867199693246465/"],
    "maxCommentsPerPost": 10,
})
for comment in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(comment["commenterName"], comment["commenterProfileUrl"], comment["text"][:80])
```

### Use with AI agents via MCP

Connect the Actor to an AI assistant through the [Apify MCP server](https://mcp.apify.com).

#### Claude Code

```bash
claude mcp add --transport http apify \
  "https://mcp.apify.com?tools=automation-lab/linkedin-comments-scraper"
```

#### Claude Desktop, Cursor and VS Code

```json
{
    "mcpServers": {
        "apify": {
            "url": "https://mcp.apify.com?tools=automation-lab/linkedin-comments-scraper"
        }
    }
}
```

The Actor URL also adds the run and dataset tools (`get-actor-run`, `get-dataset-items`). Start one run, keep its run ID, and if `call-actor` returns before the run ends, check that same run with `get-actor-run` (short backoff, a fixed deadline) instead of starting another. Read results with `get-dataset-items` in small pages (for example 20 rows) with only the `fields` you need.

Example prompts:

- "Get the public comments on this LinkedIn post and list the commenters with their profile URLs."
- "Which of these three posts got the most-liked top comments?"
- "Collect commenters from these competitor posts and remove anyone we already saw last week by comment URN."

### Is it legal to scrape LinkedIn comments?

The Actor reads only what LinkedIn shows to any logged-out visitor. It does not log in, bypass a sign-in wall or access private content. Comments still contain personal data, so you are responsible for a lawful basis under GDPR, CCPA and similar laws, for LinkedIn's terms where they apply to you, and for respectful outreach. Do not use the data for spam. If in doubt, ask a lawyer.

### Data handling and error diagnostics

Requests pass through Apify Proxy to LinkedIn. Page bodies and guest session cookies are processed in memory only; results stay in your Apify run storage under your account's retention settings, and you can delete the dataset and key-value store at any time. The Actor keeps no external history or cache.

Failed operations send sanitized diagnostic input, exceptions and Actor/build/run IDs to our private GlitchTip service so we can fix problems. Secret fields and URL queries are removed, raw page bodies, comment data and cookies are never sent, and reports are retained for 30 days. Posts without public comments and ordinary retries are not error reports.

### FAQ

**Why do I get only about 10 comments for a post with 500 comments?**
LinkedIn shows logged-out visitors only the most relevant comments of a post. The Actor does not log in, so it returns that public set. `postCommentCount` shows the full total.

**Can I get replies or the commenter's headline?**
No. Logged-out visitors do not see replies or headlines on post pages. Use [LinkedIn Profile Scraper](https://apify.com/automation-lab/linkedin-profile-scraper) on `commenterProfileUrl` for headlines.

**A post shows as unavailable. Why?**
LinkedIn sent the logged-out visitor to a sign-in page. That happens for members-only posts and also for deleted posts or wrong IDs. Check that the link opens in a private browser window.

**Some names end in an initial, like "Monica K.". Is that a bug?**
No. LinkedIn shortens some surnames for logged-out visitors. The profile URL is still complete and unique.

**How do I avoid paying twice for the same comment?**
Inside a run, comments are deduplicated by `commentUrn`. Across runs, keep the URNs you already have and drop them in your workflow.

### Related LinkedIn scrapers

- [LinkedIn Post Scraper](https://apify.com/automation-lab/linkedin-post-scraper): full post details from post URLs.
- [LinkedIn Profile Posts Scraper](https://apify.com/automation-lab/linkedin-profile-posts-scraper): recent posts of a profile.
- [LinkedIn Company Posts Scraper](https://apify.com/automation-lab/linkedin-company-posts-scraper): recent posts of a company page.
- [LinkedIn Profile Scraper](https://apify.com/automation-lab/linkedin-profile-scraper): enrich commenters with profile details.

# Changelog

This Actor's version history is a separate document: https://apify.com/automation-lab/linkedin-comments-scraper/changelog.md

# Actor input Schema

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

LinkedIn posts to read comments from. Paste post links (https://www.linkedin.com/posts/... or https://www.linkedin.com/feed/update/urn:li:activity:...), post URNs (urn:li:activity:..., urn:li:ugcPost:..., urn:li:share:...) or 19-digit activity IDs. Up to 1,000 posts per run; repeats are read once.

## `maxCommentsPerPost` (type: `integer`):

Most comments to save from each post. LinkedIn shows logged-out visitors about the 10 most relevant comments of a post, so a post gives at most about 10 rows whatever this is set to.

## Actor input object example

```json
{
  "postUrls": [
    "https://www.linkedin.com/feed/update/urn:li:activity:7320867199693246465/"
  ],
  "maxCommentsPerPost": 10
}
```

# Actor output Schema

## `overview` (type: `string`):

One row per public comment, with commenter, text, time, reactions, comment URN and post context.

## `summary` (type: `string`):

RUN_SUMMARY record: posts read, posts with and without public comments, unavailable or failed posts and why.

# 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/feed/update/urn:li:activity:7320867199693246465/"
    ],
    "maxCommentsPerPost": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("automation-lab/linkedin-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/feed/update/urn:li:activity:7320867199693246465/"],
    "maxCommentsPerPost": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("automation-lab/linkedin-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/feed/update/urn:li:activity:7320867199693246465/"
  ],
  "maxCommentsPerPost": 10
}' |
apify call automation-lab/linkedin-comments-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,automation-lab/linkedin-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/vDTZLXaqcdT52V0eB/builds/dvRjRnrixdIcfXQWe/openapi.json
