# LinkedIn Posts Scraper - Company Pages & Keyword Search (`seemuapps/linkedin-posts-search-scraper`) Actor

Scrape public LinkedIn posts by keyword or from any company page - text, author, likes, comments, and images. No login or cookies required.

- **URL**: https://apify.com/seemuapps/linkedin-posts-search-scraper.md
- **Developed by:** [Seemu Scraping](https://apify.com/seemuapps) (community)
- **Categories:** Social media, Lead generation
- **Stats:** 3 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.00 / 1,000 linkedin posts

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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 Posts Scraper - Company Pages & Keyword Search

Scrape public LinkedIn posts without logging in, without cookies, and without risking an account. Search all of LinkedIn by keyword, or pull the complete post feed of any company page — with text, author, engagement counts, images, and top comments.

### What you get

- **Post content**: full text, publish date, post URL and ID
- **Engagement**: like count, comment count, and up to 5 top comments per post (keyword search; company mode via the details option)
- **Author data**: name, profile URL, and follower count
- **Media**: image URLs attached to each post
- **Keyword search** across all public LinkedIn posts, with a date filter (last hour → last year)
- **Company feeds**: every recent post from any company, school, or showcase page
- **Pagination cursor** so you can collect thousands of posts across chained runs
- Export to JSON, CSV, or Google Sheets directly from the Apify console

### Use cases

- **Social listening** — track what's being said about your brand, product, or category
- **Content research** — find the top-performing posts for any topic before writing your own
- **Competitor monitoring** — follow competitor company pages and benchmark their engagement
- **Lead generation** — find people actively posting about problems your product solves
- **AI & LLM pipelines** — feed fresh B2B conversation data into RAG systems and agents

### How to use

1. Pick a **Mode**:
   - **Keyword search** — enter a **Search keyword** (e.g. `ai agents`), optionally set **Date posted**
   - **Company page posts** — enter a **Company page URL** (e.g. `https://www.linkedin.com/company/microsoft`) or just the handle (`microsoft`)
2. Set **Max Items** (default 50; 0 = unlimited)
3. (Optional) Enable **Fetch full post details** to enrich company-feed posts with engagement counts, author info, and top comments
4. Run the actor — results appear in the **Dataset** tab

#### Fetching more pages

After the run finishes, open the **Key-value store** tab → copy the `NEXT_PAGE_ID` value → paste it into **Page ID** on your next run. If `NEXT_PAGE_ID` is `null`, you've fetched everything.

### Output format

Each dataset record:

```json
{
  "url": "https://www.linkedin.com/posts/username_ai-agents-activity-7354600338621906944-RvXR",
  "postId": "7354600338621906944",
  "text": "There's way too much hype about AI agents. Here's your simple guide...",
  "datePublished": "2026-07-20T19:56:02.566Z",
  "likeCount": 718,
  "commentCount": 7,
  "authorName": "Jane Doe",
  "authorUrl": "https://www.linkedin.com/in/janedoe",
  "authorFollowers": 30863,
  "imageUrl": "https://media.licdn.com/dms/image/...",
  "images": ["https://media.licdn.com/dms/image/..."],
  "topComments": [{ "author": "John Smith", "text": "Great breakdown!" }],
  "source": "search"
}
```

### Notes

- Only public posts are returned — no login or cookies are ever used.
- One result = one post. Detail enrichment is billed separately per post, and only when it succeeds.

# Actor input Schema

## `mode` (type: `string`):

Search public posts by keyword, or fetch the post feed of a specific company page.

## `query` (type: `string`):

Keyword or phrase to search for in public LinkedIn posts (Keyword search mode).

## `companyUrl` (type: `string`):

LinkedIn company page URL (e.g. https://www.linkedin.com/company/microsoft) or bare company handle (e.g. 'microsoft'). Used in Company page posts mode.

## `datePosted` (type: `string`):

Only return posts published within this window (Keyword search mode only).

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

Maximum number of posts to return in this run. Set 0 for unlimited (until the feed is exhausted or the run times out).

## `postDetails` (type: `boolean`):

When enabled, each post is enriched with like/comment counts, author info, and top comments via an extra lookup per post. Most useful in Company page posts mode (keyword search results already include engagement data).

## `pageId` (type: `string`):

Paste NEXT_PAGE_ID from the previous run's Key-value store to fetch the next page of results.

## Actor input object example

```json
{
  "mode": "search",
  "query": "ai agents",
  "datePosted": "any",
  "maxItems": 50,
  "postDetails": false
}
```

# Actor output Schema

## `results` (type: `string`):

One LinkedIn post per record: url, postId, text, datePublished, likeCount, commentCount, author name/url/followers, images, and top comments.

## `nextPageId` (type: `string`):

NEXT_PAGE_ID record in the default key-value store. Paste into Page ID on the next run to resume; null when the feed is exhausted.

# 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 = {
    "query": "ai agents"
};

// Run the Actor and wait for it to finish
const run = await client.actor("seemuapps/linkedin-posts-search-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 = { "query": "ai agents" }

# Run the Actor and wait for it to finish
run = client.actor("seemuapps/linkedin-posts-search-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 '{
  "query": "ai agents"
}' |
apify call seemuapps/linkedin-posts-search-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,seemuapps/linkedin-posts-search-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/aOoZQs1jOZRi7ilgV/builds/qfABuBL2q7obQsdj8/openapi.json
