# LinkedIn Post Comments Scraper - Top Comments, No Login (`socialscrapers/linkedin-post-comments-scraper`) Actor

LinkedIn post comments scraper: paste post links and get the public comments LinkedIn shows on each post, one row per comment with text, author name and profile link, date, reactions, images and the post's link and author. No login or cookies. JSON, CSV, Excel. $1.00 per 1,000 comments.

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

## Pricing

from $0.80 / 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/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

**LinkedIn Post Comments Scraper** turns LinkedIn post links into a table of their public comments: one row per comment, with the comment's text, the commenter's name and profile link, the date, reactions and any attached image, and the post's link and author on every row. It works without a LinkedIn account, cookies or login, so it gets the **top comments LinkedIn shows to logged-out visitors: up to 10 per post**. It costs **$1.00 per 1,000 comments**.

> 💡 **Need a feature that isn't here? Just ask.** Open an issue on the **Issues** tab and tell us what you need: a new field, filter, input type or output format. We build requested features fast, usually within 24 hours, at no extra cost.

> ⭐ **Found it useful?** A short review on the **Reviews** tab helps other people find this scraper, and tells us what to build next.

### What does LinkedIn Post Comments Scraper do?

- **Post links in, comments out.** Paste links as LinkedIn's "Copy link to post" gives them (`linkedin.com/posts/…`, `linkedin.com/feed/update/urn:li:activity:…`), or post IDs and URNs. Many posts per run.
- **One clean row per comment.** Each row stands on its own: the comment, who wrote it, when, how many reactions it got, and which post it belongs to, so the table sorts, filters and exports without any joining.
- **The top comments of each post.** A logged-out visitor sees the comments LinkedIn ranks first, up to 10. In our test of 300 recent posts by well-known people, the posts with 10 or more comments showed **9.25 comments on average, never more than 10**. `postCommentsCount` on every row tells you how many comments the post has in all.
- **Pay per comment.** Posts that show no comments, posts that are not public and links that cannot be read cost nothing.

**Good to know before you start:** replies to comments are not shown to logged-out visitors, so you get top-level comments only, and a post with thousands of comments still gives its top 10 or so. If you need the full comment thread of large posts, this Actor is not the right tool; if you want the comments that most people actually see under a post, across many posts, it is fast and cheap.

### What data can you extract?

| Field | What it holds |
|---|---|
| `text` | The comment, line breaks kept |
| `authorName`, `authorProfileUrl`, `authorImageUrl`, `authorType` | Who wrote it (`person` or `company`) |
| `authorHeadline` | The commenter's headline, on the comments where LinkedIn shows it (a small share of them) |
| `postedAt`, `postedAtTimestamp`, `postedAgo` | When it was written (ISO 8601 and milliseconds), the age LinkedIn shows |
| `reactionsCount` | Reactions to the comment |
| `images` | Images attached to the comment |
| `commentId`, `commentUrn` | The comment's IDs |
| `isReply` | Always `false` today: LinkedIn shows logged-out visitors top-level comments only |
| `postUrl`, `postId`, `postAuthorName`, `postAuthorProfileUrl`, `postCommentsCount` | The post the comment is on, its author, and how many comments it has in all |
| `inputUrl`, `scrapedAt` | The link as you gave it, when it was collected |

### How to scrape LinkedIn post comments

1. Paste post links or post IDs into **Post URLs**.
2. Keep **Max comments per post** at 0 for every comment shown, or set a smaller number.
3. Click **Start**. Download the comments as JSON, CSV, Excel, XML or HTML, or read them through the API.

### How much does it cost?

**$1.00 per 1,000 comments** saved. Apify subscribers pay less: **Silver −10%** ($0.90 per 1,000) and **Gold, Platinum and Diamond −20%** ($0.80 per 1,000). Each run also has a small start charge of $0.0008 (one per GB of memory, at least one).

