LinkedIn Posts Scraper

Extract public LinkedIn posts from direct post URLs and activity URNs with optional media and nested top-level comment previews.

Data fields

FieldTypeDescription
postIdstringValue exported as postId.
activityUrnstringValue exported as activityUrn.
postUrlstringValue exported as postUrl.
canonicalUrlstringValue exported as canonicalUrl.
postTypestringValue exported as postType.
textstringValue exported as text.
textHtmlstringValue exported as textHtml.
headlinestringValue exported as headline.

Input preview

postUrlsPost URLs
postUrnsActivity URNs
maxPostsMaximum posts
includeMediaInclude media
includeCommentsPreviewInclude comments preview
maxPreviewCommentsMaximum preview comments

API and agents

This actor can be run through Apify API, datasets, webhooks, schedules, and the official Apify MCP server.

How this actor works

See example inputs, outputs, API usage, and practical limits before running this actor on Apify.

Open Apify page

Use this LinkedIn post scraper to export structured public posts from known post URLs or activity URNs. Receive exactly one normalized row per unique post with stable identity, author attribution, text, timestamps, media, links, and engagement.

Use this Actor for content analysis, campaign reporting, employer-brand monitoring, social-selling research, and content tracking. Enable the optional bounded top-level comments preview when a lightweight sample is enough; use the separate LinkedIn Post Comments Scraper for deep comments, replies, and pagination.

Who is it for?

This Actor is built for marketing analysts, employer-brand teams, sales researchers, content operations teams, and developers who already have public LinkedIn post URLs and need structured records for reporting, monitoring, or integrations.

Example input

{
  "postUrls": [
    "https://www.linkedin.com/posts/linkedin_no-is-a-complete-sentence-activity-7247998907798978560-J_hB",
    "https://www.linkedin.com/posts/williamhgates_africa-decade-long-study-reveals-key-drivers-activity-7283949043293003776--eae"
  ],
  "postUrns": [],
  "maxPosts": 2,
  "includeMedia": true
}

Example output

{
  "postId": "7283949043293003776",
  "activityUrn": "urn:li:activity:7283949043293003776",
  "postUrl": "https://www.linkedin.com/posts/williamhgates_africa-decade-long-study-reveals-key-drivers-activity-7283949043293003776--eae",
  "canonicalUrl": "https://www.linkedin.com/posts/williamhgates_africa-decade-long-study-reveals-key-drivers-activity-7283949043293003776--eae",
  "postType": "article",
  "text": "Effective public health is about more than just the ‘what’—it’s about the ‘how.’ …",
  "textHtml": "Effective public health is about more than just the ‘what’…",
  "headline": "Effective public health is about more than just the ‘what’…",
  "publishedAt": "2025-01-11T20:53:01.122Z",
  "authorName": "Bill Gates",
  "authorUrl": "https://www.linkedin.com/in/williamhgates",
  "authorType": "Person",
  "authorImageUrl": "https://media.licdn.com/dms/image/...",
  "authorFollowerCount": 40561994,
  "authorHeadline": null,
  "images": [{ "url": "https://media.licdn.com/dms/image/...", "type": "image" }],
  "videos": [],
  "document": null,
  "article": { "title": "Africa: Decade-Long Study Reveals Key Drivers of Global Health Success", "url": null, "imageUrl": "https://media.licdn.com/dms/image/..." },
  "poll": null,
  "outboundLinks": [],
  "hashtags": [],
  "mentions": [{ "name": "Nadia Akseer", "url": "https://ca.linkedin.com/in/nadia-akseer-b897aa30" }],
  "taggedCompanies": [{ "name": "Exemplars in Global Health", "url": "https://www.linkedin.com/company/exemplars-in-global-health" }],
  "likeCount": 1706,
  "commentCount": 318,
  "repostCount": null,
  "reactionBreakdown": { "total": 1706 },
  "isRepost": false,
  "repost": null,
  "sourceInput": "https://www.linkedin.com/posts/...",
  "commentsPreview": [],
  "sourceStatus": "complete",
  "collectedAt": "2026-08-10T12:22:56.754Z"
}

What data can you export?

