# LinkedIn Posts Scraper — Profile & Company Posts (`endspec/linkedin-instant-posts-scraper`) Actor

Scrape recent LinkedIn posts from any person profile or company page — no cookies, no login. Get post text, likes, comments, shares, author, and links as clean structured rows, ready for your CRM, spreadsheet, or analytics. Point it at a profile handle or a company and pay only per post returned.

- **URL**: https://apify.com/endspec/linkedin-instant-posts-scraper.md
- **Developed by:** [EndSpec](https://apify.com/endspec) (community)
- **Categories:** Social media, Lead generation, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

from $4.50 / 1,000 post returneds

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 Scraper — Profile & Company Posts

Scrape recent LinkedIn posts from **any person profile or company page** — no cookies, no login, no setup. Point it at a profile handle or a company, choose how many posts you want, and get back clean, structured rows ready for your spreadsheet, CRM, or analytics pipeline.

### What you get

One row per post, with:

- `text` — the post body
- `num_likes`, `num_comments`, `num_shares` — engagement counts
- `author_name`, `author_url`, `author_type`, `author_followers`
- `created_at` — publish timestamp
- `post_url`, `post_id`, `post_type`
- `article_url`, `has_video`, `has_images` — attached media signals

### Input

```json
{
  "target": "williamhgates",
  "target_type": "auto",
  "count": 20,
  "sort_by": "recent"
}
```

- **target** — a profile (`williamhgates` or `https://www.linkedin.com/in/williamhgates`) **or** a company (`microsoft`, `https://www.linkedin.com/company/microsoft/`, or a numeric id). A company vanity name is resolved automatically.
- **target\_type** — `auto` (default), `profile`, or `company`.
- **count** — max posts to return.
- **sort\_by** — `recent` or `top` (company posts only).

> **Note on count:** company feeds paginate deeply, so large counts are honored. Person feeds return only the most recent page (~20 posts) — `count` is an upper bound, not a guarantee.

### Pricing

- **Pay only per post returned.** No charge for failed runs or runs with zero results.
- $0.0050 per post (launch)
- Pay-as-you-go — no monthly subscription, no minimum

### Use cases

- Social selling & engagement monitoring
- Competitor and brand content tracking
- Lead-generation signals (who's posting, what resonates)
- Content research & analytics

### Why this actor

- **Zero setup** — no cookies, no login; just run it
- **Profiles and companies** in one actor
- **Clean, flat schema** — import-ready
- **Pay-per-event** — only charged when posts actually return

### Support

If results are missing or the actor returns an error, our servers may be briefly busy or undergoing maintenance. Re-run a few minutes later — you will not be charged for failed items.

# Actor input Schema

## `target` (type: `string`):

A LinkedIn profile (username or /in/ URL) or a company (company URL, vanity name, or numeric id). Examples: 'williamhgates', 'https://www.linkedin.com/in/williamhgates', 'microsoft', 'https://www.linkedin.com/company/microsoft/'

## `target_type` (type: `string`):

Force how the target is interpreted. 'auto' detects profile vs company from the input.

## `count` (type: `integer`):

Max posts to return. Note: person feeds return only the most recent page (~20); company feeds paginate further.

## `sort_by` (type: `string`):

Ordering for company posts. Ignored for person profiles.

## Actor input object example

```json
{
  "target": "williamhgates",
  "target_type": "auto",
  "count": 20,
  "sort_by": "recent"
}
```

# Actor output Schema

## `dataset` (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 = {
    "target": "williamhgates"
};

// Run the Actor and wait for it to finish
const run = await client.actor("endspec/linkedin-instant-posts-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 = { "target": "williamhgates" }

# Run the Actor and wait for it to finish
run = client.actor("endspec/linkedin-instant-posts-scraper").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 '{
  "target": "williamhgates"
}' |
apify call endspec/linkedin-instant-posts-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/Rpgf6AYlMfZSErbrc/builds/dEtZWKSs0MibPCG74/openapi.json
