# 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:** [Andrew](https://apify.com/seemuapps) (community)
- **Categories:** Social media, Lead generation
- **Stats:** 2 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/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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js/docs.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python/docs.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/integrations/mcp.md).

If your project is in a different language, use 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 - 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("💾 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 '{
  "query": "ai agents"
}' |
apify call seemuapps/linkedin-posts-search-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "LinkedIn Posts Scraper - Company Pages & Keyword Search",
        "description": "Scrape public LinkedIn posts by keyword or from any company page - text, author, likes, comments, and images. No login or cookies required.",
        "version": "1.0",
        "x-build-id": "1y35PuB6XlV5atOPm"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/seemuapps~linkedin-posts-search-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-seemuapps-linkedin-posts-search-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/seemuapps~linkedin-posts-search-scraper/runs": {
            "post": {
                "operationId": "runs-sync-seemuapps-linkedin-posts-search-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/seemuapps~linkedin-posts-search-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-seemuapps-linkedin-posts-search-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "mode"
                ],
                "properties": {
                    "mode": {
                        "title": "Mode",
                        "enum": [
                            "search",
                            "company"
                        ],
                        "type": "string",
                        "description": "Search public posts by keyword, or fetch the post feed of a specific company page.",
                        "default": "search"
                    },
                    "query": {
                        "title": "Search keyword",
                        "type": "string",
                        "description": "Keyword or phrase to search for in public LinkedIn posts (Keyword search mode)."
                    },
                    "companyUrl": {
                        "title": "Company page URL",
                        "type": "string",
                        "description": "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": {
                        "title": "Date posted",
                        "enum": [
                            "any",
                            "last-hour",
                            "last-day",
                            "last-week",
                            "last-month",
                            "last-year"
                        ],
                        "type": "string",
                        "description": "Only return posts published within this window (Keyword search mode only).",
                        "default": "any"
                    },
                    "maxItems": {
                        "title": "Max Items",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Maximum number of posts to return in this run. Set 0 for unlimited (until the feed is exhausted or the run times out).",
                        "default": 50
                    },
                    "postDetails": {
                        "title": "Fetch full post details",
                        "type": "boolean",
                        "description": "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).",
                        "default": false
                    },
                    "pageId": {
                        "title": "Page ID (pagination)",
                        "type": "string",
                        "description": "Paste NEXT_PAGE_ID from the previous run's Key-value store to fetch the next page of results."
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
