AI Linkedin Post Scraper avatar

AI Linkedin Post Scraper

Pricing

from $0.01 / 1,000 results

Go to Apify Store
AI Linkedin Post Scraper

AI Linkedin Post Scraper

Scrape viral/trending LinkedIn posts by hashtag or keyword search. Perfect for finding content inspiration and building a library of top-performing posts in your niche. Get top posts from any LinkedIn hashtag. Find posts matching specific keywords. Output formatted for AI voice analysis

Pricing

from $0.01 / 1,000 results

Rating

0.0

(0)

Developer

The Howlers

The Howlers

Maintained by Community

Actor stats

3

Bookmarked

87

Total users

18

Monthly active users

3 days ago

Last modified

Share

LinkedIn Post Scraper — Viral Content, Trending Topics & Voice Training

Scrape viral LinkedIn posts by hashtag, keyword, or profile. Find top-performing content for inspiration, voice training, and competitive research. 6 search modes, optional AI sentiment analysis, comment scraping, and reaction breakdowns. Uses Camoufox stealth browser with residential proxies.

Before You Start (Read This First)

StepWhat to DoWhy
1Click Start with default settingsSee sample output (free, no setup needed)
2Pick your search modeSee decision tree below
3Set up authentication if neededSome modes require cookies or API tokens

Demo Mode is ON by default. Your first run returns realistic sample data so you can preview the output format before setting up authentication. No charges, no cookies, no setup.

Which Mode Should I Use?

Do you have LinkedIn cookies or an OAuth token?
├── NO → Use "auto" or "google_search" mode (no auth needed)
│ ├── Want posts from a specific person? → google_search + profileUsername
│ └── Want posts from hashtags/topics? → auto + hashtags
└── YES → You have full access to all modes
├── Want posts from a specific person? → profile + profileUrl
├── Want posts from a hashtag? → hashtag + hashtags
├── Want posts by keyword search? → keyword + keywords
└── Want your own feed? → feed
ModeWhat It DoesAuth Required?Best For
autoCombines multiple methods automaticallyNoMost users — start here
google_searchFinds LinkedIn posts indexed by GoogleNoFinding a specific person's posts without cookies
profileScrapes a specific person's post historyYes (cookies or OAuth)Voice training, competitor deep-dive
hashtagGets posts from specific hashtagsYes (cookies)Trend research, content inspiration
keywordSearches posts by keywordYes (cookies)Topic research
feedScrapes your personal LinkedIn feedYes (cookies)Feed analysis

If you're not sure, use auto mode. It works without cookies and tries 5 different methods automatically.

Quick Start Examples

1. Demo Mode (Free, Zero Setup)

{
"demoMode": true
}

Returns sample viral posts so you can test your integration. No charges, no cookies, no API keys.

2. Auto Mode — No Cookies Needed

{
"searchType": "auto",
"hashtags": ["marketing", "leadership"],
"maxPostsPerSource": 20,
"demoMode": false
}

Uses residential proxies and multiple scraping methods. Best starting point for real scraping.

3. Google Search Mode — Find Anyone's Posts

{
"searchType": "google_search",
"profileUsername": "garyvee",
"maxPostsPerSource": 20,
"demoMode": false
}

Finds LinkedIn posts indexed by Google. No cookies needed. Good for researching specific creators.

4. Profile Scraping — Full Post History

{
"searchType": "profile",
"profileUrl": "https://www.linkedin.com/in/garyvee/",
"cookies": "[paste your cookies here — see auth section below]",
"maxPostsPerSource": 50,
"activityTypes": ["posts", "articles"],
"demoMode": false
}

Scrapes a person's full post history including articles and comments. Requires authentication.

{
"searchType": "hashtag",
"hashtags": ["marketing", "AI", "leadership"],
"cookies": "[paste your cookies here]",
"maxPostsPerSource": 20,
"minLikes": 50,
"sortBy": "top",
"demoMode": false
}

6. With AI Sentiment Analysis

{
"searchType": "auto",
"hashtags": ["leadership"],
"maxPostsPerSource": 10,
"enableSentimentAnalysis": true,
"aiProvider": "anthropic",
"aiApiKey": "sk-ant-...",
"demoMode": false
}

Each post gets tone analysis, emotional triggers, persuasion techniques, and target emotions. Works with OpenAI, Anthropic, Google, Mistral, or Cohere.

