# LinkedIn Profile & Company Posts Scraper (Engagers & Comments) (`scraping_solutions/linkedin-profile-company-posts-scraper-engagers-comments`) Actor

Scrape LinkedIn posts from profiles and companies, and extract engagers, reposts, and comments. Supports post URLs, runs in parallel, and delivers clean structured data for lead generation, analytics, and automation.

- **URL**: https://apify.com/scraping\_solutions/linkedin-profile-company-posts-scraper-engagers-comments.md
- **Developed by:** [Scraping Solutions](https://apify.com/scraping_solutions) (community)
- **Categories:** Lead generation, Social media, Automation
- **Stats:** 5 total users, 3 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $1.20 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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 Scraper: Posts, Engagers, Reposts & Comments

Extract valuable LinkedIn data from **profiles, companies, or specific posts**.  
This actor collects posts and optionally enriches them with **reactions, reposts, and comments** for deeper insights and lead generation.

---

### ✨ What this actor does

This actor allows you to:

- Scrape posts from:
  - 👤 LinkedIn profiles
  - 🏢 Company pages
  - 🔗 Direct post URLs
- Extract engagement data:
  - 👍 Reactions (engagers)
  - 🔁 Reposts (reshares)
  - 💬 Comments
- Run multiple targets in parallel
- Handle API failures with retries
- Stream results in real time to dataset

---

### 📥 Input

#### Targets

Provide one or more targets:

```json
"targetUrls": [
  "https://www.linkedin.com/in/satyanadella/",
  "company:google",
  "https://www.linkedin.com/posts/..."
]
````

Supported formats:

| Type | Example |
|------|--------|
| Profile URL | https://www.linkedin.com/in/username/ |
| Company | company:google |
| Post URL | https://www.linkedin.com/posts/... |
| Username | satyanadella |

***

### ⚙️ Configuration

#### Posts

| Field | Description |
|------|------------|
| `maxPosts` | Max posts per target |
| `includeQuotePosts` | Include quote posts |
| `includeReposts` | Include repost-type posts |

***

#### Reactions (Engagers)

| Field | Description |
|------|------------|
| `scrapeReactions` | Enable reactions |
| `maxReactions` | Limit reactions per post |

***

#### Reposts (Reshares)

| Field | Description |
|------|------------|
| `scrapeReposts` | Enable reposts |
| `maxReposts` | Limit reposts per post |

***

#### Comments

| Field | Description |
|------|------------|
| `scrapeComments` | Enable comments |
| `maxComments` | Limit comments per post |
| `commentSortOrder` | Most relevant / Most recent |

***

### ▶️ Example Input

```json
{
  "targetUrls": [
    "https://www.linkedin.com/in/satyanadella/",
    "company:google"
  ],
  "maxPosts": 5,
  "scrapeReactions": true,
  "maxReactions": 5,
  "scrapeReposts": true,
  "maxReposts": 5,
  "scrapeComments": true,
  "maxComments": 5,
  "commentSortOrder": "Most relevant"
}
```

***

### 📤 Output

The dataset contains multiple item types:

#### 📝 Post

- content
- author
- engagement stats
- media (images, video, etc.)

#### 👍 Reaction

- reaction type
- user info
- linked post

#### 🔁 Repost

- reposter info
- original post reference

#### 💬 Comment

- text
- author
- replies
- reaction counts

***

### ⚙️ How it works

1. Extract posts from each target
2. Push posts immediately
3. For each post:
   - Fetch reactions
   - Fetch reposts
   - Fetch comments
4. Push results incrementally
5. Stop automatically if limits are reached

***

### ⚡ Performance

- Parallel processing of targets
- Parallel processing of posts
- Retry mechanism with backoff
- Deduplication of results

***

### 💸 Monetization (Optional)

Supports Apify **Pay Per Event**:

- 1 post = 1 event
- 1 reaction = 1 event
- 1 repost = 1 event
- 1 comment = 1 event

Enable with:

```bash
ENABLE_PPE_CHARGING=true
```

***

### ⚠️ Notes

- Data depends on provider API limits
- Some endpoints may return partial results
- Actor is resilient and continues on failures

***

### 🎯 Use Cases

- Lead generation (engagers & commenters)
- Social media analytics
- Influencer research
- Competitor monitoring
- Content performance analysis

***

### 💡 Pro Tips

- Start with low limits to control cost
- Use comments + reactions for richer data
- Combine multiple targets in one run
- Increase concurrency for faster results

***

Enjoy scraping! 🚀

# Actor input Schema

## `targetUrls` (type: `array`):

LinkedIn profile URLs, company URLs, post URLs, or plain usernames.

## `maxPosts` (type: `integer`):

Maximum number of posts to scrape per profile/company target. Set 0 to extract as many as possible within the internal safety limits.

## `includeQuotePosts` (type: `boolean`):

If false, quote posts are filtered out from profile/company feeds.

## `includeReposts` (type: `boolean`):

If false, repost-type posts from profile/company feeds are filtered out.

## `scrapeReactions` (type: `boolean`):

Extract people who reacted to each scraped post.

## `maxReactions` (type: `integer`):

Maximum reactions to scrape per post. Set 0 to extract as many as possible within the internal safety limits.

## `scrapeReposts` (type: `boolean`):

Extract people who reposted/reshared each scraped post.

## `maxReposts` (type: `integer`):

Maximum reposts to scrape per post. Set 0 to extract as many as possible within the internal safety limits.

## `scrapeComments` (type: `boolean`):

Extract comments for each scraped post.

## `maxComments` (type: `integer`):

Maximum comments to scrape per post. Set 0 to extract as many as possible within the internal safety limits.

## `commentSortOrder` (type: `string`):

Sort order used by the comments endpoint.

## Actor input object example

```json
{
  "targetUrls": [
    "https://www.linkedin.com/in/satyanadella/",
    "company:google",
    "https://www.linkedin.com/posts/satyanadella_mayo-clinic-accelerates-personalized-medicine-activity-7285003244957773826-TrmI/"
  ],
  "maxPosts": 10,
  "includeQuotePosts": true,
  "includeReposts": true,
  "scrapeReactions": false,
  "maxReactions": 10,
  "scrapeReposts": false,
  "maxReposts": 10,
  "scrapeComments": false,
  "maxComments": 10,
  "commentSortOrder": "Most relevant"
}
```

# Actor output Schema

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

Scraped LinkedIn posts, reactions, reposts, and comments stored in the default dataset.

# 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 = {
    "targetUrls": [
        "https://www.linkedin.com/in/satyanadella/",
        "company:google",
        "https://www.linkedin.com/posts/satyanadella_mayo-clinic-accelerates-personalized-medicine-activity-7285003244957773826-TrmI/"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("scraping_solutions/linkedin-profile-company-posts-scraper-engagers-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 = { "targetUrls": [
        "https://www.linkedin.com/in/satyanadella/",
        "company:google",
        "https://www.linkedin.com/posts/satyanadella_mayo-clinic-accelerates-personalized-medicine-activity-7285003244957773826-TrmI/",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("scraping_solutions/linkedin-profile-company-posts-scraper-engagers-comments").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 '{
  "targetUrls": [
    "https://www.linkedin.com/in/satyanadella/",
    "company:google",
    "https://www.linkedin.com/posts/satyanadella_mayo-clinic-accelerates-personalized-medicine-activity-7285003244957773826-TrmI/"
  ]
}' |
apify call scraping_solutions/linkedin-profile-company-posts-scraper-engagers-comments --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "LinkedIn Profile & Company Posts Scraper (Engagers & Comments)",
        "description": "Scrape LinkedIn posts from profiles and companies, and extract engagers, reposts, and comments. Supports post URLs, runs in parallel, and delivers clean structured data for lead generation, analytics, and automation.",
        "version": "0.0",
        "x-build-id": "HTjim7sD6vwzbD3AM"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/scraping_solutions~linkedin-profile-company-posts-scraper-engagers-comments/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-scraping_solutions-linkedin-profile-company-posts-scraper-engagers-comments",
                "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/scraping_solutions~linkedin-profile-company-posts-scraper-engagers-comments/runs": {
            "post": {
                "operationId": "runs-sync-scraping_solutions-linkedin-profile-company-posts-scraper-engagers-comments",
                "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/scraping_solutions~linkedin-profile-company-posts-scraper-engagers-comments/run-sync": {
            "post": {
                "operationId": "run-sync-scraping_solutions-linkedin-profile-company-posts-scraper-engagers-comments",
                "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": [
                    "targetUrls"
                ],
                "properties": {
                    "targetUrls": {
                        "title": "Target URLs / accounts",
                        "type": "array",
                        "description": "LinkedIn profile URLs, company URLs, post URLs, or plain usernames.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "maxPosts": {
                        "title": "Max posts per target",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Maximum number of posts to scrape per profile/company target. Set 0 to extract as many as possible within the internal safety limits.",
                        "default": 10
                    },
                    "includeQuotePosts": {
                        "title": "Include quote posts",
                        "type": "boolean",
                        "description": "If false, quote posts are filtered out from profile/company feeds.",
                        "default": true
                    },
                    "includeReposts": {
                        "title": "Include repost posts",
                        "type": "boolean",
                        "description": "If false, repost-type posts from profile/company feeds are filtered out.",
                        "default": true
                    },
                    "scrapeReactions": {
                        "title": "Scrape reactions / engagers",
                        "type": "boolean",
                        "description": "Extract people who reacted to each scraped post.",
                        "default": false
                    },
                    "maxReactions": {
                        "title": "Max reactions per post",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Maximum reactions to scrape per post. Set 0 to extract as many as possible within the internal safety limits.",
                        "default": 10
                    },
                    "scrapeReposts": {
                        "title": "Scrape reposts / reshares",
                        "type": "boolean",
                        "description": "Extract people who reposted/reshared each scraped post.",
                        "default": false
                    },
                    "maxReposts": {
                        "title": "Max reposts per post",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Maximum reposts to scrape per post. Set 0 to extract as many as possible within the internal safety limits.",
                        "default": 10
                    },
                    "scrapeComments": {
                        "title": "Scrape comments",
                        "type": "boolean",
                        "description": "Extract comments for each scraped post.",
                        "default": false
                    },
                    "maxComments": {
                        "title": "Max comments per post",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Maximum comments to scrape per post. Set 0 to extract as many as possible within the internal safety limits.",
                        "default": 10
                    },
                    "commentSortOrder": {
                        "title": "Comment sort order",
                        "enum": [
                            "Most relevant",
                            "Most recent"
                        ],
                        "type": "string",
                        "description": "Sort order used by the comments endpoint.",
                        "default": "Most relevant"
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
