# Linkedin Posts Scraper (`data_link_miner/linkedin-posts-scraper`) Actor

Extract posts, engagement metrics, and media from LinkedIn profiles & company pages. This actor allows you to scrape LinkedIn posts from personal profiles or company pages.

- **URL**: https://apify.com/data\_link\_miner/linkedin-posts-scraper.md
- **Developed by:** [Data LinkMiner](https://apify.com/data_link_miner) (community)
- **Categories:** Social media, Lead generation, Automation
- **Stats:** 6 total users, 1 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

$25.00/month + usage

To use this Actor, you pay a monthly rental fee to the developer. The rent is subtracted from your prepaid usage every month after the free trial period.You also pay for the Apify platform usage, which gets cheaper the higher Apify subscription plan you have.

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

## 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 Posts Scraper

Extract posts, engagement metrics, and media from LinkedIn profiles & company pages

This actor allows you to scrape LinkedIn posts from personal profiles or company pages.


### How to provide cookie session ?

- install "Copy Cookies" chrome extension
- login to your account and go to your linkedin home page
- Use the extension (clicking will copy cookies)
- Paste the cookies in the input "cookies" from the actor


### Features

📄 Extract LinkedIn posts from profiles or company pages

🕒 Retrieve post publication date & time

📝 Capture full post text content

👍 Extract engagement metrics:

- Likes

- Comments

- Shares

🖼️ Extract media assets:

- Images (all resolutions)

- Videos (when available)

- Documents (PDFs, slides)

- Articles (shared links)

🔗 Get direct post URLs

🧑‍💼 Identify post author (person or company)

📦 Structured JSON output ready for analytics or storage

🔐 Authenticated scraping via LinkedIn cookies

### Use Cases

📊 Content performance analysis

📢 Social media monitoring

🧠 Personal branding & thought leadership tracking

🏢 Company page activity monitoring

📈 Engagement trend analysis

🕵️ Competitive content intelligence

🧾 Archiving LinkedIn posts

🤖 Feed data for CRM, dashboards, or AI analysis


### Outputs

```json
{
  "posted": "2024-03-11 07:00:12",
  "videos": [],
  "document": {},
  "article": {},
  "likes": 310,
  "shares": 3,
  "comments": 36,
  "ref": "https://www.linkedin.com/posts/sebastien-couasnon_podcast-fintech-tech45-activity-7172848771716763648-5JxH?utm_source=share&utm_medium=member_desktop",
  "content": "Jai un infini respect pour les entrepreneurs qui prennent le temps de bien faire les choses.\n\n\nJean-Daniel a d�j� eu un 1er succ�s ph�nom�nal il y a quelques ann�es en cr�ant, d�veloppant puis revendant Captain Train \n\nDans la foul�e de son exit (en vrai, les 2 projets se sont chevauch�s) il sest relanc� dans un tout autre domaine. L� encore, personne ne lattendait. A nouveau, il y avait de jolies barri�res � lentr�e.\n\nBrique par brique, il a d�velopp� une banque, une vraie banque. Il a ainsi obtenu le 1er agr�ment depuis les ann�es 70 ! Et �a lui a pris 3 ans \n\nMoi aussi, jai pris le temps de faire cet �pisode, et je nai pas �t� d��u.\nA �couter ici  https://audmns.com/zsypCML \n\nH�te davoir votre feed-back�!\n\nJean Marc Nicolas Matthieu Jordane #podcast #fintech #tech45",
  "company": "Sébastien Couasnon",
  "company_linkedin": "https://www.linkedin.com/in/sebastien-couasnon",
  "followers": "",
  "images": [
    [
      {
        "width": 1080,
        "height": 1080,
        "expiresAt": "15-01-2026",
        "url": "https://media.licdn.com/dms/image/v2/D4E22AQFHM-x_L_ES9g/feedshare-shrink_2048_1536/feedshare-shrink_2048_1536/0/1710107392308?e=1768435200&v=beta&t=mp5495J9WNdSAobg4LnMcu3LDSs-15HyH4sQ7CTX_AM"
      },
      {
        "width": 20,
        "height": 20,
        "expiresAt": "15-01-2026",
        "url": "https://media.licdn.com/dms/image/v2/D4E22AQFHM-x_L_ES9g/feedshare-shrink_20/feedshare-shrink_20/0/1710107392306?e=1768435200&v=beta&t=QFGVd3hH0CdHme_UHUKRC9dQcMVipXQznex1RbnPLXw"
      },
      {
        "width": 1080,
        "height": 1080,
        "expiresAt": "15-01-2026",
        "url": "https://media.licdn.com/dms/image/v2/D4E22AQFHM-x_L_ES9g/feedshare-shrink_1280/feedshare-shrink_1280/0/1710107392306?e=1768435200&v=beta&t=UvUui1gNMh9C2xB2d8Q9-WeDo08BGOrO1TrYEAytmnc"
      },
      {
        "width": 480,
        "height": 480,
        "expiresAt": "15-01-2026",
        "url": "https://media.licdn.com/dms/image/v2/D4E22AQFHM-x_L_ES9g/feedshare-shrink_480/feedshare-shrink_480/0/1710107392306?e=1768435200&v=beta&t=4zVgYnWeeu0iwadzk3KBly3z3S70t761U7hKikU1yn0"
      },
      {
        "width": 160,
        "height": 160,
        "expiresAt": "15-01-2026",
        "url": "https://media.licdn.com/dms/image/v2/D4E22AQFHM-x_L_ES9g/feedshare-shrink_160/feedshare-shrink_160/0/1710107392306?e=1768435200&v=beta&t=1JcIpUu7mVIHR-v9NsEdkWuAVkNpxY1BUKRPXMf-deI"
      },
      {
        "width": 800,
        "height": 800,
        "expiresAt": "15-01-2026",
        "url": "https://media.licdn.com/dms/image/v2/D4E22AQFHM-x_L_ES9g/feedshare-shrink_800/feedshare-shrink_800/0/1710107392306?e=1768435200&v=beta&t=bC_QosEAmy_MNbxFxPpKbGEfo_LYgqblQyE9hztfAhw"
      }
    ]
  ]
}
````

### SUPPORT

Create an issue and share the failed run.

We will help resolve the problem.

We also stay available for questions

# Actor input Schema

## `cookies` (type: `array`):

Provide your own exported cookie session

## `proxyConfiguration` (type: `object`):

The best option is usually Automatic proxy. But you can also use your own proxies or no proxy

## `url` (type: `array`):

url of linkedin post

## `url_search` (type: `string`):

Make sure to already filter per newest date and provide a max number of posts you want to extract when providing a search url input

## `days_since_post` (type: `integer`):

Number of days since post linkedin (usefull with /company or /in url input, but not /search)

## `max_posts` (type: `integer`):

Number of maximum posts scraped (usefull for any of 3 input /company /in /search)

## Actor input object example

```json
{
  "proxyConfiguration": {
    "useApifyProxy": false
  },
  "url": [
    "https://www.linkedin.com/posts/sebastien-couasnon_podcast-fintech-tech45-activity-7172848771716763648-5JxH?utm_source=share&utm_medium=member_desktop"
  ],
  "url_search": "https://www.linkedin.com/company/financial-times/",
  "days_since_post": 30,
  "max_posts": 0
}
```

# Actor output Schema

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

No description

# 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 = {
    "proxyConfiguration": {
        "useApifyProxy": false
    },
    "url": [
        "https://www.linkedin.com/posts/sebastien-couasnon_podcast-fintech-tech45-activity-7172848771716763648-5JxH?utm_source=share&utm_medium=member_desktop"
    ],
    "url_search": "https://www.linkedin.com/company/financial-times/"
};

// Run the Actor and wait for it to finish
const run = await client.actor("data_link_miner/linkedin-posts-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 = {
    "proxyConfiguration": { "useApifyProxy": False },
    "url": ["https://www.linkedin.com/posts/sebastien-couasnon_podcast-fintech-tech45-activity-7172848771716763648-5JxH?utm_source=share&utm_medium=member_desktop"],
    "url_search": "https://www.linkedin.com/company/financial-times/",
}

# Run the Actor and wait for it to finish
run = client.actor("data_link_miner/linkedin-posts-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 '{
  "proxyConfiguration": {
    "useApifyProxy": false
  },
  "url": [
    "https://www.linkedin.com/posts/sebastien-couasnon_podcast-fintech-tech45-activity-7172848771716763648-5JxH?utm_source=share&utm_medium=member_desktop"
  ],
  "url_search": "https://www.linkedin.com/company/financial-times/"
}' |
apify call data_link_miner/linkedin-posts-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Linkedin Posts Scraper",
        "description": "Extract posts, engagement metrics, and media from LinkedIn profiles & company pages. This actor allows you to scrape LinkedIn posts from personal profiles or company pages.",
        "version": "0.0",
        "x-build-id": "OdN3hV561I2Cz1FXB"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/data_link_miner~linkedin-posts-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-data_link_miner-linkedin-posts-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/data_link_miner~linkedin-posts-scraper/runs": {
            "post": {
                "operationId": "runs-sync-data_link_miner-linkedin-posts-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/data_link_miner~linkedin-posts-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-data_link_miner-linkedin-posts-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": [
                    "cookies"
                ],
                "properties": {
                    "cookies": {
                        "title": "Linkedin session cookies (remove default value [] before pasting)",
                        "type": "array",
                        "description": "Provide your own exported cookie session"
                    },
                    "proxyConfiguration": {
                        "title": "Proxy configuration",
                        "type": "object",
                        "description": "The best option is usually Automatic proxy. But you can also use your own proxies or no proxy"
                    },
                    "url": {
                        "title": "Posts urls",
                        "type": "array",
                        "description": "url of linkedin post",
                        "items": {
                            "type": "string"
                        }
                    },
                    "url_search": {
                        "title": "Url link (can be /company, /in, /search)",
                        "type": "string",
                        "description": "Make sure to already filter per newest date and provide a max number of posts you want to extract when providing a search url input"
                    },
                    "days_since_post": {
                        "title": "Maximum of days since post",
                        "minimum": 1,
                        "type": "integer",
                        "description": "Number of days since post linkedin (usefull with /company or /in url input, but not /search)",
                        "default": 30
                    },
                    "max_posts": {
                        "title": "Max number Posts Scraped (takes priority on Max days since post)",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Number of maximum posts scraped (usefull for any of 3 input /company /in /search)",
                        "default": 0
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
