# LinkedIn Profile Comments Scraper (`automation-lab/linkedin-profile-comments`) Actor

Export the recent public comments a LinkedIn person wrote: comment text, exact time, reactions, and the post they commented on with author and engagement. Batch profile URLs, dedupe keys, since cutoff. No login or cookies.

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

## Pricing

from $1.20 / 1,000 comment extracteds

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 Profile Comments Scraper

See **what a person recently commented on LinkedIn**. Paste one or more LinkedIn profile URLs and get each recent public comment as a structured row: the comment text, when it was written, how many reactions it got, and the post it was left on, with post text, author, publish time and engagement.

No LinkedIn login, cookies or account are needed. The Actor reads what LinkedIn shows logged-out visitors: the **Comments** tab of a public profile's Activity section and public post pages.

**Depth, up front:** LinkedIn shows logged-out visitors only each person's **most recent comments, usually 1 to 3 per profile**. This Actor does not log in, so it cannot page through older history. It suits checking many people on a schedule, not downloading one person's full comment archive.

### What does LinkedIn Profile Comments Scraper do?

For every profile you supply, the Actor:

1. opens the public LinkedIn profile page as a logged-out visitor;
2. reads the server-rendered **Comments** tab of the profile's Activity section;
3. opens the public page of each commented post to add the exact comment time, comment reactions and post details;
4. saves one row per comment, newest first;
5. adds one outcome row, with no per-row fee, when a profile has no public comments, is not visible to logged-out visitors, or could not be loaded.

It answers "what is this person saying, and on whose posts?", not "who commented on this post?".

### Who is it for?

- **Sales and account-based teams** finding a current, specific conversation opener for each prospect: what they just said and to whom.
- **Recruiters** learning what candidates care about before reaching out.
- **Founders and creators** tracking which conversations influential people in their niche join.
- **Market and competitive researchers** seeing what executives at key accounts say on vendor or industry posts.
- **RevOps and data teams** feeding audience-intent signals into a CRM, warehouse or alerting workflow.

### Why use this LinkedIn comments scraper?

