# LinkedIn Post Comments Scraper (No Cookies) (`harvestapi/linkedin-post-comments`) Actor

Extract LinkedIn post comments or comment replies in bulk, as well as comment social activities such as the number of likes and reactions. No cookies or account required

- **URL**: https://apify.com/harvestapi/linkedin-post-comments.md
- **Developed by:** [HarvestAPI](https://apify.com/harvestapi) (community)
- **Categories:** Social media, Lead generation, Automation
- **Features:** Limited permissions
- **Stats:** 11,061 total users, 3,218 monthly users, 100.0% runs succeeded, 125 bookmarks
- **User rating**: 4.78 out of 5 stars

## Pricing

from $1.50 / 1,000 post comment results

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 Post Comments Mass scraper

Our powerful tool helps you extract LinkedIn post comments, scrape comments or replies to comments as well as comment social activities such as likes and reactions without compromising security or violating platform policies. It is very helpful for engagement analysis and outreach purposes.

#### Key Benefits

- No cookies or account required: Access comments data without sharing cookies or risking account restrictions
- Low pricing: $2 per 1k comments.
- Fast response times deliver data in seconds 🚀
- No caching, fresh data.

### How It Works

- (required) List of: Post URLs or post comments URL to scrape.

When a post URL provided, the actor will scrape all comments under the post. It will also collect up to 5 replies to comments. Replies in this case are nested inside comments, so they won't be counted as separate results. Please note that the total count of results will be different from LinkedIn's counter, because LinkedIn counts comments and replies while we count only root comments.

When a post comment URL is provided, the actor will scrape only that specific comment with a limited number of nested replies. If you wish to scrape all replies to that comment, enable the `Scrape Replies` input toggle - in this case, replies will be counted as separate results.

Other params (optionally):

- `maxItems` - Maximum number of comments to scrape per each post. If you set to 0, it will scrape all available pages or up to 100 pages (each page 10 items) per post.
- `postedLimit` - Limit comments to those posted within a certain timeframe. Supported values: `24h`, `week`, `month`, `3months`, `6months`, `year`. Default is to scrape all comments.
- `profileScraperMode` - Set this to `main` to enrich comment actors with main profile data (position, profile picture, etc.). Note that this will increase the cost of the actor as profile scraping is charged separately.

#### Data You'll Receive

- Comment URL
- Comment text
- Number of replies, likes, shares
- Reaction type counts (like, love, insightful, etc.)
- Actor's name
- Actor's LinkedIn URL
- Actor's position
- Actor's profile picture URL
- Comment creation date

#### Sample output data

Here is the example comment output of this actor:

```json
{
  "type": "comment",
  "id": "7331190065471078400",
  "linkedinUrl": "https://www.linkedin.com/feed/update/urn:li:activity:7328838056403173380?commentUrn=urn%3Ali%3Acomment%3A%28activity%3A7328838056403173380%2C7331190065471078400%29&dashCommentUrn=urn%3Ali%3Afsd_comment%3A%287331190065471078400%2Curn%3Ali%3Aactivity%3A7328838056403173380%29",
  "commentary": "❤️",
  "createdAt": "2025-05-22T05:31:58.534Z",
  "numComments": 0,
  "numShares": null,
  "numImpressions": null,
  "reactionTypeCounts": [
    {
      "type": "LIKE",
      "count": 1
    }
  ],
  "actor": {
    "id": "ACoAAFsE9LEBl7BKtsoGeoDZz0IvKfmiGgiEtX8",
    "name": "Leek Gai",
    "linkedinUrl": "https://www.linkedin.com/in/leek-gai-3a94a6367",
    "position": "Student at Bugema University",
    "pictureUrl": "https://media.licdn.com/dms/image/v2/D4D03AQFWtueH_5zHYQ/profile-displayphoto-shrink_800_800/B4DZb4IP4IG0Ac-/0/1747919636435?e=1753315200&v=beta&t=ykKTPu2Mkc6i9uyRaHXm8yziqM3dkd18zLaRQ8dCLdg",
    "picture": {
      "url": "https://media.licdn.com/dms/image/v2/D4D03AQFWtueH_5zHYQ/profile-displayphoto-shrink_800_800/B4DZb4IP4IG0Ac-/0/1747919636435?e=1753315200&v=beta&t=ykKTPu2Mkc6i9uyRaHXm8yziqM3dkd18zLaRQ8dCLdg",
      "width": 800,
      "height": 800,
      "expiresAt": 1753315200000
    },
    "author": false
  },
  "createdAtTimestamp": 1747891918534,
  "pinned": false,
  "contributed": false,
  "edited": false,
  "postId": "7328838056403173380"
}
```

### Linkedin Post Comment API

The actor stores results in a dataset. You can export data in various formats such as CSV, JSON, XLS, etc. You can scrape and access data on demand using API.

#### Support and Feedback

We continuously enhance our tools based on user feedback. If you encounter technical issues or have suggestions for improvement:

- Create an issue on the actor’s Issues tab in Apify Console
- Chat with us on our [Discord server](https://discord.gg/TGA9k9u2gE)
- Or contact us at contact@harvest-api.com

**\* \* \***

**Disclaimer**: This Actor is an independent tool and is not affiliated with, endorsed by, or sponsored by LinkedIn Corporation. LinkedIn® is a registered trademark of LinkedIn Corporation. All trademarks are property of their respective owners.

# Actor input Schema

## `posts` (type: `array`):

Queries to search LinkedIn profiles by name.

## `maxItems` (type: `integer`):

Maximum number of comments to scrape per each post

## `postedLimit` (type: `string`):

Fetch comments no older than X time. Options: '24h', 'week', 'month'.

## `scrapeReplies` (type: `boolean`):

Whether to scrape replies to comments.

## `profileScraperMode` (type: `string`):

Choose the mode for scraping LinkedIn profiles. The Short mode provides basic information, while the Full mode includes full detailed profile data.

## Actor input object example

```json
{
  "posts": [
    "https://www.linkedin.com/posts/microsoft-events_microsoft-build-has-arrived-in-seattle-and-ugcPost-7329991434395160578-GnK7?utm_source=share&utm_medium=member_desktop&rcm=ACoAACzazy4B3ajZsA0WxWr6m4S77iItYbYCLZM",
    "https://www.linkedin.com/feed/update/urn:li:activity:7320867199693246465/",
    "https://www.linkedin.com/feed/update/urn:li:ugcPost:7396563121059872768?commentUrn=urn%3Ali%3Acomment%3A%28ugcPost%3A7396563121059872768%2C7396565439390076928%29&dashCommentUrn=urn%3Ali%3Afsd_comment%3A%287396565439390076928%2Curn%3Ali%3AugcPost%3A7396563121059872768%29"
  ],
  "maxItems": 10,
  "scrapeReplies": false,
  "profileScraperMode": "short"
}
```

# 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 = {
    "posts": [
        "https://www.linkedin.com/posts/microsoft-events_microsoft-build-has-arrived-in-seattle-and-ugcPost-7329991434395160578-GnK7?utm_source=share&utm_medium=member_desktop&rcm=ACoAACzazy4B3ajZsA0WxWr6m4S77iItYbYCLZM",
        "https://www.linkedin.com/feed/update/urn:li:activity:7320867199693246465/",
        "https://www.linkedin.com/feed/update/urn:li:ugcPost:7396563121059872768?commentUrn=urn%3Ali%3Acomment%3A%28ugcPost%3A7396563121059872768%2C7396565439390076928%29&dashCommentUrn=urn%3Ali%3Afsd_comment%3A%287396565439390076928%2Curn%3Ali%3AugcPost%3A7396563121059872768%29"
    ],
    "maxItems": 10,
    "scrapeReplies": false
};

// Run the Actor and wait for it to finish
const run = await client.actor("harvestapi/linkedin-post-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 = {
    "posts": [
        "https://www.linkedin.com/posts/microsoft-events_microsoft-build-has-arrived-in-seattle-and-ugcPost-7329991434395160578-GnK7?utm_source=share&utm_medium=member_desktop&rcm=ACoAACzazy4B3ajZsA0WxWr6m4S77iItYbYCLZM",
        "https://www.linkedin.com/feed/update/urn:li:activity:7320867199693246465/",
        "https://www.linkedin.com/feed/update/urn:li:ugcPost:7396563121059872768?commentUrn=urn%3Ali%3Acomment%3A%28ugcPost%3A7396563121059872768%2C7396565439390076928%29&dashCommentUrn=urn%3Ali%3Afsd_comment%3A%287396565439390076928%2Curn%3Ali%3AugcPost%3A7396563121059872768%29",
    ],
    "maxItems": 10,
    "scrapeReplies": False,
}

# Run the Actor and wait for it to finish
run = client.actor("harvestapi/linkedin-post-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 '{
  "posts": [
    "https://www.linkedin.com/posts/microsoft-events_microsoft-build-has-arrived-in-seattle-and-ugcPost-7329991434395160578-GnK7?utm_source=share&utm_medium=member_desktop&rcm=ACoAACzazy4B3ajZsA0WxWr6m4S77iItYbYCLZM",
    "https://www.linkedin.com/feed/update/urn:li:activity:7320867199693246465/",
    "https://www.linkedin.com/feed/update/urn:li:ugcPost:7396563121059872768?commentUrn=urn%3Ali%3Acomment%3A%28ugcPost%3A7396563121059872768%2C7396565439390076928%29&dashCommentUrn=urn%3Ali%3Afsd_comment%3A%287396565439390076928%2Curn%3Ali%3AugcPost%3A7396563121059872768%29"
  ],
  "maxItems": 10,
  "scrapeReplies": false
}' |
apify call harvestapi/linkedin-post-comments --silent --output-dataset

```

## MCP server setup

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