# LinkedIn Posts Search API (`sandhive/linkedin-posts-parser`) Actor

Search and filter LinkedIn posts by keyword, country, hiring intent, links, engagement, and freshness. Built for job discovery, lead generation, market research, and content monitoring.

- **URL**: https://apify.com/sandhive/linkedin-posts-parser.md
- **Developed by:** [Alex SandHive](https://apify.com/sandhive) (community)
- **Categories:** Jobs, Agents, Social media
- **Stats:** 85 total users, 22 monthly users, 100.0% runs succeeded, 3 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $2.50 / 1,000 results

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/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 Posts Parser

Apify Actor for searching a hosted LinkedIn posts dataset. The Actor calls the API, forwards the selected filters, and saves each returned post as one dataset item.

Use it to find hiring posts, monitor niche keywords with LinkedIn boolean search, export posts with links, discover fresh low-competition discussions, filter by parse time, or search inside parsed comments.

### Core Use Cases

#### LinkedIn Boolean Search

Use AND / OR / NOT, quotes, and parentheses inside each query string (same idea as [LinkedIn boolean search](https://www.linkedin.com/help/linkedin/answer/a524335)).

```json
{
  "query": [
    "\"strategy and operations\" AND hiring AND (Chennai OR Kolkata OR Jaipur OR India)"
  ],
  "sortBy": "newest",
  "limit": 25
}
```

#### Bulk OR Queries

Multiple `query` entries are OR'd. Each entry may itself use boolean syntax.

```json
{
  "query": ["machine learning", "deep learning", "ai OR ml"],
  "sortBy": "newest"
}
```

#### Hiring Post Discovery

Find posts that look like job openings or active hiring announcements.

```json
{
  "query": ["software engineer"],
  "isHiring": "true",
  "country": ["us", "gb", "de"],
  "sortBy": "newest"
}
```

#### Fresh Low-Competition Posts

Find recent posts with few comments so you can engage early.

```json
{
  "query": ["product strategy"],
  "maxComments": 5,
  "postedWithinHours": 24,
  "sortBy": "newest"
}
```

#### Recently Parsed Posts

Filter by when the post HTML was ingested/parsed (`parseTimestamp`), not only when it was published.

```json
{
  "query": ["hiring"],
  "parsedWithinHours": 24,
  "sortBy": "newest"
}
```

Custom parse window:

```json
{
  "parsedAfter": "2026-09-01T00:00:00Z",
  "parsedBefore": "2026-09-02T00:00:00Z",
  "sortBy": "newest",
  "limit": 25
}
```

#### Hashtag And Comment Monitoring

Search by hashtags and parsed comments.

```json
{
  "hashtags": ["hiring", "ai"],
  "commentQuery": "interested",
  "hasComments": "true",
  "sortBy": "hot"
}
```

#### High-Engagement Research

Find top-performing posts in a niche.

```json
{
  "query": ["startup fundraising"],
  "minLikes": 50,
  "sortBy": "top"
}
```

#### Dataset Export

Use `limit` and `offset` to export filtered pages into your own workflows.

```json
{
  "query": ["product manager"],
  "limit": 100,
  "offset": 100
}
```

### Input Filters

Empty fields are ignored. The API combines provided filters with AND logic, except `query` list items and `hashtags` / `country` lists, which are OR'd within that field.

| Parameter | Type | Default | Description |
| --- | --- | --- | --- |
| `query` | `string` | `string[]` | - | Keyword / LinkedIn boolean search. A list ORs sub-queries; each string supports `AND`, `OR`, `NOT`, quotes, and parentheses. |
| `excludeWords` | `string` | - | Exclude posts containing any of these indexed word tokens. |
| `country` | `string` | `string[]` | - | ISO-2 LinkedIn country/subdomain code(s), OR'd. |
| `hashtags` | `string[]` | - | Match posts containing any listed hashtag. `#ai` and `ai` both work. |
| `contentType` | `string` | - | Stored LinkedIn content type, for example `POST`. |
| `commentQuery` | `string` | - | Case-insensitive text search inside parsed comments. |
| `commentAuthor` | `string` | - | Case-insensitive search by parsed comment author name. |
| `hasComments` | `""`, `"true"`, `"false"` | `""` | Any, only posts with parsed comments, or only posts without parsed comments. |
| `isHiring` | `""`, `"true"`, `"false"` | `""` | Any, hiring posts, or non-hiring posts. |
| `hasLink` | `""`, `"true"`, `"false"` | `""` | Any, posts with external links, or posts without external links. |
| `minLikes` / `maxLikes` | `integer` | - | Minimum or maximum likes. |
| `minComments` / `maxComments` | `integer` | - | Minimum or maximum comment count. |
| `minLikesPerHour` / `maxLikesPerHour` | `number` | - | Minimum or maximum likes/hour velocity. |
| `minCommentsPerHour` / `maxCommentsPerHour` | `number` | - | Minimum or maximum comments/hour velocity. |
| `postedWithinHours` | `integer` | - | Only posts from the last N hours, max `8760`. API default is 216 h when `query`/`excludeWords` is set; pass `0` to disable. Ignored when `postedAfter`/`postedBefore` is set. |
| `timeRelevance` | `any`, `lastHour`, `last24h`, `lastWeek`, `lastMonth` | - | Relative publication recency. Overridden by `postedWithinHours` / custom posted range. |
| `postedAfter` / `postedBefore` | `string` (ISO 8601) | - | Custom publication timestamp range. Disables the default recency window. |
| `parsedWithinHours` | `integer` | - | Only posts parsed in the last N hours. Also derives a publication window; skips implicit posted defaults. |
| `parsedAfter` / `parsedBefore` | `string` (ISO 8601) | - | Custom `parseTimestamp` range. Disables `parsedWithinHours`. |
| `authorType` | `any`, `person`, `company` | `any` | Filter by inferred author type. |
| `sortBy` | `newest`, `top`, `hot` | `newest` | Sort by publication time, likes, or engagement velocity. |
| `limit` | `integer` | `25` | Number of posts to return, from `1` to `100`. |
| `offset` | `integer` | `0` | Pagination offset, max `10000`. |

Boolean filters are strings in the Actor input schema so users can keep the filter unset with `""` / `Any`. The Actor converts `"true"` and `"false"` to booleans before sending the API request. Legacy inputs that pass `query` or `country` as a single string still work.

### Output Dataset Format

Each dataset item is one post returned from the API.

| Field | Type | Description |
| --- | --- | --- |
| `postKey` | `string` | Unique LinkedIn post identifier. |
| `text` | `string \| null` | Full post text. |
| `hashtags` | `string[]` | Hashtags parsed from the post text. |
| `contentType` | `string` | Stored LinkedIn content type, usually `POST`. |
| `author` | `string \| null` | Author display name. |
| `authorUrl` | `string \| null` | LinkedIn profile, company, or showcase URL. |
| `authorType` | `person \| company` | Inferred from `authorUrl`. |
| `createdAt` | `string \| null` | ISO 8601 publication timestamp. |
| `geo` | `string \| null` | Stored geo code or label. |
| `likes` | `integer \| null` | Number of likes/reactions. |
| `commentsCount` | `integer \| null` | Number of comments. |
| `comments` | `object[]` | Parsed comments, if available. |
| `hasLink` | `boolean` | Whether the post contains an external link. |
| `isHiring` | `boolean` | Whether the post appears to be a hiring/job post. |
| `postUrl` | `string \| null` | Direct LinkedIn post URL. |
| `likesPerHour` | `number` | Likes divided by post age in hours. |
| `commentsPerHour` | `number` | Comments divided by post age in hours. |

Parsed comment objects can contain:

| Field | Type | Description |
| --- | --- | --- |
| `urn` | `string \| null` | LinkedIn comment URN. |
| `author` | `string \| null` | Comment author display name. |
| `authorUrl` | `string \| null` | LinkedIn URL of the comment author. |
| `text` | `string \| null` | Comment text. |
| `timeText` | `string \| null` | Original relative time text. |
| `datePublished` | `string \| null` | Published date if available. |
| `likes` | `integer` | Number of likes on the comment. |

### Example Input

```json
{
  "query": [
    "\"strategy and operations\" AND hiring AND (Chennai OR Kolkata OR India)"
  ],
  "excludeWords": "course webinar",
  "country": ["us", "in"],
  "hashtags": ["hiring", "productmanagement"],
  "isHiring": "true",
  "hasLink": "true",
  "hasComments": "true",
  "minLikes": 3,
  "maxComments": 10,
  "parsedWithinHours": 48,
  "authorType": "company",
  "sortBy": "newest",
  "limit": 50
}
```

### Example Output Item

```json
{
  "postKey": "7180000000000000000",
  "text": "We're hiring a Senior Product Manager to join our platform team...",
  "hashtags": ["hiring", "productmanagement"],
  "contentType": "POST",
  "author": "Acme Corp",
  "authorUrl": "https://www.linkedin.com/company/acme-corp",
  "authorType": "company",
  "createdAt": "2026-03-30T14:22:00+00:00",
  "geo": "us",
  "likes": 47,
  "commentsCount": 6,
  "comments": [
    {
      "urn": "urn:li:comment:(activity:7180000000000000000,7190000000000000000)",
      "author": "Jane Doe",
      "authorUrl": "https://www.linkedin.com/in/jane-doe",
      "text": "Interested, thanks for sharing.",
      "timeText": "2h",
      "datePublished": "2026-03-30T16:10:00Z",
      "likes": 1
    }
  ],
  "hasLink": true,
  "isHiring": true,
  "postUrl": "https://www.linkedin.com/feed/update/urn:li:activity:7180000000000000000",
  "likesPerHour": 2.35,
  "commentsPerHour": 0.3
}
```

# Actor input Schema

## `query` (type: `array`):

One or more keyword / LinkedIn boolean queries. Multiple entries are OR'd together. Each entry supports AND, OR, NOT, quoted phrases, and parentheses — e.g. `"strategy and operations" AND hiring AND (Chennai OR Kolkata OR Jaipur OR India)`. A single plain string in JSON input is also accepted.

## `excludeWords` (type: `string`):

Exclude posts containing any of these indexed word tokens.

## `country` (type: `array`):

ISO-2 LinkedIn country/subdomain codes (OR), for example us, gb, de, fr. A single string in JSON input is also accepted.

## `hashtags` (type: `array`):

Return posts containing any of these hashtags. Values may include or omit '#'.

## `contentType` (type: `string`):

Stored LinkedIn content type, for example POST.

## `commentQuery` (type: `string`):

Case-insensitive text search inside parsed comments.

## `commentAuthor` (type: `string`):

Case-insensitive search by parsed comment author name.

## `hasComments` (type: `string`):

Filter by whether parsed comment objects are present.

## `isHiring` (type: `string`):

Filter by whether the post appears to be a hiring or job announcement.

## `hasLink` (type: `string`):

Filter by whether the post contains an external link.

## `minLikes` (type: `integer`):

Only return posts with at least this many likes.

## `maxLikes` (type: `integer`):

Only return posts with no more than this many likes.

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

Only return posts with at least this many comments.

## `maxComments` (type: `integer`):

Only return posts with no more than this many comments.

## `minLikesPerHour` (type: `number`):

Only return posts with at least this likes/hour velocity.

## `maxLikesPerHour` (type: `number`):

Only return posts with no more than this likes/hour velocity.

## `minCommentsPerHour` (type: `number`):

Only return posts with at least this comments/hour velocity.

## `maxCommentsPerHour` (type: `number`):

Only return posts with no more than this comments/hour velocity.

## `postedWithinHours` (type: `integer`):

Only posts published within the last N hours (max 8760). When query/excludeWords is set and this is omitted, the API defaults to 216 h (9 days). Pass 0 to disable that default. Ignored when postedAfter/postedBefore is set. Not needed when using parsed\* filters — those already derive a publication window.

## `timeRelevance` (type: `string`):

Relative publication recency shortcut. Overridden by postedWithinHours when that is set, and by postedAfter/postedBefore.

## `postedAfter` (type: `string`):

Custom publication range start (inclusive), ISO 8601. Disables the default recency window. Example: 2026-09-01T00:00:00Z

## `postedBefore` (type: `string`):

Custom publication range end (inclusive), ISO 8601. Disables the default recency window. Example: 2026-09-05T00:00:00Z

## `parsedWithinHours` (type: `integer`):

Only posts whose HTML was parsed in the last N hours (parseTimestamp). Also derives a publication timestamp window. Skips implicit keyword/hashtag posted defaults — you do not need postedWithinHours: 0. Ignored when parsedAfter/parsedBefore is set.

## `parsedAfter` (type: `string`):

Custom parse-time range start (inclusive) for parseTimestamp, ISO 8601. Disables parsedWithinHours. Also raises the publication timestamp lower bound. Example: 2026-09-01T00:00:00Z

## `parsedBefore` (type: `string`):

Custom parse-time range end (inclusive) for parseTimestamp, ISO 8601. Disables parsedWithinHours. Example: 2026-09-02T00:00:00Z

## `authorType` (type: `string`):

Filter by inferred author type.

## `sortBy` (type: `string`):

Sort results by publication time, likes, or engagement velocity.

## `limit` (type: `integer`):

Maximum number of posts to return (1-100).

## `offset` (type: `integer`):

Pagination offset for exporting additional pages.

## Actor input object example

```json
{
  "query": [
    "\"strategy and operations\" AND hiring AND (Chennai OR Kolkata OR Jaipur OR India)"
  ],
  "excludeWords": "course webinar",
  "country": [
    "us",
    "gb"
  ],
  "hashtags": [
    "hiring",
    "ai"
  ],
  "contentType": "POST",
  "hasComments": "",
  "isHiring": "",
  "hasLink": "",
  "postedWithinHours": 48,
  "timeRelevance": "",
  "postedAfter": "2026-09-01T00:00:00Z",
  "postedBefore": "2026-09-05T00:00:00Z",
  "parsedWithinHours": 24,
  "parsedAfter": "2026-09-01T00:00:00Z",
  "parsedBefore": "2026-09-02T00:00:00Z",
  "authorType": "any",
  "sortBy": "newest",
  "limit": 25,
  "offset": 0
}
```

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("sandhive/linkedin-posts-parser").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 = {}

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

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,sandhive/linkedin-posts-parser"
        }
    }
}

```

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/cDspbRETQHzkRUFbd/builds/0juuDMaRnEKVYTYgS/openapi.json
