# LinkedIn Post Scraper (`deepmine/linkedin-post-scraper`) Actor

LinkedIn post scraper with no login: paste any public post URL (a person's or a company's) and get its full text, exact time, author, reactions by kind, comments and reposts counts, images, video, documents, hashtags and the first comments.

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

## Pricing

from $0.59 / 1,000 posts

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 Scraper: Any Post URL

Paste LinkedIn post URLs and get each post's full text, exact time, author, reactions by kind, comments and reposts
counts, images, video, documents, hashtags, mentions and the first comments. Personal posts and company posts both
work. **No login, no cookies, no browser.**

### What you get per post

| Field | Example |
|---|---|
| `authorName`, `authorUrl`, `authorType`, `authorPhoto` | CA Surbhi Gandhi, linkedin.com/in/…, person |
| `authorHeadline` | a member's headline ("CA| I will 10x your profits…"), a page's follower count |
| `text`, `textSnippet`, `hashtags`, `mentions`, `links` | full post text and what it links to |
| `postedAt`, `postedTimestamp`, `postedAgo`, `isEdited` | exact time from the post id (2023-02-25T04:45:15Z) |
| `reactions`, `comments`, `reposts` | 1674, 53, 3 |
| `reactionsByType` | `{"like": 1618, "love": 38, "celebrate": 7, …}` |
| `images`, `videoUrl`, `videoPoster`, `documentTitle`, `documentUrl`, `articleUrl` | the post's media |
| `resharedFrom`, `resharedText`, `resharedPostUrl` | the original post of a quote post |
| `topComments` | the first ~10 comments: author, text, time, likes |
| `postUrl`, `activityId`, `activityUrn`, `shareUrn`, `rank`, `input`, `scrapedAt` | ids and where the row came from |

Views in the Output tab: Overview, Stats, Media, Reposts, Comments, Engagement.

### Input

- **Post URLs**: one per line. `linkedin.com/posts/…-activity-…` and `linkedin.com/posts/activity-…` share links, `linkedin.com/feed/update/urn:li:activity:…`
  URLs and bare `urn:li:activity:…` / `urn:li:ugcPost:…` ids and bare post ids (`7302346926123798528`) all work.
- **Include first comments** (on by default, free): the first ~10 comments the post's public page shows.

```json
{"postUrls": ["https://www.linkedin.com/posts/alitajran_windows11-microsoft-activity-7413933831029682176-nmqQ"]}
```

### Pricing

Pay per post delivered: **$0.79 per 1,000 posts** on Starter ($0.95 Free, $0.69 Scale, $0.59 Business). No start fee.
Comments, repost counts and reactions by kind are included. Each post is charged once per run. URLs that aren't
posts, repeated URLs and posts that are deleted or hidden from logged-out visitors are free.

### Good to know

- The post must be public (visible without signing in). LinkedIn hides a few posts from logged-out visitors: those
  lines end as `hidden` in the run summary and cost nothing.
- Comments past the first ~10 and the list of people who reacted need a LinkedIn account, which this Actor never uses.
- The run summary (key-value store record `OUTPUT`) lists every input line's result.
- Want a company's whole feed instead of single posts? Use **LinkedIn Company Posts** (70 newest posts per company,
  older ones too).

### FAQ

**Do I need a LinkedIn account or cookies?** No. Everything comes from LinkedIn's public post pages.

**Does it work for personal (member) posts?** Yes, any post that opens without signing in, a person's or a company's.

**Can I export to CSV or Excel?** Yes, from the Output tab, or through the Apify API and integrations.

# Actor input Schema

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

One LinkedIn post per line: linkedin.com/posts/... URLs, linkedin.com/feed/update/urn:li:activity:... URLs, post urns or bare post ids (7302346926123798528). Personal and company posts both work. Each post is one row.

## `includeComments` (type: `boolean`):

Adds the first ~10 comments LinkedIn shows on the post's public page (author, text, time, likes). Free: they come from the same page.

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

Apify datacenter proxy reads LinkedIn's public post pages; residential isn't needed or used.

## Actor input object example

```json
{
  "postUrls": [
    "https://www.linkedin.com/posts/alitajran_windows11-microsoft-activity-7413933831029682176-nmqQ",
    "https://www.linkedin.com/posts/surbhigandhi99_surbhigandhi-linkedin-linkedinforcreators-activity-7035107424470478848-dFV3",
    "https://www.linkedin.com/posts/serenahhuangphd_know-your-worth-years-ago-i-was-chasing-activity-7190776942348914688-NuWn"
  ],
  "includeComments": true,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

No description

## `summary` (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/alitajran_windows11-microsoft-activity-7413933831029682176-nmqQ",
        "https://www.linkedin.com/posts/surbhigandhi99_surbhigandhi-linkedin-linkedinforcreators-activity-7035107424470478848-dFV3",
        "https://www.linkedin.com/posts/serenahhuangphd_know-your-worth-years-ago-i-was-chasing-activity-7190776942348914688-NuWn"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("deepmine/linkedin-post-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/alitajran_windows11-microsoft-activity-7413933831029682176-nmqQ",
        "https://www.linkedin.com/posts/surbhigandhi99_surbhigandhi-linkedin-linkedinforcreators-activity-7035107424470478848-dFV3",
        "https://www.linkedin.com/posts/serenahhuangphd_know-your-worth-years-ago-i-was-chasing-activity-7190776942348914688-NuWn",
    ],
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("deepmine/linkedin-post-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/alitajran_windows11-microsoft-activity-7413933831029682176-nmqQ",
    "https://www.linkedin.com/posts/surbhigandhi99_surbhigandhi-linkedin-linkedinforcreators-activity-7035107424470478848-dFV3",
    "https://www.linkedin.com/posts/serenahhuangphd_know-your-worth-years-ago-i-was-chasing-activity-7190776942348914688-NuWn"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call deepmine/linkedin-post-scraper --silent --output-dataset

```

## MCP server setup

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