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

Fetch full public LinkedIn post details — text, author, reactions, comments, and media — for one or more post, activity, or article URLs.

- **URL**: https://apify.com/thenetaji/linkedin-post-scraper.md
- **Developed by:** [The Netaji](https://apify.com/thenetaji) (community)
- **Categories:** Social media, Lead generation, Automation
- **Stats:** 39 total users, 11 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.40 / 1,000 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 Scraper

The Actor resolves one or more public LinkedIn posts to structured records containing the post text, author, reaction counts and breakdown, comments, and any attached media. Post, activity, and article URLs are all accepted. No LinkedIn account or session cookie is required.

### Accepted input

| Field | Type | Default | Description |
|---|---|---|---|
| `post_url` | array of strings | — | Required. LinkedIn post, activity, or article URLs. |
| `maxItems` | integer | `100` | Maximum posts fetched. `0` removes the limit. |

```json
{
  "post_url": [
    "https://www.linkedin.com/posts/williamhgates_activity-7445556013572734976-Ab1c",
    "https://www.linkedin.com/feed/update/urn:li:activity:7445556013572734976/"
  ],
  "maxItems": 100
}
```

URLs are trimmed and deduplicated before any request is issued, so the same post supplied twice is fetched and billed once.

### Response fields

One record per post.

| Field | Contents |
|---|---|
| `post_url` | The URL used to fetch the record |
| `type` | Record type reported by the page, distinguishing posts from articles and video |
| `name` | Title, where the content carries one |
| `text` | Post body text |
| `headline` | Headline text, on article-style content |
| `description` | Description text, on article-style content |
| `author` | Author name, headline, and profile URL |
| `published_at` | Publication timestamp |
| `upload_date` | Upload timestamp, on media content |
| `duration` | Duration, on video content |
| `reactions` | Total reaction count |
| `reaction_types` | Reaction count broken down by type |
| `comment_count` | Number of comments |
| `comments` | Comment records, where the page exposes them |
| `shared_content` | The original post, when this one is a reshare |
| `content_url` | Canonical content URL |
| `url` | Post URL |
| `embed_url` | Embeddable URL, on media content |
| `video_urls` | Video URLs attached to the post |
| `image_urls` | Image URLs attached to the post |
| `thumbnail` | Thumbnail image URL |
| `keywords` | Keywords published in the page's structured data |
| `jsonld` | The page's raw JSON-LD block |

```json
{
  "post_url": "https://www.linkedin.com/posts/williamhgates_activity-7445556013572734976-Ab1c",
  "type": "SocialMediaPosting",
  "text": "Three things I learned this year...",
  "reactions": 18422,
  "comment_count": 611,
  "published_at": "2026-06-14T09:30:00.000Z"
}
```

### Behaviour on partial results

Posts are fetched one request per URL. A URL that cannot be retrieved — because the post was deleted, the author restricted its visibility, or the request failed after the client's own retries — is logged as a warning and skipped. The run continues to the next URL and completes normally.

The number of records returned can therefore be lower than the number of URLs supplied, and the run log names every URL that was skipped.

`comments` reflects what the public page renders, which is a subset of the total for posts with large comment threads. `comment_count` reports the full number LinkedIn states, so the two are expected to disagree on popular posts: the count is authoritative, the array is a sample.

### Frequently asked questions

**Which post URL formats are accepted?**
The `/posts/<slug>` form shown on a member's profile, the `/feed/update/urn:li:activity:<id>` form the feed produces, and article URLs. Whichever form the browser address bar shows will work.

**Why does `comments` hold fewer entries than `comment_count`?**
`comment_count` is the total LinkedIn reports for the post. `comments` contains those the public page renders without a logged-in session, which for a heavily commented post is a fraction of the total. Treat the count as the metric and the array as a sample rather than an export.

**What does `reaction_types` contain that `reactions` does not?**
`reactions` is the single total. `reaction_types` splits it across LinkedIn's reaction set — like, celebrate, support, insightful, and so on — which distinguishes broad approval from a narrower, stronger response on posts with similar totals.

**What is `shared_content`?**
When the fetched post is a reshare, the original post is nested under `shared_content` while the outer fields describe the reshare itself, including any comment the resharer added. The field is absent on original posts.

**Is a LinkedIn account or session cookie required?**
No. Only publicly visible posts are read, and no credentials or logged-in session are supplied.

**Are the members who reacted to a post returned?**
No. Reaction totals and their breakdown by type are returned, but not the identities behind them.

### Related Actors

| Actor | Purpose |
|---|---|
| [LinkedIn Profile Scraper](https://apify.com/thenetaji/linkedin-profile-scraper) | Author profile details by username or URL |
| [LinkedIn Company Scraper](https://apify.com/thenetaji/linkedin-company-scraper) | Company page details, including recent updates |
| [LinkedIn Related User Scraper](https://apify.com/thenetaji/linkedin-related-user-scraper) | Profiles LinkedIn shows alongside a seed profile |
| [LinkedIn Jobs Scraper](https://apify.com/thenetaji/linkedin-jobs-scraper) | Job search by keyword and location |

# Actor input Schema

## `post_url` (type: `array`):

LinkedIn post, activity, or /pulse/ article URLs to fetch post details for.

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

Maximum number of posts to fetch. Set to 0 for no item limit.

## Actor input object example

```json
{
  "post_url": [
    "https://www.linkedin.com/posts/sundarpichai_thank-you-to-stanford-president-jon-levin-activity-7445556013572734976-dB0L"
  ],
  "maxItems": 20
}
```

# Actor output Schema

## `dataset` (type: `string`):

All records scraped by this run

# 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 = {
    "post_url": [
        "https://www.linkedin.com/posts/sundarpichai_thank-you-to-stanford-president-jon-levin-activity-7445556013572734976-dB0L"
    ],
    "maxItems": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("thenetaji/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 = {
    "post_url": ["https://www.linkedin.com/posts/sundarpichai_thank-you-to-stanford-president-jon-levin-activity-7445556013572734976-dB0L"],
    "maxItems": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("thenetaji/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 '{
  "post_url": [
    "https://www.linkedin.com/posts/sundarpichai_thank-you-to-stanford-president-jon-levin-activity-7445556013572734976-dB0L"
  ],
  "maxItems": 20
}' |
apify call thenetaji/linkedin-post-scraper --silent --output-dataset

```

## MCP server setup

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