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

- **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:** 2 total users, 1 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 and usage. You are charged both the fixed price for specific events and for Apify platform usage.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "LinkedIn Post Comments & Engagements Scraper",
        "description": "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.",
        "version": "0.1",
        "x-build-id": "R4JvMgcVr6UsU2ejN"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/khadinakbar~linkedin-post-comments-engagements-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-khadinakbar-linkedin-post-comments-engagements-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/khadinakbar~linkedin-post-comments-engagements-scraper/runs": {
            "post": {
                "operationId": "runs-sync-khadinakbar-linkedin-post-comments-engagements-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/khadinakbar~linkedin-post-comments-engagements-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-khadinakbar-linkedin-post-comments-engagements-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "postUrls"
                ],
                "properties": {
                    "postUrls": {
                        "title": "LinkedIn post URLs",
                        "type": "array",
                        "description": "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.",
                        "items": {
                            "type": "string",
                            "pattern": "^https?://([a-z]{2,3}\\.)?(www\\.)?linkedin\\.com/.*$"
                        },
                        "default": []
                    },
                    "maxPosts": {
                        "title": "Max posts",
                        "minimum": 1,
                        "maximum": 500,
                        "type": "integer",
                        "description": "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.",
                        "default": 50
                    },
                    "maxCommentsPerPost": {
                        "title": "Max comments per post",
                        "minimum": 0,
                        "maximum": 1000,
                        "type": "integer",
                        "description": "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.",
                        "default": 100
                    },
                    "outputMode": {
                        "title": "Output mode",
                        "enum": [
                            "both",
                            "comments",
                            "posts"
                        ],
                        "type": "string",
                        "description": "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.",
                        "default": "both"
                    },
                    "dedupeComments": {
                        "title": "Dedupe comments",
                        "type": "boolean",
                        "description": "Remove duplicate comments per post using comment URL, commenter profile URL, and text. Keep enabled for cleaner automation datasets.",
                        "default": true
                    },
                    "includeRawData": {
                        "title": "Include raw provider data",
                        "type": "boolean",
                        "description": "Attach raw SociaVault post/comment payloads to dataset rows. Enable only for debugging or custom downstream parsing because it increases dataset size.",
                        "default": false
                    },
                    "maxConcurrency": {
                        "title": "Max concurrency",
                        "minimum": 1,
                        "maximum": 5,
                        "type": "integer",
                        "description": "How many post URLs to process in parallel. Keep the default for reliable provider usage and predictable cost tracking.",
                        "default": 2
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
