# LinkedIn Post Search Scraper (`khadinakbar/linkedin-post-search-scraper`) Actor

Search public LinkedIn posts, feed updates, and articles by keyword. Returns post text, author, engagement, media, public comments, and next cursor metadata.

- **URL**: https://apify.com/khadinakbar/linkedin-post-search-scraper.md
- **Developed by:** [Khadin Akbar](https://apify.com/khadinakbar) (community)
- **Categories:** Social media, Lead generation, MCP servers
- **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 post founds

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.md):

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

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.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/platform/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 Post Search Scraper

Search public LinkedIn posts, feed updates, and Pulse articles by keyword and export structured post data to JSON, CSV, Excel, or the Apify API.

This actor is built for social listening, B2B market research, GTM teams, founders, investors, analysts, and AI agents that need a clean feed of public LinkedIn discussions around a topic, company, competitor, product category, or phrase.

The actor uses ScrapeCreators' public LinkedIn post search endpoint. That endpoint finds Google-indexed public LinkedIn posts and then extracts the visible LinkedIn page details. It does **not** use LinkedIn login cookies, does not access private posts, and does not claim complete LinkedIn-native search coverage.

### What It Extracts

Each dataset item represents one public LinkedIn post or article.

| Field | Description |
| --- | --- |
| `postUrl` | Public LinkedIn post, feed update, or article URL |
| `postId` | LinkedIn activity or article ID parsed from the URL when available |
| `publishedAt` | Publication timestamp when LinkedIn exposes it publicly |
| `description` | Public post text or article description |
| `authorName` | Public author name |
| `authorUrl` | Public LinkedIn author profile or page URL |
| `authorFollowers` | Follower count when available |
| `likeCount` | Public like/reaction count when available |
| `commentCount` | Public comment count when available |
| `engagementCount` | `likeCount + commentCount` when at least one count is available |
| `mediaUrl` / `imageUrl` | Media URLs exposed on the public page |
| `comments` | Public comments returned by the provider when enabled |
| `runId` | Apify run ID that produced the record |
| `searchQuery` | Input query used for this record |
| `source` | Data provider used |
| `scrapedAt` | Timestamp when this actor saved the record |

### Inputs

- `query` - keyword or phrase to search for.
- `datePosted` - optional freshness filter: any time, last hour, last day, last week, last month, or last year.
- `maxResults` - hard cap on saved posts and billed post events.
- `maxProviderPages` - advanced pagination safety cap. Keep the default unless you intentionally want to limit upstream calls.
- `startCursor` - continue from a previous run's `nextCursor`.
- `includeComments` - include public comments returned with each post.
- `outputMode` - `full` for all supported fields, `compact` for smaller LLM-friendly records.

### Example Input