| Job | Comments | Price (no discount) |
|---|---|---|
| 100 posts, every comment shown | up to about 1,000 | up to about $1.00 |
| 1,000 posts, the top 3 comments each | up to 3,000 | up to $3.00 |
| A weekly check of 20 posts | up to about 200 | up to about $0.20 |

Posts without comments, posts that are not public and links that cannot be read are free. To cap a run's spending, set its **maximum total charge** in the run options: the Actor stops cleanly at that amount and keeps every comment it saved.

### Input example

```json
{
  "postUrls": [
    "https://www.linkedin.com/posts/satyanadella_our-ambition-with-everything-we-are-announcing-activity-7528555595000545281-3EcZ",
    "urn:li:activity:7531543853288456193"
  ],
  "maxCommentsPerPost": 0
}
```

### Output example

```json
{
  "type": "comment",
  "commentId": "7528564838915158016",
  "commentUrn": "urn:li:comment:(urn:li:ugcPost:7528555528353005570,7528564838915158016)",
  "text": "Great set of announcements, and it was a pleasure to hear the keynote in person. Thank you for sharing!",
  "authorName": "Jane Example",
  "authorHeadline": "Data & AI Community Builder",
  "authorProfileUrl": "https://www.linkedin.com/in/jane-example",
  "authorType": "person",
  "authorImageUrl": "https://media.licdn.com/dms/image/v2/…/profile-displayphoto-shrink_400_400/…",
  "images": ["https://media.licdn.com/dms/image/v2/…/comment-image-shrink_8192_480/…"],
  "postedAt": "2026-11-17T21:08:51.569Z",
  "postedAtTimestamp": 1794949731569,
  "postedAgo": "2w",
  "reactionsCount": 14,
  "isReply": false,
  "postId": "7528555595000545281",
  "postUrl": "https://www.linkedin.com/posts/satyanadella_our-ambition-with-everything-we-are-announcing-activity-7528555595000545281-3EcZ",
  "postAuthorName": "Satya Nadella",
  "postAuthorProfileUrl": "https://www.linkedin.com/in/satyanadella",
  "postCommentsCount": 420,
  "inputUrl": "https://www.linkedin.com/posts/satyanadella_our-ambition-with-everything-we-are-announcing-activity-7528555595000545281-3EcZ",
  "scrapedAt": "2026-12-02T03:32:12.893Z"
}
```

### Use cases

- **Audience research.** Read what people say under the posts that matter in your market, at scale.
- **Campaign and launch feedback.** Collect the top reactions to your own or your competitors' announcements.
- **Lead research.** See which people and companies comment on posts in your niche, with their profile links.
- **Sentiment and topic analysis.** Feed the comments of hundreds of posts into your own analysis or language model.
- **Creator benchmarking.** Compare how the comments under different creators' posts read and how much they engage.

### API, Python, JavaScript & integrations

**Python**

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_APIFY_TOKEN>")
run = client.actor("socialscrapers/linkedin-post-comments-scraper").call(run_input={
    "postUrls": ["https://www.linkedin.com/posts/satyanadella_our-ambition-with-everything-we-are-announcing-activity-7528555595000545281-3EcZ"],
})
for comment in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(comment["authorName"], comment["reactionsCount"], comment["text"][:80])
```

**JavaScript**

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

const client = new ApifyClient({ token: '<YOUR_APIFY_TOKEN>' });
const run = await client.actor('socialscrapers/linkedin-post-comments-scraper').call({
    postUrls: ['urn:li:activity:7531543853288456193'],
    maxCommentsPerPost: 5,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items.length, 'comments');
```