Field Description
postId Stable numeric LinkedIn activity ID
activityUrn Normalized urn:li:activity value
postUrl, canonicalUrl Public and canonical post URLs
postType Normalized post or attachment type
text, textHtml, headline Public post content and linked markup
publishedAt Public post publication timestamp
authorName, authorUrl, authorType Person or organization attribution
authorImageUrl, authorFollowerCount, authorHeadline Public author metadata when exposed
images, videos Public media metadata
document, article, poll Structured attachment metadata when present
outboundLinks Deduplicated non-identity links exposed by the post
hashtags Hashtags found in public post text
mentions, taggedCompanies Explicitly linked people and organizations
likeCount, commentCount, repostCount Public engagement totals when exposed
reactionBreakdown Public aggregate/reaction detail when exposed
isRepost, repost Repost state and original-post detail when exposed
sourceInput Original submitted post URL, activity URN, or numeric activity ID
commentsPreview Optional nested top-level public comment sample; never separate dataset rows
sourceStatus, collectedAt Completeness status and collection time

Optional feature fields are empty or null when a public post does not contain or expose that feature. The Actor does not invent missing values.

Input settings

Key Type Default Description
postUrls string[] one example post Public LinkedIn post, share, or feed/update URLs
postUrns string[] [] Activity URNs or numeric activity IDs
maxPosts integer 20 Maximum unique post rows across all targets, from 1 to 1000
includeMedia boolean true Include publicly exposed attachment metadata
includeCommentsPreview boolean false Nest a lightweight top-level public comments preview
maxPreviewComments integer 5 Preview cap per post, from 1 to 10; replies are not paginated

At least one post URL, activity URN, or numeric activity ID is required. Duplicate activity IDs are processed once.

Input recipes

Refresh a list of known posts

{
  "postUrls": ["https://www.linkedin.com/posts/...-activity-7247998907798978560-..."],
  "maxPosts": 10,
  "includeMedia": true
}

Resolve activity URNs

{
  "postUrns": ["urn:li:activity:7247998907798978560", "7283949043293003776"],
  "maxPosts": 2
}

Tips and limits

  • Use stable activity URLs or URNs rather than copied redirect links when possible.
  • Engagement totals are snapshots and can change between runs.
  • LinkedIn may remove, restrict, or stop publicly rendering a post. Such inputs are reported as failures rather than fabricated empty rows.
  • Only public post details are supported. Login-only, private, deleted, profile-search, comments, and reactor data are outside this Actor's scope.
  • A mixed batch preserves valid rows when another supplied post fails.

LinkedIn post API usage

curl -X POST "https://api.apify.com/v2/acts/fetch_cat~linkedin-posts-scraper/runs?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"postUrns":["urn:li:activity:7247998907798978560"],"maxPosts":1}'

JavaScript:

import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('fetch_cat/linkedin-posts-scraper').call({
  postUrls: ['https://www.linkedin.com/posts/...-activity-7247998907798978560-...'],
  maxPosts: 1,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();

Python:

import os
from apify_client import ApifyClient

client = ApifyClient(os.environ['APIFY_TOKEN'])
run = client.actor('fetch_cat/linkedin-posts-scraper').call(run_input={
    'postUrns': ['urn:li:activity:7247998907798978560'],
    'maxPosts': 1,
})
items = client.dataset(run['defaultDatasetId']).list_items().items

Use with AI agents and MCP

Connect through Apify MCP, then ask your agent to extract or refresh details for a list of public LinkedIn post URLs. Keep maxPosts small while testing a workflow.

Support

Open an issue from the Actor page with a public example URL, run ID, expected result, and what was returned. Do not include private cookies, credentials, or non-public content.

Common questions

Questions and answers reused from the canonical actor README.

What data can I export with a LinkedIn post scraper?

You can export 33 normalized fields covering post identity, author attribution, public text, publication time, media and attachment metadata, outbound links, engagement totals, and collection provenance.

Can I run LinkedIn Posts Scraper through an API, schedule, or MCP client?

Yes. Use the LinkedIn post API example above, create a recurring Actor schedule in Apify Console, or connect the Actor through Apify MCP for an AI-agent workflow.

How much does it cost to use LinkedIn Posts Scraper?

Runs charge a small start event plus one result event for each post-detail row saved. Current rates and plan discounts are always shown on the Actor's Pricing tab.

Does it require LinkedIn cookies or an account?

No. It processes details LinkedIn makes publicly visible for the supplied post.

Can it search for posts or scrape a profile or company post history?

No. This Actor resolves known public post URLs and activity URNs. Use a dedicated post-search or profile-post Actor when discovery is required.