# LinkedIn Top Content Scraper (`crawlerbros/linkedin-top-content-scraper`) Actor

Scrape LinkedIn's trending and top-performing posts. Extracts viral content, Top Voice posts, and trending articles with engagement metrics, author details, and media type.

- **URL**: https://apify.com/crawlerbros/linkedin-top-content-scraper.md
- **Developed by:** [Crawler Bros](https://apify.com/crawlerbros) (community)
- **Categories:** Automation, Social media, Lead generation
- **Stats:** 17 total users, 4 monthly users, 90.5% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
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?

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 Top Content Scraper

Scrape LinkedIn's trending and top-performing posts — including viral content, LinkedIn Top Voice posts, and trending articles — with full engagement metrics, author details, and media information.

### What It Does

This actor fetches posts from LinkedIn's top content feeds using a multi-strategy cascade:

1. **Top Content Feed** (`/voyager/api/feed/topContent`) — LinkedIn's dedicated trending posts endpoint
2. **Content Search** (`/voyager/api/search/blended`) — search for top posts by category keyword
3. **Flagship Feed** (`/voyager/api/feed/flagshipFeed`) — feed filtered to `TOP_CONTENT` context
4. **Public Trending Page** (`/feed/trending/`) — cookieless fallback using public embedded data

The strategies are tried in order; results are deduplicated and capped at your `maxPosts` limit.

### Input

| Field | Type | Required | Description |
|---|---|---|---|
| `maxPosts` | integer | No | Maximum posts to scrape (default: 50, range: 1–500) |
| `category` | string | No | Topic keyword like `AI`, `leadership`, `marketing` |
| `cookie` | string | No | LinkedIn `li_at` cookie or full cookies JSON array |
| `proxyConfiguration` | object | No | Apify proxy settings |

#### Cookie

For best results, provide a LinkedIn session cookie. Without it, only the public trending page is scraped (fewer results).

**Accepted formats:**

- Plain `li_at` value: `AQEDxxx...`
- Full cookies JSON array from browser export: `[{"name":"li_at","value":"AQEDxxx..."},...]`

#### Category

Use `category` to focus on a specific topic. Examples:

- `AI` — artificial intelligence posts
- `leadership` — leadership content
- `marketing` — marketing insights
- `data science` — data science posts
- Leave empty for general trending content

### Output

Each item in the dataset represents one LinkedIn post:

| Field | Type | Description |
|---|---|---|
| `postId` | string | LinkedIn activity ID |
| `postUrl` | string | Direct URL to the post |
| `authorName` | string | Author's full name |
| `authorProfileUrl` | string | Author's LinkedIn profile URL |
| `authorHeadline` | string | Author's headline / job title |
| `postedAt` | string | ISO 8601 UTC timestamp of publication |
| `content` | string | Full text of the post |
| `mediaType` | string | `text`, `image`, `video`, `article`, `document`, `carousel`, `repost`, `poll`, or `event` |
| `mediaUrls` | array | CDN image URLs (when `mediaType=image`) |
| `articleTitle` | string | Article title (when `mediaType=article`) |
| `articleUrl` | string | Article URL (when `mediaType=article`) |
| `reactionsCount` | integer | Total reaction count |
| `commentsCount` | integer | Total comment count |
| `repostsCount` | integer | Total repost/share count |
| `reactionBreakdown` | object | Per-type counts: `like`, `celebrate`, `love`, `insightful`, `support`, `funny`, `curious` |
| `scrapedAt` | string | ISO 8601 UTC timestamp when scraped |

### Example Output

```json
{
  "postId": "7234567890123456789",
  "postUrl": "https://www.linkedin.com/feed/update/urn:li:activity:7234567890123456789/",
  "authorName": "Satya Nadella",
  "authorProfileUrl": "https://www.linkedin.com/in/satyanadella",
  "authorHeadline": "Chairman and CEO at Microsoft",
  "postedAt": "2025-05-15T14:30:00+00:00",
  "content": "Excited to share our latest breakthroughs in AI...",
  "mediaType": "text",
  "reactionsCount": 42500,
  "commentsCount": 1230,
  "repostsCount": 3400,
  "reactionBreakdown": {
    "like": 30000,
    "celebrate": 8000,
    "insightful": 3500,
    "love": 1000
  },
  "scrapedAt": "2025-05-20T10:00:00+00:00"
}
```

### Use Cases

- **Trend analysis**: Identify what topics and formats are performing best on LinkedIn
- **Competitor research**: See what content your industry peers are posting
- **Content strategy**: Find inspiration from viral posts in your niche
- **Influencer discovery**: Identify LinkedIn Top Voices in specific categories
- **Market research**: Track sentiment and trending topics over time

### FAQs

**Do I need a LinkedIn account?**
No, the actor can run without a cookie and will scrape the public trending feed. However, providing a cookie gives access to more posts and enables category-based filtering.

**How many posts can I scrape?**
Up to 500 posts per run. The actual number depends on what LinkedIn surfaces in its trending feeds.

**Why are some posts missing fields like `postedAt` or `authorHeadline`?**
LinkedIn omits some data for certain posts. Fields are only included when data is available — no null or empty values are pushed.

**Will this get my LinkedIn account banned?**
The actor uses the same Voyager API endpoints that LinkedIn's own mobile app uses, with realistic delays between requests. Proxy configuration is recommended for high-volume usage.

**What is the `reactionBreakdown` field?**
It shows how many reactions of each type the post received: `like` (thumbs up), `celebrate` (clapping), `love` (heart), `insightful` (lightbulb), `support` (hug), `funny` (laughing), and `curious` (curious face).

### Explore the rest of the LinkedIn suite

Need a different LinkedIn surface? Pair this actor with any of the others in the LinkedIn Suite — all published under the same publisher and built to share the same cookie format and output conventions.

| Actor | What it scrapes |
|---|---|
| [LinkedIn Comments Scraper](https://apify.com/crawlerbros/linkedin-comments-scraper) | All comments + reply threads on a post |
| [LinkedIn Company Employees Scraper](https://apify.com/crawlerbros/linkedin-company-employees-scraper) | Employee list for any company (by URN) |
| [LinkedIn Company Info Scraper](https://apify.com/crawlerbros/linkedin-company-info-scraper) | Company About page (size, HQ, industry, specialties) |
| [LinkedIn Company Posts Scraper](https://apify.com/crawlerbros/linkedin-company-posts-scraper) | Posts published from a company page |
| [LinkedIn Events Scraper](https://apify.com/crawlerbros/linkedin-events-scraper) | Events by keyword/URL with full event detail |
| [LinkedIn Hashtag Posts Scraper](https://apify.com/crawlerbros/linkedin-hashtag-posts-scraper) | Posts ranked under a `#hashtag` |
| [LinkedIn Jobs Scraper](https://apify.com/crawlerbros/linkedin-jobs-scraper) | Job listings via the public jobs-guest API |
| [LinkedIn Jobs Scraper Ultra](https://apify.com/crawlerbros/linkedin-jobs-scraper-ultra) | Same as jobs-scraper + full detail enrichment |
| [LinkedIn Learning Courses Scraper](https://apify.com/crawlerbros/linkedin-learning-courses-scraper) | LinkedIn Learning course catalog by keyword |
| [LinkedIn People Search Scraper](https://apify.com/crawlerbros/linkedin-people-search-scraper) | People search with every LinkedIn facet (role, company, school, location, etc.) |
| [LinkedIn Post Reactions Scraper](https://apify.com/crawlerbros/linkedin-post-reactions-scraper) | Reactors on a post (name, headline, reaction type) |
| [LinkedIn Post Scraper](https://apify.com/crawlerbros/linkedin-post-scraper) | Full post (text, media, engagement counts, author) |
| [LinkedIn Post Search Scraper](https://apify.com/crawlerbros/linkedin-post-search-scraper) | Posts matching a keyword (with date/author/network filters) |
| [LinkedIn Profile Posts Scraper](https://apify.com/crawlerbros/linkedin-profile-posts-scraper) | All posts/reposts/articles for one profile |
| [LinkedIn Profile Scraper](https://apify.com/crawlerbros/linkedin-profile-scraper) | Public profile fields (name, headline, positions, education, skills) |
| [LinkedIn Profile Scraper Pro](https://apify.com/crawlerbros/linkedin-profile-scraper-pro) | Profile fields + extras (recommendations, organizations, languages) |
| [LinkedIn Profile Scraper Pro Ultra](https://apify.com/crawlerbros/linkedin-profile-scraper-pro-ultra) | Pro + premium fields (contact info, followers list when allowed) |
| [LinkedIn Profile Scraper Ultra](https://apify.com/crawlerbros/linkedin-profile-scraper-ultra) | Profile + the full upstream dash-120 surface |
| [LinkedIn Profile Search by Name](https://apify.com/crawlerbros/linkedin-profile-search-by-name) | Search profiles by person name (great for matching CSVs of names) |
| [LinkedIn Schools Alumni Scraper](https://apify.com/crawlerbros/linkedin-schools-alumni-scraper) | Alumni list for any LinkedIn school page |
| [LinkedIn User Activity Scraper](https://apify.com/crawlerbros/linkedin-user-activity-scraper) | Reactions + comments + posts feed for one profile |

All actors share the same `cookie` input format (plain `li_at` OR full cookies JSON array) and the same omit-empty output convention.

# Actor input Schema

## `maxPosts` (type: `integer`):

Maximum number of top content posts to scrape.

## `category` (type: `string`):

Optional topic keyword to filter top content (e.g. 'AI', 'leadership', 'marketing'). Leave empty to scrape general trending posts.

## `dateRange` (type: `string`):

Only return posts published in the selected window (LinkedIn's own time bucket). Leave empty for any time.

## `language` (type: `string`):

Preferred response language for LinkedIn API requests (affects post translation and surfaced posts).

## `mediaTypeFilter` (type: `string`):

Only return posts of a specific media type. Leave empty to return all types.

## `minReactions` (type: `integer`):

Only return posts with at least this many reactions. Leave empty (or 0) for no minimum.

## `minComments` (type: `integer`):

Only return posts with at least this many comments. Leave empty (or 0) for no minimum.

## `cookie` (type: `string`):

LinkedIn session cookie for authenticated access to more posts. Accepts: (1) the li\_at value, or (2) full cookies JSON array from an export extension. Without cookie, only the public trending feed is available.

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

Optional Apify proxy configuration. Residential proxy recommended for better results with cookie-based access.

## Actor input object example

```json
{
  "maxPosts": 25,
  "dateRange": "",
  "language": "",
  "mediaTypeFilter": "",
  "cookie": "AQEDATVc5uMEM5s_AAABnro67cYAAAGe3kdxxk0Ajoj1en-Axa4lUoxvqVMAsMpFO2u4rOjJfIS1U1wrBETHJHqkj5i6KReB53dmYSZDgX9K4XnaFLmn7vE30gVWegfZltSOZVu_-Ny8sl4-aAKzeN-H"
}
```

# 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 = {
    "maxPosts": 25,
    "cookie": "AQEDATVc5uMEM5s_AAABnro67cYAAAGe3kdxxk0Ajoj1en-Axa4lUoxvqVMAsMpFO2u4rOjJfIS1U1wrBETHJHqkj5i6KReB53dmYSZDgX9K4XnaFLmn7vE30gVWegfZltSOZVu_-Ny8sl4-aAKzeN-H"
};

// Run the Actor and wait for it to finish
const run = await client.actor("crawlerbros/linkedin-top-content-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 = {
    "maxPosts": 25,
    "cookie": "AQEDATVc5uMEM5s_AAABnro67cYAAAGe3kdxxk0Ajoj1en-Axa4lUoxvqVMAsMpFO2u4rOjJfIS1U1wrBETHJHqkj5i6KReB53dmYSZDgX9K4XnaFLmn7vE30gVWegfZltSOZVu_-Ny8sl4-aAKzeN-H",
}

# Run the Actor and wait for it to finish
run = client.actor("crawlerbros/linkedin-top-content-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 '{
  "maxPosts": 25,
  "cookie": "AQEDATVc5uMEM5s_AAABnro67cYAAAGe3kdxxk0Ajoj1en-Axa4lUoxvqVMAsMpFO2u4rOjJfIS1U1wrBETHJHqkj5i6KReB53dmYSZDgX9K4XnaFLmn7vE30gVWegfZltSOZVu_-Ny8sl4-aAKzeN-H"
}' |
apify call crawlerbros/linkedin-top-content-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,crawlerbros/linkedin-top-content-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/udOj2Hqj2h2yYEWc1/builds/AIh23qFVjCY9iNTS8/openapi.json
