# LinkedIn Posts - Companies and Professionals (`schesds/linkedin-posts`) Actor

Extract LinkedIn posts from company pages and professional profiles with post text, dates, links, hashtags, and engagement metrics.

- **URL**: https://apify.com/schesds/linkedin-posts.md
- **Developed by:** [Tedd Shesden](https://apify.com/schesds) (community)
- **Categories:** Social media
- **Stats:** 14 total users, 4 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-usage

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — 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 Posts Scraper for Companies and Professionals

Extract LinkedIn posts from company pages and professional profiles, including post text, authors, dates, hashtags, links, and engagement metrics.

### What You Can Use It For

- Monitor recent posts from company pages or professional profiles.
- Collect post text, dates, authors, hashtags, and engagement metrics.
- Analyze competitor messaging, hiring themes, product announcements, and executive content.
- Export structured results as JSON, CSV, Excel, XML, or through the Apify API.

### Input

Paste one LinkedIn company page or professional profile URL per line:

```json
{
  "urls": [
    "https://www.linkedin.com/company/microsoft/",
    "https://www.linkedin.com/company/nvidia/"
  ],
  "startDate": "2026-01-01"
}
```

Use `startDate` and `endDate` to narrow the post date range. The Actor applies the requested range both to the source request and locally after normalizing each returned post, so exported posts do not fall outside the selected window. Direct post URLs are also supported when you need to collect a specific post.

The Actor processes each submitted URL independently. That means every target receives an explicit no-results or error diagnostic, rather than allowing a successful response for one URL to mask another URL in the same batch. For professional profiles, reposts are retained because resharing is an intentional act of endorsing or amplifying third-party content. Where the source omits a date but returns a LinkedIn activity URN, the Actor derives the activity timestamp from that top-level URN.

### Output

The Actor emits one `linkedin_post` row per extracted post. If an input cannot be extracted, it emits a `scrape_error` row with `failureStage` and `errorMessage` so the reason is visible in the dataset.

If the same post is returned through overlapping inputs (for example, a direct post URL and the author's feed), the Actor keeps one post row and reports the number removed in `OUTPUT.summary.duplicatePostsRemoved`. Diagnostic rows include `oldestSeen`, `stopReason`, and, where supplied by the managed source, `sourcePostsReturned` and `sourcePostsDated`. `pagesFetched` stays null when the managed source does not expose raw pagination metadata.

### Historical-window diagnostics

The managed LinkedIn posts dataset controls feed traversal and does not expose a cursor or raw page stream to this Actor. If it returns only a recent sample and cannot satisfy an older selected date range, the Actor emits a `scrape_error` with `stopReason: provider_window_miss` rather than claiming that the profile has no posts. In that case, `sourcePostsReturned` and `sourcePostsDated` expose the source's own diagnostic counts. This is intentionally explicit: a historical range is only complete when the source itself reaches it.

The main table shows diagnostic fields first, followed by fields useful for content analysis:

- `recordType`
- `inputUrl`
- `targetUrl`
- `failureStage`
- `errorMessage`
- `postUrl`
- `postId`
- `datePosted`
- `authorName`
- `authorUrl`
- `companyName`
- `companyUrl`
- `postText`
- `postType`
- `numLikes`
- `numComments`
- `numShares`
- `engagementCount`
- `hashtags`
- `externalLinks`
- `postQuality`
- `missingFields`

Some fields are best-effort because LinkedIn posts do not expose the same data for every post or author. Rows include `postQuality` and `missingFields` so partial records are visible.

### Example Output

```json
{
  "recordType": "linkedin_post",
  "targetType": "company",
  "postUrl": "https://www.linkedin.com/posts/microsoft_activity-1234567890",
  "postId": "1234567890",
  "datePosted": "2026-01-15T14:30:00.000Z",
  "authorName": "Microsoft",
  "companyName": "Microsoft",
  "companyUrl": "https://www.linkedin.com/company/microsoft/",
  "postText": "Announcing new AI capabilities for developers...",
  "numLikes": 45230,
  "numComments": 1250,
  "hashtags": ["#AI", "#Developers"],
  "postQuality": "COMPLETE",
  "missingFields": []
}
```

### Notes

This Actor extracts publicly available LinkedIn post data from company pages and professional profiles. It does not access private messages, private profiles, or data behind a login wall.

# Actor input Schema

## `urls` (type: `array`):

Add one LinkedIn company page or professional profile URL per line. Use Bulk edit to paste large lists. Direct post URLs are also supported for specific post lookups.

## `startDate` (type: `string`):

Optional earliest post date for company pages or professional profiles, in YYYY-MM-DD format.

## `endDate` (type: `string`):

Optional latest post date for company pages or professional profiles, in YYYY-MM-DD format.

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

Advanced: number of LinkedIn URLs to process concurrently. Lower values reduce upstream load; 3 is the default.

## Actor input object example

```json
{
  "urls": [
    "https://www.linkedin.com/company/microsoft/",
    "https://www.linkedin.com/company/nvidia/"
  ],
  "startDate": "2026-01-01",
  "maxConcurrency": 3
}
```

# 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 = {
    "urls": [
        "https://www.linkedin.com/company/microsoft/",
        "https://www.linkedin.com/company/nvidia/"
    ],
    "startDate": "2026-01-01"
};

// Run the Actor and wait for it to finish
const run = await client.actor("schesds/linkedin-posts").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 = {
    "urls": [
        "https://www.linkedin.com/company/microsoft/",
        "https://www.linkedin.com/company/nvidia/",
    ],
    "startDate": "2026-01-01",
}

# Run the Actor and wait for it to finish
run = client.actor("schesds/linkedin-posts").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 '{
  "urls": [
    "https://www.linkedin.com/company/microsoft/",
    "https://www.linkedin.com/company/nvidia/"
  ],
  "startDate": "2026-01-01"
}' |
apify call schesds/linkedin-posts --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,schesds/linkedin-posts"
        }
    }
}

```

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/L0W4uu0lmpX2hqetN/builds/ayRj3rmewZ1pFv8zy/openapi.json