7. With Webhook Delivery

{
"searchType": "auto",
"hashtags": ["startup"],
"maxPostsPerSource": 20,
"webhookUrl": "https://hooks.zapier.com/hooks/catch/123456/abcdef/",
"webhookPlatform": "zapier",
"demoMode": false
}

How to Get LinkedIn Cookies (When Required)

Only needed for profile, hashtag, keyword, and feed modes. Skip this if using auto or google_search.

Step-by-Step:

  1. Install a cookie export extension in Chrome:
  2. Log into LinkedIn in your browser
  3. Click the cookie extension icon while on linkedin.com
  4. Click "Export" — this copies a JSON array to your clipboard
  5. Paste the JSON into the cookies field in this actor

The exported cookies should look like this:

[
{"name": "li_at", "value": "AQED...", "domain": ".linkedin.com", ...},
{"name": "JSESSIONID", "value": "ajax:123...", "domain": ".linkedin.com", ...}
]
  • Cookies expire after a few days — you'll need to re-export them
  • Cookies are IP-locked — they may not work from Apify's servers. Use auto mode instead, or try residential proxies
  • "Redirected to login" error means cookies are expired. Re-export from your browser
  • The actor validates your cookies before scraping and will tell you if they're expired

Alternative: LinkedIn OAuth Token (Most Reliable)

If you have a LinkedIn Developer App with w_member_social permission:

{
"searchType": "profile",
"profileUrl": "https://www.linkedin.com/in/username/",
"linkedinAccessToken": "your-oauth-token-here",
"demoMode": false
}

OAuth tokens work from any IP and don't expire as quickly as cookies. This is the most reliable authentication method.

Instead of manually exporting cookies, use the Cookie Manager actor to capture and store cookies automatically.

Run the Cookie Manager actor with:

  • Mode: capture
  • Platform: linkedin
  • Storage Key: linkedin-yourname

Step 2: Use the stored cookies

In this actor, just set cookieStorageKey to the same key:

{
"searchType": "profile",
"profileUrl": "https://www.linkedin.com/in/someone/",
"cookieStorageKey": "linkedin-yourname",
"demoMode": false
}

No manual cookie paste needed. Schedule Cookie Manager to run every 3 days to keep cookies fresh.

How it works

  1. Cookie Manager logs into LinkedIn and saves session cookies to a named Key-Value Store (cookie-sessions by default)
  2. This actor reads cookies from that store using your cookieStorageKey
  3. If the Cookie Manager key has no cookies or the store doesn't exist, the actor falls back to any manually provided cookies or cookie-free modes

Custom store name

If you changed the Key-Value Store name in Cookie Manager, pass it here too:

{
"searchType": "profile",
"profileUrl": "https://www.linkedin.com/in/someone/",
"cookieStorageKey": "linkedin-yourname",
"cookieKvStoreName": "my-custom-store",
"demoMode": false
}

All Input Parameters

Search Settings

ParameterTypeDefaultDescription
demoModebooleantrueReturns sample data. Uncheck for real scraping.
searchTypestringautoHow to find posts: auto, google_search, profile, hashtag, keyword, feed
profileUrlstringLinkedIn profile URL (for profile mode)
profileUsernamestringLinkedIn username e.g. "garyvee" (for google_search mode)
hashtagsstring[]Hashtags to search (for hashtag and auto modes)
keywordsstring[]Keywords to search (for keyword mode)

Authentication (only for modes that require it)

ParameterTypeDescription
cookiesstringLinkedIn cookies as JSON array (see instructions above)
cookieStorageKeystringStorage key from Cookie Manager actor (e.g., linkedin-john). Loads cookies automatically
cookieKvStoreNamestringKV Store name used by Cookie Manager. Default: cookie-sessions
linkedinEmailstringLinkedIn email for auto-login (alternative to cookies)
linkedinPasswordstringLinkedIn password for auto-login
linkedinAccessTokenstringOAuth 2.0 token (most reliable method)
linkedinClientIdstringClient ID from LinkedIn Developer App (for OAuth flow)
linkedinClientSecretstringClient Secret from LinkedIn Developer App (for OAuth flow)

Filtering & Limits

