# LinkedIn Post Comments & Engagements Scraper (`khadinakbar/linkedin-post-comments-engagements-scraper`) Actor

Scrape known public LinkedIn post URLs for visible comments, commenters, post authors, likes, reactions, comment counts, and engagement totals. Provider-backed with SociaVault; no user cookies required. MCP/API-ready.

- **URL**: https://apify.com/khadinakbar/linkedin-post-comments-engagements-scraper.md
- **Developed by:** [Khadin Akbar](https://apify.com/khadinakbar) (community)
- **Categories:** Social media, Lead generation, Automation
- **Stats:** 14 total users, 5 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $6.00 / 1,000 linkedin comment scrapeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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 & Engagements Scraper

Scrape known public LinkedIn post URLs and export post-level engagement metrics plus visible comments to JSON, CSV, Excel, or the Apify API.

This actor is built for GTM teams, agencies, social listening workflows, sales researchers, analysts, and AI agents that already have LinkedIn post URLs and need the people who commented, the text they wrote, and the engagement context around each post.

The actor uses SociaVault's public LinkedIn post endpoint. It does not ask users for LinkedIn cookies, does not access private posts, and does not claim complete LinkedIn-native comment coverage. Output depends on the public data exposed by the provider for each post URL.

### What It Extracts

Dataset rows can be post summary rows, comment rows, or both depending on `outputMode`.

| Field | Description |
| --- | --- |
| `recordType` | `post` for engagement summary rows or `comment` for comment rows |
| `postUrl` / `resolvedPostUrl` | Input URL and provider-returned canonical URL |
| `postId` | LinkedIn activity/article ID when available |
| `postTitle` / `postText` | Visible post or article content |
| `datePublished` | Provider-returned publication date |
| `postAuthorName` / `postAuthorUrl` | Post author details |
| `likeCount` / `reactionCount` | Post-level likes or reactions |
| `commentCount` | Total post comment count when exposed |
| `shareCount` | Share/repost count when exposed |
| `engagementCount` | Convenience total of available reactions/likes, comments, and shares |
| `commenterName` / `commenterProfileUrl` | Comment author details |
| `commentText` | Visible comment text |
| `commentReactionCount` / `replyCount` | Comment-level engagement when exposed |
| `runId` | Apify run ID that produced the record |
| `scrapedAt` | Timestamp when this actor saved the row |

### Inputs

- `postUrls` - one or more known LinkedIn post, feed update, or Pulse article URLs.
- `maxPosts` - cap on unique post URLs processed.
- `maxCommentsPerPost` - cap on comment rows saved for each post. Set to `0` for post metrics only.
- `outputMode` - `both`, `comments`, or `posts`.
- `dedupeComments` - remove duplicate comments per post using URL, commenter profile, and text.
- `includeRawData` - include raw provider payloads for debugging.
- `maxConcurrency` - number of post URLs processed in parallel.

### Example Input

```json
{
  "postUrls": [
    "https://www.linkedin.com/pulse/being-father-has-made-me-better-leader-vice-versa-austen-allred/"
  ],
  "maxPosts": 10,
  "maxCommentsPerPost": 100,
  "outputMode": "both",
  "dedupeComments": true,
  "includeRawData": false
}
```

### Example Output

```json
{
  "recordType": "comment",
  "postUrl": "https://www.linkedin.com/pulse/being-father-has-made-me-better-leader-vice-versa-austen-allred/",
  "resolvedPostUrl": "https://www.linkedin.com/pulse/being-father-has-made-me-better-leader-vice-versa-austen-allred",
  "postId": null,
  "postTitle": "Being a Father Has Made me a Better Leader, and Vice Versa",
  "datePublished": "2020-06-21T14:35:59.000+00:00",
  "postAuthorName": "Austen Allred",
  "postAuthorUrl": "https://www.linkedin.com/in/austenallred",
  "reactionCount": 214,
  "commentCount": 17,
  "engagementCount": 231,
  "commentPosition": 1,
  "commentText": "Austen, thanks for sharing!",
  "commenterName": "Jeremy M.",
  "commenterProfileUrl": "https://uk.linkedin.com/in/jeremymurray",
  "source": "sociavault",
  "scrapedAt": "2026-06-08T00:00:00.000Z"
}
```

### Run Summary

Every run writes `OUTPUT` and `RUN_SUMMARY` records to the default key-value store:

```json
{
  "recordsSaved": 101,
  "postsProcessed": 1,
  "commentsSaved": 100,
  "chargedPosts": 1,
  "chargedComments": 100,
  "estimatedPpeCostUsd": 0.61,
  "providerAttempts": 1,
  "providerRetries": 0,
  "providerStatusCodes": [200],
  "stopReason": "finished"
}
```

Common `stopReason` values:

- `finished` - all selected post URLs were processed.
- `no-results` - provider returned no rows that could be saved.
- `provider-error` or `partial-provider-error` - upstream provider failed before or after some records were saved.
- `event-limit-reached` - Apify PPE charge limit stopped the run.
- `invalid-input` - input did not include a valid LinkedIn post URL.
- `missing-api-key` - actor owner has not configured `SOCIAVAULT_API_KEY`.

### Pricing

This actor is designed for pay-per-event monetization:

- `apify-actor-start`: platform start event.
- `post-engagement-scraped`: one post-level engagement row saved.
- `comment-scraped`: one LinkedIn comment row saved.

The actor logs the maximum possible PPE cost before it starts and stops before saving more comment rows than `maxPosts * maxCommentsPerPost`.

### Limitations

This is a known-URL post detail actor, not a LinkedIn keyword search actor. For discovery, use a LinkedIn post search actor first, then feed the discovered post URLs into this actor.

LinkedIn data availability is best-effort. Some posts expose engagement counts but limited or no comments; some post types may not expose every engagement field. The actor does not scrape private LinkedIn content and does not use LinkedIn account cookies.

### API Example

```bash
curl -X POST "https://api.apify.com/v2/acts/khadinakbar~linkedin-post-comments-engagements-scraper/runs?token=YOUR_APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"postUrls":["https://www.linkedin.com/pulse/being-father-has-made-me-better-leader-vice-versa-austen-allred/"],"maxCommentsPerPost":100,"outputMode":"both"}'
```

### Legal

This actor is intended for public web data visible through the configured provider. You are responsible for using the output in compliance with applicable laws, platform terms, privacy requirements, and your own data governance policies.

# Actor input Schema

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

One or more public LinkedIn post, feed update, or Pulse article URLs. Use this actor when you already know the post URLs and want comments, commenters, and engagement counts.

## `maxPosts` (type: `integer`):

Maximum number of unique post URLs to process from the input list. Use this to cap provider calls and PPE cost for large URL batches.

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

Maximum number of comment rows to save per post. The provider may expose fewer comments than this cap. Set to 0 when you only need post-level engagement rows.

## `outputMode` (type: `string`):

Choose whether to save post-level engagement summary rows, per-comment rows, or both. Both is recommended for CRM, lead research, and AI-agent workflows.

## `dedupeComments` (type: `boolean`):

Remove duplicate comments per post using comment URL, commenter profile URL, and text. Keep enabled for cleaner automation datasets.

## `includeRawData` (type: `boolean`):

Attach raw SociaVault post/comment payloads to dataset rows. Enable only for debugging or custom downstream parsing because it increases dataset size.

## `maxConcurrency` (type: `integer`):

How many post URLs to process in parallel. Keep the default for reliable provider usage and predictable cost tracking.

## Actor input object example

```json
{
  "postUrls": [
    "https://www.linkedin.com/pulse/being-father-has-made-me-better-leader-vice-versa-austen-allred/"
  ],
  "maxPosts": 50,
  "maxCommentsPerPost": 100,
  "outputMode": "both",
  "dedupeComments": true,
  "includeRawData": false,
  "maxConcurrency": 2
}
```

# Actor output Schema

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

Dataset items containing post metrics, author context, commenter profile URLs, comment text, and scrape metadata.

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

Run summary including recordsSaved, commentsSaved, providerAttempts, providerRetries, providerStatusCodes, per-post outcomes, stopReason, and billing counters.

# 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/pulse/being-father-has-made-me-better-leader-vice-versa-austen-allred/"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("khadinakbar/linkedin-post-comments-engagements-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/pulse/being-father-has-made-me-better-leader-vice-versa-austen-allred/"] }

# Run the Actor and wait for it to finish
run = client.actor("khadinakbar/linkedin-post-comments-engagements-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).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/pulse/being-father-has-made-me-better-leader-vice-versa-austen-allred/"
  ]
}' |
apify call khadinakbar/linkedin-post-comments-engagements-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=khadinakbar/linkedin-post-comments-engagements-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/0tcbv4SIYhcPCFteQ/builds/R4JvMgcVr6UsU2ejN/openapi.json