- **Profile-first:** start from the people you care about, not from posts.
- **Batch many profiles in one run:** up to 1,000 unique profiles; duplicates are processed once.
- **Post context included:** post text, author, publish time, reactions, comment count and media in the same row.
- **Repeatable fingerprint:** `dedupeKey` stays identical across runs for the same profile, post link and text, so scheduled runs can be diffed to spot new comments. It is not a unique comment ID: see [Limits](#limits-and-how-failures-are-reported).
- **Incremental cutoff:** `since` keeps only comments written after a date or "7 days" ago.
- **Explicit outcomes:** every supplied profile ends as comments or a `no_public_comments`, `profile_unavailable`, `access_failed` or `not_processed` row. A blocked page is never reported as "no comments", and a profile the run could not reach is never silently dropped.
- **No account risk:** nothing logs in, so no LinkedIn account can be restricted.

### What LinkedIn comment data is extracted?

| Field | Meaning |
| --- | --- |
| `status` | `comment` for a comment row; `no_public_comments`, `profile_unavailable`, `access_failed` or `not_processed` for a per-profile outcome row (no per-row fee) |
| `profileUrl`, `profileSlug`, `profileName`, `profileHeadline` | The supplied person who wrote the comment |
| `dedupeKey` | Fingerprint of profile, post link and comment text, for spotting new comments between runs. Not a unique comment ID |
| `commentType` | `comment` or `reply` |
| `commentText` | Text of the comment |
| `actionText` | LinkedIn's activity line, e.g. "Jeff Weiner commented on a post" |
| `commentAge` | LinkedIn's relative age, e.g. `4d`, `3w`, `6mo` |
| `commentedAt` | Exact comment time, when the comment is located on the post page |
| `commentedAtEstimate` | Time estimated from the relative age, always available when an age is shown |
| `commentId`, `commentUrl` | Comment ID and direct link, when LinkedIn exposes them |
| `commentReactionCount` | Reactions on the comment, when located on the post page |
| `mentions` | People linked in the comment, with name and URL |
| `postDetailsStatus` | How complete the post details are (see below) |
| `postId`, `postUrl` | The post commented on |
| `postText` | Text of the post |
| `postAuthor` | Post author name, URL, type (person, company, showcase, school) and headline |
| `postPublishedAt` | When the post was published |
| `postReactionCount`, `postCommentCount` | Engagement on the post |
| `postMediaUrls` | Image, video and thumbnail URLs of the post |
| `position` | Order on the profile's Comments tab (1 = most recent) |
| `message` | Explanation on outcome rows |
| `scrapedAt` | When the row was produced |

`postDetailsStatus` tells you what each row contains:

| Value | Meaning |
| --- | --- |
| `complete` | Post details are filled and the comment was located on the post page, so `commentedAt` is filled when LinkedIn shows it. `commentReactionCount`, `commentId` and `commentUrl` are filled when the page exposes them and can be empty |
| `comment_not_on_post_page` | Post details are filled. LinkedIn's public post page lists only top comments and this one is not among them, so exact time and reactions are empty |
| `no_post_link` | LinkedIn shows this reply without a link to its post. The row has the comment text, age and mentions only |
| `post_unavailable` | The post page is gated for logged-out visitors. The row has the comment text, age, post link and mentions |

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

The Actor uses pay-per-event pricing. You pay for comments saved, a small fee for each profile LinkedIn answered for, and a small start fee per run. The profile fee applies to every answered lookup, including hidden, missing and comment-free profiles, because checking them costs the same work. `access_failed` and `not_processed` profiles are free. Comment rows cost the same whatever their `postDetailsStatus`.

| Event | Free plan | Bronze | Silver | Gold and above |
| --- | ---: | ---: | ---: | ---: |
| Run start (once per run) | $0.003 | $0.003 | $0.003 | $0.003 |
| Profile looked up | $0.00015 | $0.00015 | $0.000135 | $0.00012 |
| Comment saved | $0.0015 | $0.0015 | $0.00135 | $0.0012 |

Examples at the Bronze price:

- **1 profile, 2 comments:** $0.003 + $0.00015 + 2 × $0.0015 = **about $0.006**
- **25 prospects weekly, about 2 comments each:** $0.003 + 25 × $0.00015 + 50 × $0.0015 = **about $0.08 per week**
- **500 accounts, about 2 comments each:** $0.003 + 500 × $0.00015 + 1,000 × $0.0015 = **about $1.58**
- **100 profiles that all turn out hidden:** $0.003 + 100 × $0.00015 = **$0.018**

The number of comments per profile depends on how active the person is; observed profiles showed 1 to 3. To cap spend, lower the per-profile limit or set a maximum cost per run in the run options.

### How to scrape the comments a LinkedIn user wrote

1. Open the Actor in Apify Console and click **Try for free**.
2. Paste LinkedIn profile URLs (for example `https://www.linkedin.com/in/jeffweiner08/`) or bare profile IDs into **LinkedIn profile URLs**.
3. Optionally set **Maximum comments per profile** and **Only comments written since** (for example `30 days`).
4. Click **Start**. A run with a few profiles usually finishes in under a minute.
5. Open the **Comments** view of the dataset, or export JSON, CSV or Excel.
6. To monitor weekly, save the input as a Task and add a Schedule.

### Input parameters

| Field | Type | Default | Description |
| --- | --- | --- | --- |
| `profileUrls` | array of strings | required | Personal profile URLs (`linkedin.com/in/...`) or public profile IDs. Company, school and post URLs are rejected. Up to 1,000 unique profiles. |
| `maxCommentsPerProfile` | integer 1–100 | 20 | Per-profile cap on saved comments, newest first. LinkedIn usually shows 1 to 3, so the cap rarely matters. |
| `since` | string | empty | Keep only comments written on/after this date: `2026-10-01`, an ISO timestamp, or `7 days` / `2 weeks`. Uses the exact comment time when known, otherwise the estimate from the relative age. |

Example input:

```json
{
    "profileUrls": [
        "https://www.linkedin.com/in/jeffweiner08/",
        "https://www.linkedin.com/in/elenaverna/"
    ],
    "maxCommentsPerProfile": 20,
    "since": "30 days"
}
```

### Output example

A comment row from a real run:

```json
{
    "status": "comment",
    "profileUrl": "https://www.linkedin.com/in/jeffweiner08",
    "profileSlug": "jeffweiner08",
    "profileName": "Jeff Weiner",
    "profileHeadline": "Founding Partner Next Play Ventures; Former CEO LinkedIn",
    "dedupeKey": "5e1b0c7a42d94f6e8c3a1f27",
    "commentType": "comment",
    "commentText": "Noah, congrats to you, Dolapo and the entire Scuba team on making it official!",
    "actionText": "Jeff Weiner commented on a post",
    "commentAge": "3w",
    "commentedAt": "2026-10-13T17:38:24.128Z",
    "commentedAtEstimate": "2026-10-15T07:23:30.000Z",
    "commentId": "7515828300292796416",
    "commentUrl": "https://www.linkedin.com/feed/update/urn:li:activity:7515811958189658113?commentUrn=urn%3Ali%3Acomment%3A(urn%3Ali%3Aactivity%3A7515811958189658113%2C7515828300292796416)",
    "commentReactionCount": 4,
    "mentions": [{ "name": "Noah", "url": "https://www.linkedin.com/in/noahw" }],
    "postDetailsStatus": "complete",
    "postId": "7515811958189658113",
    "postUrl": "https://www.linkedin.com/posts/noahw_scuba-activity-7515811958189658113-5j6x",
    "postText": "Today Dolapo Falola and I ...",
    "postAuthor": { "name": "Noah Desai Weiss", "url": "https://www.linkedin.com/in/noahw", "type": "person", "headline": null },
    "postPublishedAt": "2026-10-13T16:33:27.865Z",
    "postReactionCount": 394,
    "postCommentCount": 88,
    "postMediaUrls": ["https://media.licdn.com/dms/image/..."],
    "position": 2,
    "message": null,
    "scrapedAt": "2026-11-05T07:23:54.203Z"
}
```

An outcome row for a profile without public comments (no per-row fee, only the profile fee):

```json
{
    "status": "no_public_comments",
    "profileUrl": "https://www.linkedin.com/in/justinwelsh",
    "profileSlug": "justinwelsh",
    "profileName": "Justin Welsh",
    "dedupeKey": null,
    "commentText": null,
    "message": "LinkedIn shows no public comment activity for this profile to logged-out visitors.",
    "scrapedAt": "2026-11-05T07:23:52.376Z"
}
```

The key-value store also contains `RUN_SUMMARY` with counts of requested and processed profiles, comments, outcomes and requests, plus `stopReason` and `notProcessedProfiles` when a run stopped early.

### Limits and how failures are reported

- **Recent comments only.** LinkedIn shows logged-out visitors only a person's most recent public comments, usually 1 to 3. The Actor does not log in, so it cannot reach older history. Run it on a schedule to build a history over time; `dedupeKey` helps you spot comments you have not seen yet. If you need a person's full comment archive, this is not the right tool.
- **`dedupeKey` is a fingerprint, not a unique ID.** It is built from the profile, post link and comment text. LinkedIn's logged-out pages show no comment ID for many rows, so two different comments with the same text collide: for example two replies saying "Thanks!" with no post link, or the same text twice on one post. Use it to detect new comments. If you must keep every row, append all rows and do not upsert on this key alone.
- **Exact time and reactions are not always available.** LinkedIn's public post page lists only top comments. When the comment is not among them, or when the page does not show clearly that the comment is this person's, `commentedAt` and `commentReactionCount` are empty and `commentedAtEstimate` carries the time from the relative age. The Actor would rather leave these fields empty than copy them from another person's comment.
- **Some replies have no post link.** LinkedIn shows many replies without a link to their post, so post fields are empty (`no_post_link`). The first entry in `mentions` is usually the person replied to.
- **Image-only comments are skipped.** A comment with no text is not saved or charged.
- **Reply counts and per-type reaction breakdowns are not included.** LinkedIn's logged-out pages do not show them for a comment.
- **Hidden or missing profiles** return `profile_unavailable` and pay the profile fee only. A noticeable share of real profiles, including some well-known ones, are not shown to logged-out visitors at all. LinkedIn answers missing profiles the same way it answers blocked visitors, so the Actor confirms with two healthy connections before reporting a profile as unavailable.
- **Temporary blocks** return `access_failed` after up to five fresh datacenter connections. These rows are free; retry later.
- **Run timeout.** The default timeout is 1 hour. If the run reaches its timeout first, every profile that did not finish gets a `not_processed` row with no row fee, `RUN_SUMMARY.notProcessedProfiles` lists them, and the run ends as **failed** so schedules notice. Saved comments stay in the dataset; rerun only the listed profiles.
- **Your maximum charge limit.** If the run reaches the maximum cost you set, it stops, lists the remaining profiles as `not_processed` rows and ends as **succeeded** with a status message, because you chose that limit. A profile that was cut off midway keeps its saved (charged) comments; its `not_processed` row says how many were saved and that the rest were not charged. `RUN_SUMMARY.partiallyProcessedProfiles` lists those profiles.
- **Storage or billing errors.** If a charged row cannot be saved after three attempts, the run stops instead of fetching the profile again, so no comment is charged or saved twice. The profile being saved and all remaining profiles get `not_processed` rows (the rows themselves are not charged), and the run fails. A comment that was charged but not saved is reported in that profile's row and in `RUN_SUMMARY.chargedWithoutRow`.
- If every profile in a run fails to load, the run ends as failed so schedules and integrations notice.

### Integrations and workflows

- **Weekly outreach signals:** schedule a Task with your target buyers and `since: "7 days"`; send new rows to Google Sheets, HubSpot or Salesforce through Make, Zapier or n8n.
- **Personalized openers:** feed `commentText` and `postText` to your AI or email tool to draft a first line that references what the prospect actually said.
- **Slack alerts:** trigger a webhook on run success and post comments on competitor or partner posts to a channel.
- **Warehouse sync:** load the dataset to BigQuery or Snowflake and use `dedupeKey` to flag comments you have not seen yet.
- **Combine with other data:** enrich `postAuthor.url` with profile data, or pull a full post with a post scraper.

### Use the API

cURL:

```bash
curl -X POST "https://api.apify.com/v2/acts/automation-lab~linkedin-profile-comments/run-sync-get-dataset-items?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"profileUrls":["https://www.linkedin.com/in/jeffweiner08/"],"since":"30 days"}'
```

JavaScript:

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

const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('automation-lab/linkedin-profile-comments').call({
    profileUrls: ['https://www.linkedin.com/in/jeffweiner08/', 'elenaverna'],
    maxCommentsPerProfile: 20,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items.filter((row) => row.status === 'comment'));
```

Python:

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("automation-lab/linkedin-profile-comments").call(
    run_input={"profileUrls": ["https://www.linkedin.com/in/jeffweiner08/"], "since": "30 days"}
)
for row in client.dataset(run["defaultDatasetId"]).iterate_items():
    if row["status"] == "comment":
        print(row["commentText"], row["postUrl"])
```

### Use with AI agents via MCP

Connect this Actor to Claude Code, Claude Desktop, Cursor or another MCP client through the Apify MCP server.

#### Claude Code

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

#### Claude Desktop

Add this server object to the Claude Desktop MCP configuration:

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

#### Cursor

Add the same `apify` server under **Settings → MCP** in Cursor.

#### VS Code

Add the same Actor-specific URL to your VS Code MCP server configuration. Your client opens the Apify OAuth flow the first time it connects.

This Actor-specific URL also exposes the helper tools `get-actor-run`, `get-dataset-items`, `get-key-value-store-record` and `abort-actor-run`, so the server offers more than one tool. List the tools first and use only the ones you need. A reliable agent workflow:

1. **Start one run and keep its IDs.** Keep the returned run ID, status and dataset ID (`defaultDatasetId`). These are run details, not results. `call-actor` waits at most 45 seconds (`waitSecs` 0–45, default 30), so the run may still be going.
2. **Follow the same run.** If the run is not finished, call `get-actor-run` for that same run ID with short backoff (2, 4, 8, then 10 seconds) up to a deadline you choose, such as 120 seconds. Set the client request timeout longer than the server wait. After a client timeout, check the known run again instead of starting a new one. If you never got a run ID, report that rather than rerunning blindly. At the deadline, report the run as still running with its ID and stop polling.
3. **Report failures honestly.** If the run fails, times out or is aborted, any rows already in the dataset are a partial result, not a complete answer. Check `status` for `not_processed` rows and `RUN_SUMMARY` (`get-key-value-store-record`) for `stopReason`, `notProcessedProfiles` and `partiallyProcessedProfiles`.
4. **Read bounded pages.** When the run succeeds, call `get-dataset-items` with the dataset ID, an explicit `limit` and `offset`, and only the `fields` you need (for example `profileSlug,commentText,commentedAt,postAuthor,postUrl`). Use pages of about 20 rows from offset 0 and stop at a budget such as 100 rows or 64 KiB of result text in the model's context, whichever comes first. Track the source offset, not how many rows you kept after filtering.
5. **Handle large rows.** `postText` can be long. If a page is larger than your byte budget, have the client trim or summarize it before it reaches the model and say so. If your client cannot inspect responses before the model sees them, request fewer rows and fields; it cannot guarantee a hard byte limit.
6. **Say when results are partial.** When you stop at a budget, report how many rows you read, the next offset and that the result is truncated. For a full export, download the dataset through the API or an integration outside the model's context.

These page sizes and deadlines are example choices, not Apify defaults. They limit what enters the model's context only; the Actor still collects and stores every row.

Example prompts:

- "What did jeffweiner08 and elenaverna comment on LinkedIn in the last 30 days? Group by post author."
- "For these 20 prospect profiles, draft one opener per person based on their latest comment."

### Is it legal to scrape LinkedIn comments?

The Actor reads only information that LinkedIn shows to any logged-out visitor. It does not log in, bypass privacy settings or access private data. Comments are still personal data: you are responsible for having a lawful basis (for example GDPR legitimate interest), respecting LinkedIn's terms, and not using the data for spam. If in doubt, ask your legal counsel. This Actor is not affiliated with or endorsed by LinkedIn.

### 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 and cookies are never sent, and reports are retained for 30 days. Expected empty profiles and ordinary retries are not error reports.

### FAQ

**Why do I get only a few comments per profile?**
LinkedIn shows logged-out visitors only the most recent public comments on a profile, usually 1 to 3. Schedule the Actor to collect new comments over time.

**Can I get a person's full comment history?**
No. Older comments need a logged-in LinkedIn account, and this Actor never uses one.

**Why did a profile return `no_public_comments`?**
The profile loaded, but LinkedIn shows no public comments for it. Some people hide their activity or rarely comment.

**Why did a profile return `profile_unavailable`?**
The profile does not exist, was renamed, or its owner hides it from logged-out visitors. You pay only the small profile fee for the lookup.

**Why did a profile return `access_failed`?**
LinkedIn refused several fresh connections. The row is free; rerun later.

**Why are `postText` and `commentedAt` empty on some rows?**
Check `postDetailsStatus`. LinkedIn shows many replies without a link to their post, and its public post pages list only top comments.

**Can I scrape comments by a company page?**
No. Only personal profiles (`linkedin.com/in/...`) are supported.

### Related LinkedIn scrapers

- [LinkedIn Profile Reactions Scraper](https://apify.com/automation-lab/linkedin-profile-reaction-activity): posts a person recently reacted to.
- [LinkedIn Profile Posts Scraper](https://apify.com/automation-lab/linkedin-profile-posts-scraper): posts written by a profile.
- [LinkedIn Post Comments and Reactions Scraper](https://apify.com/automation-lab/linkedin-post-comments-reactions-scraper): everyone who commented on a given post.
- [LinkedIn Profile Scraper](https://apify.com/automation-lab/linkedin-profile-scraper): profile details for enrichment.

# Changelog

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

# Actor input Schema

## `profileUrls` (type: `array`):

Personal LinkedIn profile URLs (https://www.linkedin.com/in/<id>) or bare public profile IDs such as jeffweiner08. Company, school and post URLs are rejected. Duplicate profiles are processed once. Up to 1,000 unique profiles per run.

## `maxCommentsPerProfile` (type: `integer`):

Upper limit of comment rows saved for each profile, newest first. This is a per-profile cap, not a run total. LinkedIn shows logged-out visitors only a person's most recent public comments (usually 1 to 3), so a higher value cannot return more than LinkedIn exposes.

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

Optional incremental cutoff. Keeps only comments written on or after this date. Accepts 2026-10-01, a full ISO timestamp, or a relative value such as "7 days" or "2 weeks". The cutoff uses the comment's exact time when its post page shows it, otherwise the time estimated from LinkedIn's relative age ("3w"). Leave empty to keep every visible comment.

## Actor input object example

```json
{
  "profileUrls": [
    "https://www.linkedin.com/in/jeffweiner08/",
    "https://www.linkedin.com/in/elenaverna/"
  ],
  "maxCommentsPerProfile": 20,
  "since": "30 days"
}
```

# Actor output Schema

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

Dataset rows: one per public comment (status comment) and one outcome row (no per-row fee) per profile with no comments, hidden/missing profile or access failure.

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

RUN_SUMMARY record with counts of profiles, comments saved, outcome rows, requests and early-stop flags.

# 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 = {
    "profileUrls": [
        "https://www.linkedin.com/in/jeffweiner08/",
        "https://www.linkedin.com/in/elenaverna/"
    ],
    "maxCommentsPerProfile": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("automation-lab/linkedin-profile-comments").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 = {
    "profileUrls": [
        "https://www.linkedin.com/in/jeffweiner08/",
        "https://www.linkedin.com/in/elenaverna/",
    ],
    "maxCommentsPerProfile": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("automation-lab/linkedin-profile-comments").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 '{
  "profileUrls": [
    "https://www.linkedin.com/in/jeffweiner08/",
    "https://www.linkedin.com/in/elenaverna/"
  ],
  "maxCommentsPerProfile": 20
}' |
apify call automation-lab/linkedin-profile-comments --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,automation-lab/linkedin-profile-comments"
        }
    }
}
```

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/qmk5ZSfc3vlSBb2UV/builds/5tHg6kPzGVRswJJ1a/openapi.json