ParameterTypeDefaultDescription
maxPostsPerSourcenumber50Max posts to scrape per hashtag/keyword
minLikesnumber100Only include posts with at least this many likes
minCommentsnumber10Only include posts with at least this many comments
sortBystringtoptop (most engagement) or recent (newest first)
timeFilterstringpast_weekpast_24h, past_week, past_month, or any
activityTypesstring[]["posts"]What to scrape: posts, articles, comments, or all

Enhanced Data (Optional)

ParameterTypeDefaultDescription
includeAuthorInfobooleantrueInclude author's followers, headline, profile picture
includeCommentTextbooleanfalseScrape actual comment text (slower, more data)
maxCommentsPerPostnumber10Max comments per post when comment scraping is on (1-50)
includeReactionsBreakdownbooleanfalseGet breakdown by reaction type (like, celebrate, support, love, insightful, funny)

AI Sentiment Analysis (Optional, Bring Your Own Key)

ParameterTypeDefaultDescription
enableSentimentAnalysisbooleanfalseAnalyze tone, emotions, and persuasion techniques with AI
aiProviderstringnoneopenai, anthropic, google, mistral, or cohere
aiApiKeystringYour AI provider API key (you pay the AI provider directly)
aiModelstringOverride the default model for your provider (optional)

Webhook Integration

ParameterTypeDefaultDescription
webhookUrlstringURL to POST results when scraping completes
webhookPlatformstringcustomzapier, make, n8n, or custom — formats payload for each platform
webhookHeadersobjectCustom headers to include in webhook request

Output Format

Each run produces an array of posts plus aggregate statistics:

{
"id": "7281234567890123456",
"url": "https://www.linkedin.com/feed/update/urn:li:activity:7281234567890123456",
"text": "🚀 The #1 lesson I learned after 10 years in tech:\n\nIt's not about the code...",
"likes": 15234,
"comments": 892,
"reposts": 345,
"postedAt": "2026-01-15T10:00:00.000Z",
"source": "marketing",
"hashtags": ["leadership", "growth", "marketing"],
"contentType": "text",
"hasImage": false,
"hasVideo": false,
"hasCarousel": false,
"hasDocument": false,
"hasPoll": false,
"activityType": "post",
"author": {
"name": "Sarah Chen",
"headline": "CEO at TechStartup | Forbes 30 Under 30",
"profileUrl": "https://www.linkedin.com/in/sarahchen/",
"followers": 125000,
"profilePicUrl": "https://media.licdn.com/..."
},
"commentsList": [
{
"author": "John Doe",
"authorHeadline": "VP Marketing",
"text": "This is so true! The soft skills matter more than the hard skills.",
"likes": 45,
"timestamp": "2 hours ago"
}
],
"reactionsBreakdown": {
"total": 15234,
"like": 8500,
"celebrate": 3200,
"support": 1800,
"love": 1200,
"insightful": 400,
"funny": 134
},
"sentiment": {
"score": 0.85,
"label": "positive",
"confidence": 0.92,
"summary": "Inspirational tech leadership post with personal storytelling",
"tone": "inspirational",
"emotionalTriggers": ["aspiration", "curiosity", "social_proof"],
"persuasionTechniques": ["storytelling", "authority", "vulnerability"],
"targetEmotions": ["inspired", "motivated", "curious"]
}
}

Stats Object (included in every run)

{
"totalPosts": 150,
"avgLikes": 523,
"avgComments": 45,
"avgReposts": 28,
"topAuthors": [
{ "name": "Sarah Chen", "postCount": 8, "avgLikes": 12500 }
],
"topHashtags": [
{ "tag": "leadership", "count": 45 }
],
"contentTypeBreakdown": {
"text": 65,
"image": 42,
"carousel": 23,
"video": 15,
"document": 5
}
}

Pricing (Pay-Per-Event)

EventDescriptionPrice
post_scrapedPer LinkedIn post scraped$0.04

Example costs:

  • 20 posts: $0.80
  • 50 posts: $2.00
  • 100 posts with author info: $4.00
  • Demo mode: $0.00

Comments, reactions breakdown, and author info are included in the per-post price (no extra charge). AI sentiment analysis uses your own API key — you pay the AI provider directly.

Use Cases

Content Inspiration

Find what's working in your niche before writing. See which hooks, formats, and topics get the most engagement.

Voice Training / AI Writing

Collect writing samples from specific creators to train AI content generators. Use profile mode with activityTypes: ["posts", "articles"].

