# LinkedIn Profile Posts Scraper (No Cookies) (`harvestapi/linkedin-profile-posts`) Actor

Extract posts from LinkedIn profiles, including content, media, engagement, reactions, comments, and more. No cookies or account required.

- **URL**: https://apify.com/harvestapi/linkedin-profile-posts.md
- **Developed by:** [HarvestAPI](https://apify.com/harvestapi) (community)
- **Categories:** Lead generation, Social media, Automation
- **Features:** Limited permissions
- **Stats:** 47,924 total users, 13,542 monthly users, 100.0% runs succeeded, 622 bookmarks
- **User rating**: 4.40 out of 5 stars

## Pricing

from $1.50 / 1,000 posts

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?

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 Profile Posts scraper

Our powerful tool helps you gather posts from LinkedIn profiles or companies without compromising security or violating platform policies. Extract full post data, engagement metrics, and additionally scrape reactions and comments. This greatly helps with engagement analysis and outreach purposes.

#### Key Benefits

- No cookies or account required: Access profile data without sharing cookies or risking account restrictions
- Low pricing: $2 per 1k posts.
- Fast response times deliver data in seconds 🚀
- No caching, fresh data.
- Concurrency: the actor scrapes 6 profiles/companies at a time.

### How It Works

Simply provide one of the following:

- `targetUrls` List of LinkedIn profile/company URLs who posted or re-posted the content.

Additional content:

- `scrapeReactions` - Enable to scrape reactions to posts. Default is `false`. Reactions will be charged as a separate post and pushed into the dataset. Each post will also contain a nested list of its own reactions.
- `maxReactions` - Maximum number of reactions to scrape per post. If you set this to 0, it will scrape all reactions.
- `scrapeComments` - Enable to scrape comments to posts. Default is `false`. Comments will be charged as a separate post and pushed into the dataset. Each post will also contain a nested list of its own comments.
- `maxComments` - Maximum number of comments to scrape per post. If you set this to 0, it will scrape all comments.

Other params (optionally):

- `maxPosts` - Maximum number of posts to scrape per each search query. This overrides `scrapePages` pagination. If you set this to 0, it will scrape all posts.
- `postedLimitDate` - Scrape posts from now up to and including this date. It supports the [Date time string format](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#date_time_string_format). For example, "2011-10-10", or "2011-10-10T14:48:00.000+09:00" or a timestamp: "628021800000".
- `includeQuotePosts` - Toggle to filter out quote posts (shared posts with comments). By default, all posts are scraped.
- `includeReposts` - Toggle to filter out reposts (shared posts without comments). By default, all posts are scraped.

**If you want to search post by text queries or more advanced filters, you can use our Post Search scraper [Linkedin Post Search Scraper](https://apify.com/harvestapi/linkedin-post-search).**

#### Data You'll Receive

- Post content
- Author information
- Social engagement metrics
- Media: images, videos, and links
- Content of Re-posts
- Comments and reactions (if enabled, each item will be charged as a separate post)

#### Sample output data

Here is the example post output of this actor:

```json
{
  "type": "post",
  "id": "7329207003942125568",
  "linkedinUrl": "https://www.linkedin.com/posts/williamhgates_how-better-data-helped-us-cut-child-mortality-activity-7329207003942125568-_gfJ",
  "content": "The leading causes of childhood death reveal a stark truth: Many could be prevented, and children in poor countries die from them far more often than those in wealthy ones. We have the tools to save lives—and by helping them reach the right children at the right time, the world has cut global child deaths by more than half—from 12 million in 1990 to 4.6 million in 2021. It’s extraordinary progress, but the work isn’t over: https://lnkd.in/gC4pEPsW",
  "author": {
    "universalName": null,
    "publicIdentifier": "williamhgates",
    "type": "profile",
    "name": "Bill Gates",
    "linkedinUrl": "https://www.linkedin.com/in/williamhgates?miniProfileUrn=urn%3Ali%3Afsd_profile%3AACoAAA8BYqEBCGLg_vT_ca6mMEqkpp9nVffJ3hc",
    "info": "Chair, Gates Foundation and Founder, Breakthrough Energy",
    "website": "https://www.linkedin.com/newsletters/gates-notes-6651495472181637121/",
    "websiteLabel": "View my newsletter",
    "avatar": {
      "url": "https://media.licdn.com/dms/image/v2/D5603AQF-RYZP55jmXA/profile-displayphoto-shrink_800_800/B56ZRi8g.aGsAc-/0/1736826818808?e=1753315200&v=beta&t=ot0V86_HfZ7Jk2m6u9RV-vORolb2cJ6Skj5T1FoGlso",
      "width": 800,
      "height": 800,
      "expiresAt": 1753315200000
    }
  },
  "postedAt": {
    "timestamp": 1747419119821,
    "date": "2025-05-16T18:11:59.821Z",
    "postedAgoShort": "6d",
    "postedAgoText": "6 days ago • Visible to anyone on or off LinkedIn"
  },
  "postImages": [],
  "document": {
    "title": " How better data helped us cut child mortality in half",
    "transcribedDocumentUrl": "https://media.licdn.com/dms/document/media/v2/D561FAQGPMwZUeWRF4w/feedshare-document-pdf-analyzed/B56ZbaStGgHgAY-/0/1747419060033?e=1748556000&v=beta&t=LpSrvoiBPULbHs8RDjwayRtdpkRT747P6kZjdHXqWLE",
    "coverPages": [
      {
        "width": 1921,
        "imageUrls": [
          "https://media.licdn.com/dms/image/v2/D561FAQGPMwZUeWRF4w/feedshare-document-cover-images_1920/B56ZbaStGgHgAw-/0/1747419061061?e=1748556000&v=beta&t=xwvy_C8x1NZoKqbC8oIZjo7k2xiZweHkQl0E96zZ_5c",
          "https://media.licdn.com/dms/image/v2/D561FAQGPMwZUeWRF4w/feedshare-document-cover-images_1920/B56ZbaStGgHgAw-/1/1747419061061?e=1748556000&v=beta&t=vT0l9ej-cxGHJ03Fu49ONBjYlswLmpr0R7BUzbFRUu4"
        ],
        "height": 1243
      }
    ],
    "totalPageCount": 2
  },
  "socialContent": {
    "hideCommentsCount": false,
    "hideReactionsCount": false,
    "hideSocialActivityCounts": false,
    "hideShareAction": true,
    "hideSendAction": true,
    "hideRepostsCount": false,
    "hideViewsCount": false,
    "trustInterventionBanner": null,
    "hideReactAction": false,
    "hideCommentAction": false,
    "shareUrl": "https://www.linkedin.com/posts/williamhgates_how-better-data-helped-us-cut-child-mortality-activity-7329207003942125568-_gfJ?utm_source=social_share_send&utm_medium=member_desktop_web&rcm=ACoAAExUClQBdCKsvo8NLfk3HZMfrSLtXnxHlNs",
    "showContributionExperience": false,
    "showSocialDetail": true
  },
  "engagement": {
    "likes": 2916,
    "comments": 328,
    "shares": 153,
    "reactions": [
      {
        "type": "LIKE",
        "count": 2477
      },
      {
        "type": "APPRECIATION",
        "count": 178
      },
      {
        "type": "EMPATHY",
        "count": 158
      },
      {
        "type": "PRAISE",
        "count": 55
      },
      {
        "type": "INTEREST",
        "count": 45
      },
      {
        "type": "ENTERTAINMENT",
        "count": 3
      }
    ]
  }
}
```

### Linkedin Profile Post API

The actor stores results in a dataset. You can export data in various formats such as CSV, JSON, XLS, etc. You can scrape and access data on demand using API.

#### Support and Feedback

We continuously enhance our tools based on user feedback. If you encounter technical issues or have suggestions for improvement:

- Create an issue on the actor’s Issues tab in Apify Console
- Or contact us at contact@harvestapi.io

**\* \* \***

**Disclaimer**: This Actor is an independent tool and is not affiliated with, endorsed by, or sponsored by LinkedIn Corporation. LinkedIn® is a registered trademark of LinkedIn Corporation. All trademarks are property of their respective owners.

# Actor input Schema

## `targetUrls` (type: `array`):

List of LinkedIn profile or company URLs to scrape. Example: `https://www.linkedin.com/in/satyanadella/` will fetch posted or re-posted content by Bill Gates.

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

Maximum number of posts to scrape per each profile or company. Default is 10. This overrides pagination. If you set this to 0, it will scrape all posts.

## `postedLimit` (type: `string`):

Fetch posts no older than X time. Options: '24h', 'week', 'month'.

## `postedLimitDate` (type: `string`):

Scrape posts from now up to and including this date. It supports the [Date time string format](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#date_time_string_format). For example, "2011-10-10", or "2011-10-10T14:48:00.000+09:00" or a timestamp: "628021800000"

## `includeQuotePosts` (type: `boolean`):

Include quote posts (shared posts with comments). By default, all posts are scraped.

## `includeReposts` (type: `boolean`):

Include reposts (shared posts without comments). By default, all posts are scraped.

## `scrapeReactions` (type: `boolean`):

Scrape reactions of posts.

## `maxReactions` (type: `integer`):

Maximum number of reactions to scrape per post. Default is 5.

## `scrapeComments` (type: `boolean`):

Scrape comments of posts.

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

Maximum number of comments to scrape per post. Default is 5.

## `commentsPostedLimit` (type: `string`):

Fetch comments no older than X time. Options: '24h', 'week', 'month'.

## `contextCountry` (type: `string`):

Set the context country for LinkedIn. This can affect the content you see on LinkedIn, as it may vary by region.

## Actor input object example

```json
{
  "targetUrls": [
    "https://www.linkedin.com/in/satyanadella/",
    "https://www.linkedin.com/company/google",
    "https://www.linkedin.com/posts/microsoft-events_microsoft-build-has-arrived-in-seattle-and-ugcPost-7329991434395160578-GnK7/",
    "https://www.linkedin.com/feed/update/urn:li:activity:7391573088309534720/"
  ],
  "maxPosts": 5,
  "includeQuotePosts": true,
  "includeReposts": true,
  "maxReactions": 5,
  "maxComments": 5
}
```

# 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 = {
    "targetUrls": [
        "https://www.linkedin.com/in/satyanadella/",
        "https://www.linkedin.com/company/google",
        "https://www.linkedin.com/posts/microsoft-events_microsoft-build-has-arrived-in-seattle-and-ugcPost-7329991434395160578-GnK7/",
        "https://www.linkedin.com/feed/update/urn:li:activity:7391573088309534720/"
    ],
    "maxPosts": 5,
    "maxReactions": 5,
    "maxComments": 5
};

// Run the Actor and wait for it to finish
const run = await client.actor("harvestapi/linkedin-profile-posts").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 = {
    "targetUrls": [
        "https://www.linkedin.com/in/satyanadella/",
        "https://www.linkedin.com/company/google",
        "https://www.linkedin.com/posts/microsoft-events_microsoft-build-has-arrived-in-seattle-and-ugcPost-7329991434395160578-GnK7/",
        "https://www.linkedin.com/feed/update/urn:li:activity:7391573088309534720/",
    ],
    "maxPosts": 5,
    "maxReactions": 5,
    "maxComments": 5,
}

# Run the Actor and wait for it to finish
run = client.actor("harvestapi/linkedin-profile-posts").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 '{
  "targetUrls": [
    "https://www.linkedin.com/in/satyanadella/",
    "https://www.linkedin.com/company/google",
    "https://www.linkedin.com/posts/microsoft-events_microsoft-build-has-arrived-in-seattle-and-ugcPost-7329991434395160578-GnK7/",
    "https://www.linkedin.com/feed/update/urn:li:activity:7391573088309534720/"
  ],
  "maxPosts": 5,
  "maxReactions": 5,
  "maxComments": 5
}' |
apify call harvestapi/linkedin-profile-posts --silent --output-dataset

```

## MCP server setup

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

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/A3cAPGpwBEG8RJwse/builds/ocTvwcnar4NgSvVu9/openapi.json