```json
{
  "query": "ai agents",
  "datePosted": "last-week",
  "maxResults": 50,
  "maxProviderPages": 60,
  "includeComments": true,
  "outputMode": "full"
}
````

### Example Output

```json
{
  "postUrl": "https://www.linkedin.com/posts/aagupta_what-you-need-to-know-ai-agents-activity-7354600338621906944-RvXR",
  "postId": "7354600338621906944",
  "searchQuery": "ai agents",
  "datePosted": "last-week",
  "publishedAt": "2025-07-25T19:56:02.566Z",
  "description": "There's way too much hype about AI agents...",
  "authorName": "Aakash Gupta",
  "authorUrl": "https://www.linkedin.com/in/aagupta",
  "authorFollowers": 313422,
  "likeCount": 217,
  "commentCount": 25,
  "engagementCount": 242,
  "position": 1,
  "runId": "6neqzJ0WbGrfDOHb4",
  "source": "scrapecreators",
  "scrapedAt": "2026-06-08T00:00:00.000Z"
}
```

### Run Summary and Cursors

Every run writes a machine-readable `OUTPUT` record to the default key-value store. Use it to decide what to do next:

```json
{
  "savedCount": 50,
  "chargedThisRun": 50,
  "estimatedPpeCostUsd": 0.25,
  "pagesFetched": 4,
  "nextCursor": "5",
  "stopReason": "max-results-reached",
  "providerAttempts": 4,
  "providerRetries": 0,
  "providerStatusCodes": [200]
}
```

To continue, pass `nextCursor` from the previous `OUTPUT` as `startCursor` in the next run. Common `stopReason` values are:

- `max-results-reached` - the actor reached your `maxResults` cap.
- `no-results` - the provider found no public indexed posts for the query and date filter.
- `no-more-results` - the provider page had no additional cursor.
- `max-provider-pages-reached` - the advanced page safety cap stopped pagination.
- `provider-error` or `partial-provider-error` - upstream provider failed before or after some records were saved.

### Use Cases

- Monitor public LinkedIn conversations about your company, competitors, or category.
- Find high-engagement posts about emerging B2B topics.
- Build lead and account research workflows around public market signals.
- Feed AI agents with recent public LinkedIn discussions for summarization and trend analysis.
- Track thought leaders and public reactions around launches, funding news, product categories, or conferences.

### Pricing

This actor is designed for pay-per-event monetization:

- `apify-actor-start`: platform start event.
- `post-found`: one public LinkedIn post saved to the dataset.

The actor logs the maximum possible post-event cost before it starts and stops before saving or charging more than `maxResults`.

The default run memory is 512 MB because this is an API-backed actor, not a browser crawler. That keeps the platform start event lighter while still leaving enough room for large JSON pages.

### Limitations

LinkedIn post search is best-effort. Results depend on what Google has indexed and what LinkedIn exposes publicly. This actor does not scrape private LinkedIn content, does not use account cookies, and does not provide a complete LinkedIn-native search index.

For known post URLs, use a LinkedIn post-detail scraper. For LinkedIn jobs or profile emails, use actors built specifically for those data types.

### API Example

```bash
curl -X POST "https://api.apify.com/v2/acts/khadinakbar~linkedin-post-search-scraper/runs?token=YOUR_APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"query":"ai agents","datePosted":"last-week","maxResults":25}'
```

### Legal

This actor is intended for public web data that is visible without authentication. You are responsible for using the output in compliance with applicable laws, platform terms, privacy requirements, and your own data governance policies.

# Actor input Schema

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

Keyword or phrase to search for in public LinkedIn posts. The actor uses Google-indexed LinkedIn post results via ScrapeCreators, so results are best-effort and depend on public indexing. Use a focused phrase such as a company name, topic, product category, or exact quote for cleaner matches.

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

Optional freshness filter applied by the upstream provider to Google-indexed LinkedIn results. Recent windows can be sparse because the provider can only return public posts that Google has indexed. Use last-week or last-month for the best balance of freshness and coverage.

## `maxResults` (type: `integer`):

Maximum number of post records to save to the dataset. This is also the hard cap for billable post-found events. Higher values may require multiple provider pages because ScrapeCreators returns paginated results.

## `maxProviderPages` (type: `integer`):

Advanced safety valve for pagination. Leave at 60 for normal runs. Lower this when you are testing, debugging cursor behavior, or intentionally limiting upstream provider calls.

## `startCursor` (type: `string`):

Optional cursor returned by a previous run. Paste the value from the run summary to continue from a later provider page. Leave empty for the first page of results.

## `includeComments` (type: `boolean`):

Include the public comments returned by the provider in each dataset record. Disable this for smaller records when you only need post-level metadata and engagement counts.

## `outputMode` (type: `string`):

Compact mode keeps the most common fields for quick monitoring and LLM workflows. Full mode also includes images, media URLs, provider cursor context, and comments when enabled.

## Actor input object example

```json
{
  "query": "ai agents",
  "datePosted": "last-week",
  "maxResults": 50,
  "maxProviderPages": 60,
  "includeComments": true,
  "outputMode": "full"
}
```

# Actor output Schema

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

Dataset items containing public LinkedIn post URL, text, author, engagement, media, optional comments, and scrape metadata.

## `summary` (type: `string`):

Run summary including savedCount, stopReason, pagesFetched, nextCursor, providerAttempts, providerRetries, providerStatusCodes, source, and estimated billing counters.

# 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("khadinakbar/linkedin-post-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("khadinakbar/linkedin-post-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 khadinakbar/linkedin-post-search-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "LinkedIn Post Search Scraper",
        "description": "Search public LinkedIn posts, feed updates, and articles by keyword. Returns post text, author, engagement, media, public comments, and next cursor metadata.",
        "version": "1.0",
        "x-build-id": "4HLrpuBU1V8WTSMtr"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/khadinakbar~linkedin-post-search-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-khadinakbar-linkedin-post-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/khadinakbar~linkedin-post-search-scraper/runs": {
            "post": {
                "operationId": "runs-sync-khadinakbar-linkedin-post-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/khadinakbar~linkedin-post-search-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-khadinakbar-linkedin-post-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": [
                    "query"
                ],
                "properties": {
                    "query": {
                        "title": "Search query",
                        "minLength": 2,
                        "maxLength": 200,
                        "type": "string",
                        "description": "Keyword or phrase to search for in public LinkedIn posts. The actor uses Google-indexed LinkedIn post results via ScrapeCreators, so results are best-effort and depend on public indexing. Use a focused phrase such as a company name, topic, product category, or exact quote for cleaner matches."
                    },
                    "datePosted": {
                        "title": "Date posted",
                        "enum": [
                            "any",
                            "last-hour",
                            "last-day",
                            "last-week",
                            "last-month",
                            "last-year"
                        ],
                        "type": "string",
                        "description": "Optional freshness filter applied by the upstream provider to Google-indexed LinkedIn results. Recent windows can be sparse because the provider can only return public posts that Google has indexed. Use last-week or last-month for the best balance of freshness and coverage.",
                        "default": "last-week"
                    },
                    "maxResults": {
                        "title": "Maximum posts",
                        "minimum": 1,
                        "maximum": 500,
                        "type": "integer",
                        "description": "Maximum number of post records to save to the dataset. This is also the hard cap for billable post-found events. Higher values may require multiple provider pages because ScrapeCreators returns paginated results.",
                        "default": 50
                    },
                    "maxProviderPages": {
                        "title": "Maximum provider pages",
                        "minimum": 1,
                        "maximum": 60,
                        "type": "integer",
                        "description": "Advanced safety valve for pagination. Leave at 60 for normal runs. Lower this when you are testing, debugging cursor behavior, or intentionally limiting upstream provider calls.",
                        "default": 60
                    },
                    "startCursor": {
                        "title": "Start cursor",
                        "maxLength": 200,
                        "type": "string",
                        "description": "Optional cursor returned by a previous run. Paste the value from the run summary to continue from a later provider page. Leave empty for the first page of results."
                    },
                    "includeComments": {
                        "title": "Include public comments",
                        "type": "boolean",
                        "description": "Include the public comments returned by the provider in each dataset record. Disable this for smaller records when you only need post-level metadata and engagement counts.",
                        "default": true
                    },
                    "outputMode": {
                        "title": "Output mode",
                        "enum": [
                            "full",
                            "compact"
                        ],
                        "type": "string",
                        "description": "Compact mode keeps the most common fields for quick monitoring and LLM workflows. Full mode also includes images, media URLs, provider cursor context, and comments when enabled.",
                        "default": "full"
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