Trend Research

Track trending topics and content formats across hashtags. Compare engagement across different themes.

Competitor Analysis

See what content performs best for competitors. Analyze their posting cadence, content types, and engagement patterns.

Influencer Research

Analyze top creators' content strategies. Compare engagement rates, content types, and audience reactions.

Lead Generation

Find decision makers who engage with specific topics. Enable includeCommentText to see who's commenting on relevant posts.

Content Calendar Planning

Analyze timeDistribution in stats to find optimal posting times. Study which content types work best on which days.

Troubleshooting

"I'm getting sample/demo data"

Demo Mode is ON by default. Uncheck Demo Mode (set demoMode: false) to scrape real posts. You may also need to provide cookies or use auto/google_search mode.

"Redirected to login" or "auth wall" error

Your cookies are expired or IP-locked. Options:

  1. Re-export cookies from your browser (log into LinkedIn first)
  2. Switch to auto mode — works without cookies
  3. Use an OAuth token instead of cookies (most reliable)

"No posts found"

  • Check your hashtag/keyword spelling (no # symbol needed)
  • Try a more popular hashtag like marketing or leadership
  • Lower minLikes to 0 to see all posts
  • Try timeFilter: "past_month" for a wider time range
  • Try sortBy: "recent" instead of "top"

LinkedIn sessions expire every few days. Re-export your cookies from your browser. The actor validates cookies before scraping and will tell you exactly what's wrong.

Actor runs but returns few posts

LinkedIn limits how many posts you can see. For better results:

  • Use auto mode (tries 5 different scraping methods)
  • Use google_search mode (no cookie dependency)
  • Lower minLikes and minComments thresholds
  • Set timeFilter: "any" for maximum results

"LinkedIn cookies are required"

You're using hashtag, keyword, or feed mode which requires authentication. Either:

  • Switch to auto or google_search mode (no cookies needed)
  • Follow the cookie export instructions above
  • Provide linkedinAccessToken for OAuth-based access

AI Sentiment not working

  • Make sure enableSentimentAnalysis is true
  • Provide a valid aiApiKey for your chosen aiProvider
  • Supported providers: openai, anthropic, google, mistral, cohere

Technical Details

  • Browser: Camoufox stealth browser (C++ level fingerprinting) with standard browser fallback
  • Crawler: Crawlee PlaywrightCrawler with automatic retries
  • Proxy: Apify residential proxies for anti-detection
  • Rate Limiting: Human-like delays between actions (50-100ms typing, 1.5-2s scrolling, random mouse movements)
  • Authentication: 5 methods in priority order — OAuth token → session-based proxy login → Voyager API → browser scraping → Google search fallback
  • Cookie Validation: Validates cookies before scraping, provides clear error messages if expired
  • Session Management: Sticky IP sessions for cookie-based scraping (same proxy IP for entire session)
  • Memory: 4 GB default
  • Timeout: 5 minutes default, recommended 10 minutes for large scrapes (100+ posts)

FAQ

Q: Do I need a LinkedIn Premium account?

A: No. The actor works with a free LinkedIn account. Premium may give access to more posts in search results, but it's not required.

Q: How often do cookies expire?

A: LinkedIn cookies typically last 2-7 days. If you see "redirected to login" errors, re-export your cookies. For a more stable solution, use OAuth tokens or auto mode.

Q: Can I scrape posts from any LinkedIn profile?

A: You can scrape public profiles without authentication using google_search mode. For private profiles or full post history, you need cookies or an OAuth token.

Q: Will this get my LinkedIn account banned?

A: The actor uses residential proxies, human-like delays, and stealth browser technology to minimize detection risk. However, scraping large volumes (1000+ posts) from a single account may trigger LinkedIn's rate limits. Use reasonable limits and multiple search sources.

Q: Can I schedule recurring runs?

A: Yes. Use Apify's built-in scheduling to run daily, weekly, or at custom intervals. Combine with webhooks to auto-deliver results to your CRM, spreadsheet, or automation tool.

Q: How accurate is the sentiment analysis?

A: Sentiment analysis quality depends on your AI provider. Claude (Anthropic) and GPT-4 (OpenAI) produce the best results. The analysis includes emotional triggers, persuasion techniques, and target emotions — inspired by the Foreplay ad analysis framework.


Support


Built by John Rippy | Actor Arsenal