# LinkedIn Posts API | Scrape Profile Posts & Engagement (`johnvc/linkedin-posts-api`) Actor

Collect public LinkedIn posts as clean, structured JSON. Discover every post from a profile URL, or fetch specific post URLs, with text, reactions, comments, shares, media, hashtags, and author details. Pay per post, MCP-ready for Claude and AI agents.

- **URL**: https://apify.com/johnvc/linkedin-posts-api.md
- **Developed by:** [John](https://apify.com/johnvc) (community)
- **Categories:** Social media, Lead generation, AI
- **Stats:** 13 total users, 8 monthly users, 100.0% runs succeeded, 6 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $0.01 / 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/platform/actors/running/actors-in-store#pay-per-event

## 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 API | Scrape Profile Posts & Engagement

The **LinkedIn Posts API** turns public [LinkedIn](https://www.linkedin.com) posts into clean, structured JSON. Use this actor with Claude, Cursor, or any MCP-compatible AI agent to collect post text, reactions, comments, shares, media, hashtags, and author details, billed per post.

Give it a profile URL and it discovers that person's recent posts, or give it specific post URLs to fetch directly. It works as a straightforward **LinkedIn posts scraper** for content research, post engagement analysis, and social listening, and it is built API-first and MCP-ready so AI agents can call it as a tool.

***

### 📋 What this API returns

| Field | Description |
|---|---|
| `postUrl`, `postId` | The post's public URL and identifier. |
| `postType` | The kind of post (post, article, repost). |
| `datePosted` | When the post was published. |
| `title`, `text` | The post title (for articles) and body text. |
| `hashtags` | Hashtags used in the post. |
| `authorName`, `authorHeadline`, `authorUrl` | Who posted it and their headline / profile URL. |
| `authorFollowers`, `authorType` | Author audience size and person/company type. |
| `numLikes`, `numComments`, `numShares` | Engagement counts. |
| `images`, `videos`, `embeddedLinks` | Media and links attached to the post. |
| `taggedCompanies`, `taggedPeople` | Entities tagged in the post. |
| `topComments` | A sample of the most visible comments. |
| `summary` | A plain-language one-line interpretation of the post. |

***

### 🎯 Use cases

- **Content research.** Pull a creator's or brand's recent posts to study what performs.
- **Competitive monitoring.** Track a competitor's LinkedIn posts and engagement over time.
- **Social listening.** Collect posts and their reactions and comments for sentiment and trend analysis.
- **Lead generation.** Find the most-engaged posts from target accounts to spot warm prospects.
- **Personal brand analytics.** Measure reactions, comments, and shares across your own posts.
- **AI agent workflows.** Drive this API over MCP from Claude to fetch and summarize posts in-conversation.

***

### 🔁 Use it as a LinkedIn posts scraper at scale

Point this LinkedIn posts scraper at a profile and it returns that person's recent posts, one clean row each, with the same flat fields every time, which is what makes the output easy to load into a sheet, a database, or a BI tool. Cap each profile with `maxPostsPerProfile` so a large run never overshoots your budget, and narrow discovery with `startDate` and `endDate` to a specific window.

Every row carries the **post engagement** you care about: reactions, comments, and shares, alongside the post text, hashtags, and author details. That makes it a ready source for content research, tracking a creator or brand, and finding the highest-engagement **influencer posts**. If a profile has no public posts, you get a clear error row instead of a failed run, so one empty profile never sinks the batch.

***

### ⚙️ Input examples

#### Discover a profile's posts

```json
{
  "profileUrls": ["https://www.linkedin.com/in/williamhgates"],
  "maxPostsPerProfile": 20
}
```

#### Limit discovery to a date range

```json
{
  "profileUrls": ["https://www.linkedin.com/in/williamhgates"],
  "maxPostsPerProfile": 50,
  "startDate": "2025-01-01",
  "endDate": "2025-12-31"
}
```

#### Fetch specific posts by URL

```json
{
  "postUrls": [
    "https://www.linkedin.com/posts/williamhgates_activity-7446904645010210816"
  ]
}
```

`maxPostsPerProfile` caps how many posts are returned per profile, so you control cost. The API returns one row per post.

***

### 📤 Example output

Each post is returned as one JSON row:

```json
{
  "result_type": "post",
  "postId": "7446904645010210816",
  "postUrl": "https://www.linkedin.com/posts/williamhgates_activity-7446904645010210816",
  "postType": "post",
  "datePosted": "2025-06-01T12:00:00.000Z",
  "text": "A few books shaped how I think about clean energy this year...",
  "hashtags": ["cleanenergy", "books"],
  "authorName": "williamhgates",
  "authorHeadline": "Co-chair, Bill & Melinda Gates Foundation",
  "authorUrl": "https://www.linkedin.com/in/williamhgates",
  "numLikes": 12045,
  "numComments": 843,
  "numShares": 210,
  "summary": "Post by williamhgates, 12,045 reactions, 843 comments, posted 2025-06-01"
}
```

***

### 💰 Pricing (pay-per-event)

You pay per post returned. There is no per-run setup fee. The current per-event price is shown on the Store card and in the Actor's Monetization details. Because billing is per post, you only pay for the posts actually delivered, and `maxPostsPerProfile` lets you cap the volume of each run.

***

### 🔌 Use the LinkedIn Posts API from Claude (MCP)

This Actor is MCP-server-compatible, so [Claude Code](https://claude.ai/referral/uIlpa7nPLg) (free trial), Claude (desktop and web), Cursor, and other MCP clients can call it as a tool through Apify's hosted MCP server.

Add it with this Actor-specific URL:

`https://mcp.apify.com/?tools=actors,docs,johnvc/linkedin-posts-api`

Apify MCP integration docs: https://docs.apify.com/platform/integrations/mcp

Setup walkthrough:

https://www.youtube.com/watch?v=jREWahDGhJM

**New to Claude Code or Claude Cowork?** Start a [free trial](https://claude.ai/referral/uIlpa7nPLg).

Then ask Claude:

> *"Use the LinkedIn Posts API to pull Bill Gates's last 10 posts and summarize which got the most engagement."*

***

### 💸 Pay per run with crypto (x402)

The LinkedIn Posts API supports agentic payments via the [x402 protocol](https://docs.apify.com/platform/integrations/x402).
AI agents and MCP clients can pay for runs in USDC (on Base) with no Apify account or API token needed:
point your agent at the [Apify MCP server](https://mcp.apify.com/?tools=actors,docs,johnvc/linkedin-posts-api) and it can
discover, pay for, and run this Actor autonomously. Read the
[Apify x402 announcement](https://apify.com/change-log/pay-for-apify-actors-with-x402?fpr=9n7kx3) for details.

### 🔌 Integrations: track post engagement on a schedule

This API earns its keep as a recurring step in a pipeline, not a one-off run:

- **Tasks and Schedules.** Save a set of profile URLs as a Task, then attach a Schedule to pull new posts and their engagement daily, weekly, or monthly with no code.
- **n8n, Make, and Zapier.** Trigger a run on a schedule, then route new posts into a content dashboard, a Slack channel, or your CRM. Apify has native connectors for each.
- **Supabase, Google Sheets, and databases.** Send the dataset straight to storage with a webhook or the Apify API so the rows land where your team already works.
- **MCP.** Call the API as a tool from Claude and other AI agents (see the section above) to fetch and summarize posts inside an agent workflow.
- **Webhooks.** Fire a webhook on run completion to kick off the next step in your own system, such as scoring the most-engaged posts.

***

### 🔗 Related Tools

Build a full picture of a person, their posts, and where they work by pairing this with the rest of the LinkedIn suite:

- [LinkedIn Profile API](https://apify.com/johnvc/linkedin-profile-api?fpr=9n7kx3) - structured profile data on the people whose posts you collect.
- [LinkedIn Company API](https://apify.com/johnvc/linkedin-company-api?fpr=9n7kx3) - firmographics for the companies behind the authors.
- [LinkedIn Jobs API](https://apify.com/johnvc/linkedin-jobs-api?fpr=9n7kx3) - open roles by keyword and location, a companion hiring signal.

Comparison point: many LinkedIn posts tools on the Store cover only one slice of engagement (for example [harvestapi/linkedin-post-reactions](https://apify.com/harvestapi/linkedin-post-reactions?fpr=9n7kx3), reactions only). This API returns the full post, text, reactions, comments, and shares, in one row, with pay-per-post billing and MCP access from AI agents.

***

### 📎 Applications

Ready-made task pages for common jobs. Open one, run it, or duplicate it as a starting point:

#### [Scrape LinkedIn Posts to Structured JSON](https://apify.com/johnvc/linkedin-posts-api/examples/scrape-linkedin-posts-to-structured-json?fpr=9n7kx3)

Turn a profile URL into clean JSON: post text, reactions, comments, date, and author, newest first.

#### [Track a Profile's LinkedIn Posts](https://apify.com/johnvc/linkedin-posts-api/examples/track-a-profile-s-linkedin-posts?fpr=9n7kx3)

Pull a profile's recent posts on a schedule, filtered to a date range.

#### [Analyze LinkedIn Post Engagement](https://apify.com/johnvc/linkedin-posts-api/examples/analyze-linkedin-post-engagement?fpr=9n7kx3)

Get reactions, comments, shares, author, and follower count per post, ready for a dashboard.

#### [Collect Influencer Posts from LinkedIn](https://apify.com/johnvc/linkedin-posts-api/examples/collect-influencer-posts-from-linkedin?fpr=9n7kx3)

Pull a creator's recent posts with reach and engagement for influencer research.

#### [LinkedIn Posts Data API for Python](https://apify.com/johnvc/linkedin-posts-api/examples/linkedin-posts-data-api-for-python?fpr=9n7kx3)

Call the API from Python: a profile URL in, structured posts out.

#### [Scrape LinkedIn Posts in an n8n Workflow](https://apify.com/johnvc/linkedin-posts-api/examples/scrape-linkedin-posts-in-an-n8n-workflow?fpr=9n7kx3)

Add post data to an n8n workflow: pass profile URLs, get structured rows back.

#### [Get LinkedIn Posts in Claude via MCP](https://apify.com/johnvc/linkedin-posts-api/examples/get-linkedin-posts-in-claude-via-mcp?fpr=9n7kx3)

Use posts as a tool in Claude and other AI agents over MCP.

#### [Fetch Specific LinkedIn Posts by URL](https://apify.com/johnvc/linkedin-posts-api/examples/fetch-specific-linkedin-posts-by-url?fpr=9n7kx3)

Paste up to 1000 post URLs and get one clean row each.

***

### 🚀 How to get started

1. Open the Actor and paste one or more LinkedIn profile URLs into `profileUrls` (or post URLs into `postUrls`).
2. Set `maxPostsPerProfile` to bound the volume, then run it and read the results from the dataset (JSON, CSV, Excel, or API).

[View on Apify Store](https://apify.com/johnvc/linkedin-posts-api?fpr=9n7kx3)

**Example code:** [Python quick-start + MCP setup on GitHub](https://github.com/johnisanerd/Apify-LinkedIn-Posts-API) - call the API from Python, or install it as a tool in Claude, Cursor, and ChatGPT.

***

### ❓ FAQ

#### Is this a LinkedIn Posts API or a LinkedIn posts scraper?

Both descriptions fit. You call it like an API (a profile or post URL in, structured JSON out), and under the hood it is a LinkedIn posts scraper that reads public posts. You never touch scraping infrastructure; you get clean, one-row-per-post data back.

#### What input should I provide?

A public LinkedIn profile URL (e.g. `https://www.linkedin.com/in/williamhgates`) to discover its posts, and/or specific post URLs to fetch directly. Supply at least one.

#### How many posts do I get per profile?

As many as `maxPostsPerProfile` (default 20, up to 200). Newest posts are returned first, and you can narrow the range with `startDate` and `endDate`.

#### Do you return comment and reaction counts?

Yes. Each post row includes reaction, comment, and share counts, plus a sample of the most visible comments, so the output doubles as post engagement data.

#### Is it legal to scrape public LinkedIn posts?

This actor collects only public post data. Public-data scraping has been addressed in court cases such as [hiQ Labs v. LinkedIn](https://en.wikipedia.org/wiki/HiQ_Labs_v._LinkedIn), but you are responsible for your own use, including [GDPR](https://en.wikipedia.org/wiki/General_Data_Protection_Regulation) and platform terms. Consult your own counsel for your use case.

#### Can I run it from Claude or another AI agent over MCP?

Yes. The Actor is MCP-server-compatible, so [Claude Code](https://claude.ai/referral/uIlpa7nPLg) (free trial) and other MCP clients call it as a tool. See the MCP section above for the setup URL.

#### Can I schedule it or connect it to my other apps?

Yes. Save your profile URLs as a Task and attach a Schedule for recurring runs, and connect the output to n8n, Make, Zapier, Supabase, or your own system by webhook. See the Integrations section above.

#### What if a profile has no public posts?

The API returns a clear error row for that profile explaining why, so one empty profile does not fail the whole run.

***

### 🌐 About Alpha OSINT

This Actor is part of [Alpha OSINT](https://www.alphaosint.com), toolset of financial and operations data sources and APIs.
See the [LinkedIn Posts API source page](https://www.alphaosint.com/sources/linkedin-posts-api/) for related tools and use cases.
For support or requests for this actor, please start a ticket [directly on our support page](https://apify.com/johnvc/linkedin-posts-api/issues/open?fpr=9n7kx3).

Last Updated: 2026.08.03

# Actor input Schema

## `profileUrls` (type: `array`):

One or more LinkedIn profile URLs, e.g. https://www.linkedin.com/in/williamhgates. The API discovers and returns that profile's recent posts (newest first), up to Max posts per profile. Non-/in/ profile URLs are skipped. Up to 25 per run. Need larger batches? Contact us and we can raise this limit for your account.

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

One or more specific LinkedIn post URLs, e.g. https://www.linkedin.com/posts/...-activity-1234567890 or https://www.linkedin.com/feed/update/urn:li:activity:1234567890. Each returns one row. Up to 1000 per run. Need larger batches? Contact us and we can raise this limit for your account.

## `maxPostsPerProfile` (type: `integer`):

Maximum number of posts to return for each profile URL (discover mode). Caps upstream cost. Ignored for specific post URLs.

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

Only discover posts on or after this date (YYYY-MM-DD). Applies to profile discovery only.

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

Only discover posts on or before this date (YYYY-MM-DD). Applies to profile discovery only.

## Actor input object example

```json
{
  "profileUrls": [
    "https://www.linkedin.com/in/williamhgates"
  ],
  "maxPostsPerProfile": 20,
  "startDate": "2025-01-01",
  "endDate": "2025-12-31"
}
```

# Actor output Schema

## `allResults` (type: `string`):

Every dataset item from this run: collected posts and any error rows.

## `overview` (type: `string`):

Tabular overview of every dataset item using the dataset schema's default view. Columns: type, author, text, reactions, comments, posted, URL, summary.

## `engagement` (type: `string`):

Author reach and reactions/comments/shares per post.

# 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 = {
    "profileUrls": [
        "https://www.linkedin.com/in/williamhgates"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("johnvc/linkedin-posts-api").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 = { "profileUrls": ["https://www.linkedin.com/in/williamhgates"] }

# Run the Actor and wait for it to finish
run = client.actor("johnvc/linkedin-posts-api").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 '{
  "profileUrls": [
    "https://www.linkedin.com/in/williamhgates"
  ]
}' |
apify call johnvc/linkedin-posts-api --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/acts/P9ArUDJDSgHTmYzDp/builds/2LgcHUT2ER3ubbC53/openapi.json
