# LinkedIn Profile Comments Scraper (`khadinakbar/linkedin-profile-comments-scraper`) Actor

Give a LinkedIn profile URL and get every commenter on that person's recent posts — name, headline, profile URL, comment text and reactions. Also accepts direct post/article URLs. Provider-backed (ScrapeCreators + SociaVault); no cookies, no login. MCP/API-ready.

- **URL**: https://apify.com/khadinakbar/linkedin-profile-comments-scraper.md
- **Developed by:** [Khadin Akbar](https://apify.com/khadinakbar) (community)
- **Categories:** Social media, Lead generation, MCP servers
- **Stats:** 2 total users, 2 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 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 Profile Comments Scraper

**Turn a LinkedIn profile into a list of warm leads.** Give this actor a person's profile URL and it pulls their recent public posts, then returns **every person who commented** on them — commenter name, LinkedIn profile URL (the lead), and the comment text on every row. Headline, follower count, and per-comment reaction counts are included **when the data provider exposes them** (often null for public post comments). You can also pass direct post or article URLs to scrape the comments on a single post.

No LinkedIn login. No cookies. No browser extension. It runs on managed data providers (ScrapeCreators with SociaVault fallback), so you just paste URLs and get structured rows.

### What you can do with it

- **Social-selling lead lists** — everyone engaging with a prospect's or competitor's content is a warm, in-market lead.
- **Influencer / creator audience mining** — see who actually comments, not just who follows.
- **Event & launch follow-up** — pull commenters from an announcement post and reach out.
- **Competitive intelligence** — watch who engages with a rival's thought-leadership.
- **AI agents** — MCP-ready: one URL in, clean JSON out, predictable per-row pricing.

### When to use this vs. other LinkedIn actors

| You want… | Use |
|---|---|
| Commenters on a person's recent posts (from a profile URL) | **this actor** |
| Comments on specific post URLs you already have | **this actor** (paste post URLs) |
| Profile fields (bio, followers, experience) | `linkedin-profile-email-scraper` |
| Jobs with salary & skills | `linkedin-jobs-scraper` |

> This actor returns **who commented**. It does not return a person's own comment history across all of LinkedIn (that data is login-gated and not exposed publicly).

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `startUrls` | array | — (required) | LinkedIn **profile** URLs (`/in/...`) and/or **post/article** URLs. Auto-detected per URL. |
| `maxPostsPerProfile` | int | `5` | Recent posts to read per profile URL (1–50). |
| `maxCommentsPerPost` | int | `50` | Max comment rows per post (1–1000). |
| `maxResults` | int | `1000` | Hard cap on total comments charged/saved — your main cost control. |
| `outputMode` | enum | `comments` | `comments` (one row per comment) or `both` (also a post-summary row). |
| `dedupeComments` | bool | `true` | Drop duplicate comments per post. |
| `includeRawData` | bool | `false` | Attach raw provider payload to each row (debugging). |
| `maxConcurrency` | int | `2` | Posts fetched in parallel (1–5). |

#### Example input

```json
{
  "startUrls": [
    { "url": "https://www.linkedin.com/in/williamhgates/" },
    { "url": "https://www.linkedin.com/posts/some-author_activity-7429579034096726016" }
  ],
  "maxPostsPerProfile": 5,
  "maxCommentsPerPost": 50,
  "maxResults": 1000,
  "outputMode": "comments"
}
```

### Output

One row per comment. Key fields:

| Field | Description |
|---|---|
| `commenterName` | Person who left the comment (always present) |
| `commenterProfileUrl` | Their LinkedIn profile URL — **the lead** (always present) |
| `commentText` | The comment (always present when not an image-only comment) |
| `commenterHeadline` | Their job title / tagline — **only when the provider exposes it; usually null for post comments** |
| `commenterFollowers` | Their follower count — **only when exposed; usually null** |
| `commentReactionCount` / `replyCount` | Comment engagement — **only when exposed; usually null** |
| `postUrl` / `postAuthorName` | The post they commented on |
| `sourceType` | `profile` (found via a profile) or `post` (direct URL) |
| `sourceProfileUrl` / `sourceProfileName` | The input profile, when applicable |
| `source` | Provider used (`scrapecreators` / `sociavault`) |
| `scrapedAt` | ISO 8601 timestamp |

#### Example output row

```json
{
  "recordType": "comment",
  "sourceType": "profile",
  "sourceProfileUrl": "https://www.linkedin.com/in/williamhgates/",
  "sourceProfileName": "Bill Gates",
  "postUrl": "https://www.linkedin.com/posts/williamhgates_activity-7429579034096726016",
  "postAuthorName": "Bill Gates",
  "commenterName": "Jane Doe",
  "commenterProfileUrl": "https://www.linkedin.com/in/jane-doe/",
  "commentText": "This completely changed how we think about it.",
  "commenterHeadline": null,
  "commenterFollowers": null,
  "commentReactionCount": null,
  "replyCount": null,
  "source": "scrapecreators",
  "scrapedAt": "2026-06-19T08:30:00.000Z"
}
```

A machine-readable run summary (counts, billing, provider status, per-post outcomes, warnings) is written to the key-value store under `OUTPUT`.

### Pricing — pay per result

| Event | Price |
|---|---|
| Actor start | $0.00005 |
| Post processed | $0.01 per post fetched for comments |
| **Comment scraped** | **$0.006 per comment row** |

A typical run over one profile (5 posts × ~30 comments) costs roughly `5 × $0.01 + 150 × $0.006 ≈ $0.95`. Use `maxResults` to set a hard ceiling. The run log prints the cost cap before any charge and the actual spend at the end.

### Run via API

```bash
curl -X POST "https://api.apify.com/v2/acts/khadinakbar~linkedin-profile-comments-scraper/runs?token=YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "startUrls": [{ "url": "https://www.linkedin.com/in/williamhgates/" }], "maxPostsPerProfile": 5 }'
```

```javascript
import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: 'YOUR_TOKEN' });
const run = await client.actor('khadinakbar/linkedin-profile-comments-scraper').call({
  startUrls: [{ url: 'https://www.linkedin.com/in/williamhgates/' }],
  maxPostsPerProfile: 5,
  maxCommentsPerPost: 50,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

### Use with AI agents (MCP)

Exposed in the Apify MCP server as `apify--linkedin-profile-comments-scraper`. Hand an agent a profile URL and it gets a clean list of engagers to qualify or enrich — pair it with `linkedin-profile-email-scraper` to turn commenters into contactable leads.

### FAQ

**Do I need LinkedIn cookies or a login?** No. It uses managed providers — paste public URLs only.

**Why fewer comments than the post shows?** Providers expose the publicly visible comments per post; very large threads may be partial. Raise `maxCommentsPerPost` to capture more of what is exposed.

**A profile returned no posts — why?** The person may have no public posts, or the provider could not expose them. Pass their post URLs directly instead.

**Can it get a person's own comment history (everything they've commented on)?** No — that is login-gated and not publicly available. This actor returns commenters **on** posts.

**What if a provider is down?** It tries ScrapeCreators first, then SociaVault automatically, and reports provider status in the run summary.

### Legal & compliance

This actor collects only **publicly available** LinkedIn data via third-party data providers. It does not log into LinkedIn, bypass authentication, or access private/connection-gated content. You are responsible for using the data in compliance with LinkedIn's Terms of Service, the GDPR/CCPA, and any applicable laws (including lawful basis for processing personal data and honoring opt-outs). Do not use it for spam, harassment, or unlawful profiling. Provided "as is" without warranty.

# Actor input Schema

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

One or more LinkedIn URLs. A profile URL (e.g. https://www.linkedin.com/in/williamhgates/) is expanded into that person's recent public posts and the comments on each are returned. A post, feed-update, or Pulse article URL returns the comments on that single post. Mode is auto-detected per URL. NOT a search query — supply real LinkedIn URLs.

## `maxPostsPerProfile` (type: `integer`):

For each profile URL, how many of the person's most recent public posts to read comments from. Example: 5. Range 1-50, default 5. Ignored for direct post URLs (each direct URL is one post).

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

Maximum comment rows to save per post. Example: 50. Range 1-1000, default 50. The provider may expose fewer comments than this cap for a given post.

## `maxResults` (type: `integer`):

Hard ceiling on the total number of comment rows charged and saved across the whole run, regardless of how many posts are processed. Example: 1000. Use this as your primary cost control. Default 1000.

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

Choose 'comments' for one row per comment only, or 'both' to also emit a post-level summary row (author, reactions, comment count) for each post processed. Default 'comments'.

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

Remove duplicate comments per post using comment URL, commenter profile URL, and text. Keep enabled for cleaner lead lists. Default true.

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

Attach the raw provider post/comment payload to each dataset row. Enable only for debugging or custom parsing; it increases dataset size. Default false.

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

How many posts to fetch in parallel. Example: 2. Range 1-5, default 2. Keep low for predictable provider usage and cost.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www.linkedin.com/pulse/being-father-has-made-me-better-leader-vice-versa-austen-allred/"
    }
  ],
  "maxPostsPerProfile": 5,
  "maxCommentsPerPost": 50,
  "maxResults": 1000,
  "outputMode": "comments",
  "dedupeComments": true,
  "includeRawData": false,
  "maxConcurrency": 2
}
```

# Actor output Schema

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

Dataset items: one row per comment with commenter profile URL, headline, comment text, reactions, and the source post + profile context.

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

Run summary including postsProcessed, commentsSaved, 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 = {
    "startUrls": [
        {
            "url": "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-profile-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 = { "startUrls": [{ "url": "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-profile-comments-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 '{
  "startUrls": [
    {
      "url": "https://www.linkedin.com/pulse/being-father-has-made-me-better-leader-vice-versa-austen-allred/"
    }
  ]
}' |
apify call khadinakbar/linkedin-profile-comments-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/1b9TTUgfXLTcDA7Qr/builds/3F6IIMiAAHIhaTtSI/openapi.json