Send the comments to **Google Sheets, Make, Zapier or n8n** with [Apify integrations](https://docs.apify.com/platform/integrations), get them by [webhook](https://docs.apify.com/platform/integrations/webhooks), run the Actor on a [schedule](https://docs.apify.com/platform/schedules), or call it from AI agents through the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp).

### Limits

- **Up to 10 comments per post**, the top ones, because that is what LinkedIn shows a visitor who is not logged in. The Actor never logs in, so the rest of a busy thread is out of reach.
- **No replies.** Replies to comments are shown only to signed-in members.
- **Public posts only.** A post shared with connections only, or deleted, ends with a clear status and costs nothing.
- **Post links only.** To get the posts of a profile or company page first, use our LinkedIn Profile Posts Scraper or LinkedIn Company Posts Scraper, then paste the post links here.
- **Image links expire** after a while; download them soon if you need them.

### FAQ

**Do I need a LinkedIn account or cookies?**
No. The Actor reads public post pages as a logged-out visitor.

**How many comments do I get per post?**
The top comments LinkedIn shows logged out: up to 10, usually 9 or 10 on a post with many comments. Every row has `postCommentsCount`, the post's full comment count.

**Does it get replies?**
No. LinkedIn shows replies only to signed-in members, and this Actor never signs in.

**Why did a post give no comments?**
It has none, LinkedIn shows none of them logged out, or the post is not public. The status message says which for each link, and nothing is charged for it.

**Is it legal to scrape LinkedIn comments?**
The Actor collects only what LinkedIn shows publicly to anyone who is not logged in. It is not affiliated with, endorsed by or licensed by LinkedIn. Comments are personal data (names, photos, profile links, opinions), so data-protection laws such as the GDPR and the CCPA apply to how you store and use them. You are responsible for using the data lawfully, including LinkedIn's terms; if in doubt, get legal advice.

**How fast is it?**
In our test, 2,457 comments from 300 posts in about 2.5 minutes with the default settings.

### Other scrapers by Social Scrapers

| Scraper | What it gets |
| --- | --- |
| [TikTok API](https://apify.com/socialscrapers/tiktok-api) | Profiles, Videos and Comments |
| [TikTok Comments Scraper](https://apify.com/socialscrapers/tiktok-comments-scraper) | Comments, Replies and Likes |
| [TikTok Hashtag Scraper](https://apify.com/socialscrapers/tiktok-hashtag-scraper) | Top Videos, Views and Likes |
| [TikTok Profile Scraper](https://apify.com/socialscrapers/tiktok-profile-scraper) | Followers, Bio, Stats and Videos |
| [TikTok Scraper](https://apify.com/socialscrapers/tiktok-scraper) | Videos, Profiles, Hashtags and Comments |
| [TikTok Sound Scraper](https://apify.com/socialscrapers/tiktok-sound-scraper) | Videos Using a Sound and Music Info |
| [TikTok Transcript Scraper](https://apify.com/socialscrapers/tiktok-transcript-scraper) | Video Captions and Subtitles to Text |
| [TikTok Video Scraper](https://apify.com/socialscrapers/tiktok-video-scraper) | Views, Likes, Captions and Comments |
| [Instagram API](https://apify.com/socialscrapers/instagram-api) | Profiles, Posts, Reels, Comments and Hashtags |
| [Instagram Comments Scraper](https://apify.com/socialscrapers/instagram-comments-scraper) | Comments, Likes and Reply Counts |
| [Instagram Email Scraper](https://apify.com/socialscrapers/instagram-email-scraper) | Emails and Phones from Public Profiles |
| [Instagram Hashtag Scraper](https://apify.com/socialscrapers/instagram-hashtag-scraper) | Reels and Keyword Search |
| [Instagram Post Details Scraper](https://apify.com/socialscrapers/instagram-post-details-scraper) | Likes, Comments, Views and Media |
| [Instagram Post Scraper](https://apify.com/socialscrapers/instagram-post-scraper) | Posts, Reels and Comments |
| [Instagram Profile Scraper](https://apify.com/socialscrapers/instagram-profile-scraper) | Followers, Bio, Posts and Reels |
| [Instagram Reels Scraper](https://apify.com/socialscrapers/instagram-reels-scraper) | Reels, Plays, Likes and Comments |
| [Instagram Reels Transcript Scraper](https://apify.com/socialscrapers/instagram-reels-transcript-scraper) | Speech to Text and Captions |
| [Instagram Scraper](https://apify.com/socialscrapers/instagram-scraper) | Posts, Profiles, Reels, Comments and Hashtags |
| [YouTube API](https://apify.com/socialscrapers/youtube-api) | Videos, Transcripts, Search, Channels and Comments |
| [YouTube Channel Scraper](https://apify.com/socialscrapers/youtube-channel-scraper) | Videos, Shorts, Subscribers and About |
| [YouTube Comments Scraper](https://apify.com/socialscrapers/youtube-comments-scraper) | Comments, Replies and Likes |
| [YouTube Scraper](https://apify.com/socialscrapers/youtube-scraper) | Videos, Shorts, Channels and Comments |
| [YouTube Search Scraper](https://apify.com/socialscrapers/youtube-search-scraper) | Videos, Channels, Views and Filters |
| [YouTube Shorts Scraper](https://apify.com/socialscrapers/youtube-shorts-scraper) | Shorts, Views, Likes and Search |
| [YouTube Transcript Scraper](https://apify.com/socialscrapers/youtube-transcript-scraper) | Subtitles, Captions and SRT |
| [YouTube Video Details Scraper](https://apify.com/socialscrapers/youtube-video-details-scraper) | Stats, Subtitles and Comments |
| [Facebook Ads Library Scraper](https://apify.com/socialscrapers/facebook-ads-library-scraper) | Meta Ad Library and Spend |
| [Facebook Comments Scraper](https://apify.com/socialscrapers/facebook-comments-scraper) | Posts, Reels, Videos and Replies |
| [Facebook Events Scraper](https://apify.com/socialscrapers/facebook-events-scraper) | Public Events, Dates and Hosts |
| [Facebook Groups Scraper](https://apify.com/socialscrapers/facebook-groups-scraper) | Public Group Posts and Reactions |
| [Facebook Marketplace Scraper](https://apify.com/socialscrapers/facebook-marketplace-scraper) | Prices, Locations and Sellers |
| [Facebook Page Contact Info Scraper](https://apify.com/socialscrapers/facebook-page-contact-scraper) | Email, Phone and WhatsApp |
| [Facebook Posts Scraper](https://apify.com/socialscrapers/facebook-profile-posts-scraper) | Pages, Profiles and Timelines |
| [Facebook Pages Scraper](https://apify.com/socialscrapers/facebook-profile-scraper) | Profiles, Contact Info and Reviews |
| [Facebook Reels Scraper](https://apify.com/socialscrapers/facebook-reels-scraper) | Reels, Videos, Plays and Captions |
| [X (Twitter) Profile Scraper](https://apify.com/socialscrapers/x-profile-scraper) | Followers, Bio and Tweets |
| [X (Twitter) Tweet Scraper](https://apify.com/socialscrapers/x-tweet-scraper) | Latest Posts by Profile |
| [Threads Profile Scraper](https://apify.com/socialscrapers/threads-profile-scraper) | Followers, Bio, Links and Posts |
| [Threads Replies Scraper](https://apify.com/socialscrapers/threads-replies-scraper) | Comments, Authors, Likes and Media |
| [Threads Scraper](https://apify.com/socialscrapers/threads-scraper) | Posts, Profiles, Replies and Search |
| [Threads Search Scraper](https://apify.com/socialscrapers/threads-search-scraper) | Keywords, Hashtags, Top and Recent Posts |
| [Reddit Comments Scraper](https://apify.com/socialscrapers/reddit-comments-scraper) | Threads, Replies, Votes and Authors |
| [Reddit Scraper](https://apify.com/socialscrapers/reddit-scraper) | Posts, Comments, Subreddits, Users and Search |
| [Reddit Search Scraper](https://apify.com/socialscrapers/reddit-search-scraper) | Posts by Keyword, Subreddit and Date |
| [Reddit User Scraper](https://apify.com/socialscrapers/reddit-user-scraper) | Profiles, Karma, Posts and Comments |
| [Subreddit Scraper](https://apify.com/socialscrapers/subreddit-scraper) | Hot, New and Top Posts with Comments |
| [Quora Scraper](https://apify.com/socialscrapers/quora-scraper) | Answers, Questions, Profiles and Topic Search |
| [LinkedIn Ad Library Scraper](https://apify.com/socialscrapers/linkedin-ad-library-scraper) | Ads, Advertisers and Impressions |
| [LinkedIn Company Posts Scraper](https://apify.com/socialscrapers/linkedin-company-posts-scraper) | Latest Posts, No Login |
| [LinkedIn Company Scraper](https://apify.com/socialscrapers/linkedin-company-scraper) | Company Details, Size and Website |
| [LinkedIn Job Search Scraper](https://apify.com/socialscrapers/linkedin-job-search-scraper) | Filters, Salaries and New Jobs |
| [LinkedIn Jobs Scraper](https://apify.com/socialscrapers/linkedin-jobs-scraper) | Job Listings, Salaries and Companies |
| [LinkedIn Posts Scraper](https://apify.com/socialscrapers/linkedin-posts-scraper) | Public Posts, Reactions and Comments |
| [LinkedIn Profile Posts Scraper](https://apify.com/socialscrapers/linkedin-profile-posts-scraper) | Latest Posts, No Login |
| [Google Maps Email Extractor](https://apify.com/socialscrapers/google-maps-email-extractor) | Emails, Phones and Social Links |
| [Google Maps Scraper](https://apify.com/socialscrapers/google-maps-scraper) | Places, Phones, Websites, Ratings and Hours |
| [Google News Scraper](https://apify.com/socialscrapers/google-news-scraper) | Headlines, Articles and Search |
| [Google Ads Transparency Scraper](https://apify.com/socialscrapers/google-ads-transparency-scraper) | Ad Creatives and Advertisers |
| [Amazon Best Sellers Scraper](https://apify.com/socialscrapers/amazon-bestsellers-scraper) | Top 100 Rankings and Prices |
| [Amazon Product Scraper](https://apify.com/socialscrapers/amazon-product-scraper) | Search Results, Prices, Ratings, ASINs |
| [Amazon Search Scraper](https://apify.com/socialscrapers/amazon-search-scraper) | Products, Prices and Ratings by Keyword |
| [Indeed Jobs Scraper](https://apify.com/socialscrapers/indeed-jobs-scraper) | Salaries, Full Descriptions, Company Data |
| [Contact Details Scraper](https://apify.com/socialscrapers/contact-details-scraper) | Emails, Phones and Social Links |
| [Telegram Channel Scraper](https://apify.com/socialscrapers/telegram-channel-scraper) | Posts, Views and Media |
| [Doximity Scraper](https://apify.com/socialscrapers/doximity-physician-scraper) | Physician Profiles and Doctor Directory |
| [KevinMD Scraper](https://apify.com/socialscrapers/kevinmd-articles-scraper) | Physician Articles and Author Specialties |
| [Op-Med Scraper](https://apify.com/socialscrapers/opmed-articles-scraper) | Physician Essays and Doctor Profiles |
| [Airbnb Reviews Scraper](https://apify.com/socialscrapers/airbnb-reviews-scraper) | Guest Reviews, Ratings and Hosts |
| [Airbnb Scraper](https://apify.com/socialscrapers/airbnb-scraper) | Listings, Prices, Reviews and Hosts |
| [Booking.com Scraper](https://apify.com/socialscrapers/booking-scraper) | Hotels, Prices and Reviews |
| [Career Site Jobs Scraper](https://apify.com/socialscrapers/career-site-jobs-scraper) | Greenhouse, Lever, Ashby and Workday |
| [eBay Scraper](https://apify.com/socialscrapers/ebay-scraper) | Listings, Prices, Item Details and Sellers |
| [Etsy Scraper](https://apify.com/socialscrapers/etsy-scraper) | Products, Prices, Shops and Reviews |
| [Google Shopping Scraper](https://apify.com/socialscrapers/google-shopping-scraper) | Products, Prices and Sellers |
| [Google Trends Scraper](https://apify.com/socialscrapers/google-trends-scraper) | Interest Over Time, Regions and Queries |
| [MercadoLibre Scraper](https://apify.com/socialscrapers/mercadolibre-scraper) | Products, Prices and Sellers |
| [Similarweb Scraper](https://apify.com/socialscrapers/similarweb-scraper) | Website Traffic, Rank and Visits |
| [Tripadvisor Reviews Scraper](https://apify.com/socialscrapers/tripadvisor-reviews-scraper) | Hotels, Restaurants and Attractions |
| [Tripadvisor Scraper](https://apify.com/socialscrapers/tripadvisor-scraper) | Hotels, Restaurants and Reviews |
| [Yelp Scraper](https://apify.com/socialscrapers/yelp-scraper) | Businesses, Reviews, Ratings and Contacts |
| [Zillow Property Scraper](https://apify.com/socialscrapers/zillow-property-scraper) | Home Details, Zestimate and History |
| [Zillow Scraper](https://apify.com/socialscrapers/zillow-scraper) | Listings, Prices, Zestimates and Agents |

# Actor input Schema

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

Links to LinkedIn posts, as "Copy link to post" gives them (linkedin.com/posts/…, linkedin.com/feed/update/urn:li:activity:…), or post IDs and URNs. Each post's public comments are saved, one row each.

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

Comments to save from each post. 0 saves every comment the post shows to logged-out visitors (up to about 10, the top ones). You pay per comment saved.

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

How many LinkedIn pages are loaded at the same time. Lower it if you see many refused requests in the log; runs with less than 512 MB of memory load fewer.

## `proxyConfiguration` (type: `object`):

Apify Proxy (the default) is recommended. The scraper picks Apify Proxy's tier itself: datacenter first, residential only for pages that are refused. Your own proxy URLs are used as given.

## `commentsOnly` (type: `boolean`):

Each post's comments, one row each, without the post.

## Actor input object example

```json
{
  "postUrls": [
    "https://www.linkedin.com/posts/williamhgates_how-ai-is-helping-kenyan-farmers-bill-gates-activity-7531543853288456193-Ku5w",
    "https://www.linkedin.com/posts/satyanadella_highlights-from-my-opening-of-the-ignite-activity-7528647007431720960-KV0i"
  ],
  "maxCommentsPerPost": 0,
  "maxConcurrency": 20,
  "proxyConfiguration": {
    "useApifyProxy": true
  },
  "commentsOnly": true
}
```

# Actor output Schema

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

No description

# 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/posts/williamhgates_how-ai-is-helping-kenyan-farmers-bill-gates-activity-7531543853288456193-Ku5w",
        "https://www.linkedin.com/posts/satyanadella_highlights-from-my-opening-of-the-ignite-activity-7528647007431720960-KV0i"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("socialscrapers/linkedin-post-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/posts/williamhgates_how-ai-is-helping-kenyan-farmers-bill-gates-activity-7531543853288456193-Ku5w",
        "https://www.linkedin.com/posts/satyanadella_highlights-from-my-opening-of-the-ignite-activity-7528647007431720960-KV0i",
    ],
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("socialscrapers/linkedin-post-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/posts/williamhgates_how-ai-is-helping-kenyan-farmers-bill-gates-activity-7531543853288456193-Ku5w",
    "https://www.linkedin.com/posts/satyanadella_highlights-from-my-opening-of-the-ignite-activity-7528647007431720960-KV0i"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call socialscrapers/linkedin-post-comments-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,socialscrapers/linkedin-post-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/e4EgPQGaRlpaEkpRf/builds/4sXYfbWLXNO7rIJp9/openapi.json
