# Profile Posts Scraper for LinkedIn \[No Cookies] (`apimaestro/linkedin-profile-posts`) Actor

Scrape LinkedIn posts data for a given LinkedIn profile including post content, reactions, comments count, and media attachments

- **URL**: https://apify.com/apimaestro/linkedin-profile-posts.md
- **Developed by:** [API Maestro](https://apify.com/apimaestro) (community)
- **Categories:** Social media, Lead generation, Automation
- **Stats:** 19,028 total users, 2,036 monthly users, 97.9% runs succeeded, 639 bookmarks
- **User rating**: 4.76 out of 5 stars

## Pricing

$5.00 / 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.

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

### 🚀 Scrape LinkedIn Posts Data in Seconds

The Best linkedin scraper to get recent posts related data for any given LinkedIn profile. Get comprehensive data including post content, reactions, comments count, and media attachments...

#### For other LinkedIn actors, check: https://apify.com/apimaestro

### ✨ Key Features

- No account needed:  Don't risk your account security by sharing your cookies and don't get your account restricted or banned!
- Recent posts and activity
- Post content and media
- Reaction counts by type (likes, comments, etc.)
- Post URLs for sharing
- Author details
- Media attachments (images, articles, etc.)
- Pagination support for older posts

### 🔧 Simple Usage

Simply provide a LinkedIn profile URL or username to get their recent posts and activity. The username is the last part of a LinkedIn profile URL (e.g., 'satyanadella' from linkedin.com/in/satyanadella).


### Advanced: Pagination Support

### Manual Pagination

Each run returns up to 100 posts per page. 

For accessing older posts:
1. Make first run with `page_number = 1` and get first 100 results
2. Get `pagination_token` from run output of page 1
3. Make second run with that `pagination_token` and `page_number = 2` to get next 100 results
4. For next 100 results, do the same by using `pagination_token` from second run output

### Automatic Pagination

Simply set the total number of posts you want the actor to scrape on `Total Posts to Scrape` field.

### 📊 Output Structure


```json
{
  "success": true,
  "message": "response retrieved successfully",
  "data": {
    "posts": [
      {
        "urn": "7123456789012345678",
        "full_urn": "urn:li:ugcPost:7123456789012345678",
        "posted_at": {
          "date": "2025-05-15 14:30:20",
          "relative": "2 days ago • Visible to anyone on or off LinkedIn",
          "timestamp": 1745678901234
        },
        "text": "Sample post text content. This is where the LinkedIn post text appears.",
        "url": "https://www.linkedin.com/posts/username_sample-activity-7123456789012345678-AbCd",
        "post_type": "regular",
        "author": {
          "first_name": "John",
          "last_name": "Doe",
          "headline": "CEO at Example Company",
          "username": "johndoe",
          "profile_url": "https://www.linkedin.com/in/johndoe",
          "profile_picture": "https://media.licdn.com/dms/image/profile-pic.jpg"
        },
        "stats": {
          "total_reactions": 123,
          "like": 100,
          "support": 5,
          "love": 10,
          "insight": 3,
          "celebrate": 5,
          "comments": 15,
          "reposts": 7
        },
        "media": {
          "type": "image",
          "url": "https://media.licdn.com/dms/image/sample-image.jpg",
          "thumbnail": "https://media.licdn.com/dms/image/sample-thumbnail.jpg"
        }
      },
      {
        "urn": "7123456789987654321",
        "full_urn": "urn:li:ugcPost:7123456789987654321",
        "posted_at": {
          "date": "2025-05-14 10:15:30",
          "relative": "3 days ago • Visible to anyone on or off LinkedIn",
          "timestamp": 1745578901234
        },
        "text": "This is a reshared post with a quote added by the user.",
        "url": "https://www.linkedin.com/posts/username_example-activity-7123456789987654321-XyZw",
        "post_type": "quote",
        "author": {
          "first_name": "John",
          "last_name": "Doe",
          "headline": "CEO at Example Company",
          "username": "johndoe",
          "profile_url": "https://www.linkedin.com/in/johndoe",
          "profile_picture": "https://media.licdn.com/dms/image/profile-pic.jpg"
        },
        "stats": {
          "total_reactions": 45,
          "like": 40,
          "support": 0,
          "love": 3,
          "insight": 1,
          "celebrate": 1,
          "comments": 5,
          "reposts": 2
        },
        "reshared_post": {
          "urn": "7123456788888888888",
          "posted_at": {
            "date": "2025-05-13 09:30:00",
            "relative": "4 days ago • Visible to anyone on or off LinkedIn",
            "timestamp": 1745488901234
          },
          "text": "Original post that was reshared.",
          "url": "https://www.linkedin.com/posts/janedoe_example-activity-7123456788888888888-AbCd",
          "post_type": "regular",
          "author": {
            "first_name": "Jane",
            "last_name": "Doe",
            "headline": "Product Manager at Example Corp",
            "username": "janedoe",
            "profile_url": "https://www.linkedin.com/in/janedoe",
            "profile_picture": "https://media.licdn.com/dms/image/jane-profile-pic.jpg"
          },
          "stats": {
            "total_reactions": 250,
            "like": 200,
            "support": 10,
            "love": 25,
            "insight": 5,
            "celebrate": 10,
            "comments": 30,
            "reposts": 15
          },
          "media": {
            "type": "video",
            "url": "https://dms.licdn.com/playlist/sample-video.mp4",
            "thumbnail": "https://media.licdn.com/dms/image/video-thumbnail.jpg"
          }
        }
      },
      {
        "urn": "7123456777777777777",
        "full_urn": "urn:li:activity:7123456777777777777",
        "posted_at": {
          "date": "2025-05-12 16:45:30",
          "relative": "5 days ago • Visible to anyone on or off LinkedIn",
          "timestamp": 1745398901234
        },
        "text": "Sharing an interesting article I found.",
        "url": "https://www.linkedin.com/posts/johndoe_article-activity-7123456777777777777-LmNo",
        "post_type": "regular",
        "author": {
          "first_name": "John",
          "last_name": "Doe",
          "headline": "CEO at Example Company",
          "username": "johndoe",
          "profile_url": "https://www.linkedin.com/in/johndoe",
          "profile_picture": "https://media.licdn.com/dms/image/profile-pic.jpg"
        },
        "stats": {
          "total_reactions": 85,
          "like": 70,
          "support": 0,
          "love": 5,
          "insight": 10,
          "celebrate": 0,
          "comments": 12,
          "reposts": 8
        },
        "article": {
          "url": "https://example.com/sample-article",
          "title": "Sample Article Title",
          "subtitle": "example.com",
          "thumbnail": "https://media.licdn.com/dms/image/article-thumbnail.jpg"
        }
      },
      {
        "urn": "7123456666666666666",
        "full_urn": "urn:li:ugcPost:7123456666666666666",
        "posted_at": {
          "date": "2025-05-10 11:20:15",
          "relative": "1 week ago • Visible to anyone on or off LinkedIn",
          "timestamp": 1745218901234
        },
        "text": "Sharing this important document with my network.",
        "url": "https://www.linkedin.com/posts/johndoe_document-activity-7123456666666666666-PqRs",
        "post_type": "regular",
        "author": {
          "first_name": "John",
          "last_name": "Doe",
          "headline": "CEO at Example Company",
          "username": "johndoe",
          "profile_url": "https://www.linkedin.com/in/johndoe",
          "profile_picture": "https://media.licdn.com/dms/image/profile-pic.jpg"
        },
        "stats": {
          "total_reactions": 32,
          "like": 28,
          "support": 0,
          "love": 2,
          "insight": 2,
          "celebrate": 0,
          "comments": 5,
          "reposts": 3
        },
        "document": {
          "title": "Sample Document Title",
          "page_count": 12,
          "url": "https://media.licdn.com/dms/document/sample-document.pdf",
          "thumbnail": "https://media.licdn.com/dms/image/document-thumbnail.jpg"
        }
      },
      {
        "urn": "7123455555555555555",
        "full_urn": "urn:li:ugcPost:7123455555555555555",
        "posted_at": {
          "date": "2025-05-05 09:15:00",
          "relative": "2 weeks ago • Visible to anyone on or off LinkedIn",
          "timestamp": 1744778901234
        },
        "text": "Check out these photos from our recent company event!",
        "url": "https://www.linkedin.com/posts/johndoe_event-activity-7123455555555555555-TuVw",
        "post_type": "regular",
        "author": {
          "first_name": "John",
          "last_name": "Doe",
          "headline": "CEO at Example Company",
          "username": "johndoe",
          "profile_url": "https://www.linkedin.com/in/johndoe",
          "profile_picture": "https://media.licdn.com/dms/image/profile-pic.jpg"
        },
        "stats": {
          "total_reactions": 145,
          "like": 120,
          "support": 0,
          "love": 20,
          "insight": 0,
          "celebrate": 5,
          "comments": 18,
          "reposts": 7
        },
        "media": {
          "type": "images",
          "url": "https://media.licdn.com/dms/image/main-image.jpg",
          "images": [
            {
              "url": "https://media.licdn.com/dms/image/image1.jpg",
              "width": 1280,
              "height": 853
            },
            {
              "url": "https://media.licdn.com/dms/image/image2.jpg",
              "width": 1280,
              "height": 853
            },
            {
              "url": "https://media.licdn.com/dms/image/image3.jpg",
              "width": 1280,
              "height": 853
            }
          ]
        }
      }
    ],
    "pagination_token": "dXJuOmxpOmFjdGl2aXR5Ojc1MjM0NTU1NTU1NTU1NTU1NTUtMTc0NDc3ODkwMTIzNA=="
  }
}
````

<br>

***

**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

## `username` (type: `string`):

LinkedIn profile username (e.g., 'satyanadella' or  'linkedin.com/in/satyanadella')

## `page_number` (type: `integer`):

Page number for pagination (first page returns a pagination token for subsequent pages)

## `pagination_token` (type: `string`):

Token from previous page response for paginated requests (optional, only needed for pages after first). For example, to get result from page 2, use pagination token from response of page 1

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

Optional: Limit the number of results per page (1-100)

## `total_posts` (type: `integer`):

Enable automatic pagination: Set the total number of posts to scrape. This will override manual pagination settings.

## Actor input object example

```json
{
  "username": "satyanadella",
  "page_number": 1,
  "limit": 100
}
```

# 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("apimaestro/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 = {}

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

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Profile Posts Scraper for LinkedIn [No Cookies]",
        "description": "Scrape LinkedIn posts data for a given LinkedIn profile including post content, reactions, comments count, and media attachments",
        "version": "0.1",
        "x-build-id": "twclqBiGsSb6DoFcS"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/apimaestro~linkedin-profile-posts/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-apimaestro-linkedin-profile-posts",
                "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/apimaestro~linkedin-profile-posts/runs": {
            "post": {
                "operationId": "runs-sync-apimaestro-linkedin-profile-posts",
                "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/apimaestro~linkedin-profile-posts/run-sync": {
            "post": {
                "operationId": "run-sync-apimaestro-linkedin-profile-posts",
                "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": [
                    "username"
                ],
                "properties": {
                    "username": {
                        "title": "Profile Username or Url",
                        "type": "string",
                        "description": "LinkedIn profile username (e.g., 'satyanadella' or  'linkedin.com/in/satyanadella')",
                        "default": "satyanadella"
                    },
                    "page_number": {
                        "title": "Page Number",
                        "minimum": 1,
                        "type": "integer",
                        "description": "Page number for pagination (first page returns a pagination token for subsequent pages)",
                        "default": 1
                    },
                    "pagination_token": {
                        "title": "Pagination Token",
                        "type": "string",
                        "description": "Token from previous page response for paginated requests (optional, only needed for pages after first). For example, to get result from page 2, use pagination token from response of page 1"
                    },
                    "limit": {
                        "title": "Result limit",
                        "minimum": 1,
                        "maximum": 100,
                        "type": "integer",
                        "description": "Optional: Limit the number of results per page (1-100)",
                        "default": 100
                    },
                    "total_posts": {
                        "title": "Total Posts to Scrape (if set, it will override manual pagination settings)",
                        "minimum": 1,
                        "maximum": 10000,
                        "type": "integer",
                        "description": "Enable automatic pagination: Set the total number of posts to scrape. This will override manual pagination settings."
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
