LinkedIn Posts Scraper: Posts to Structured JSON
Scrape public LinkedIn posts into clean JSON with the Apify LinkedIn Posts API. Point it at a profile to pull that person's recent posts, or pass specific post URLs to fetch them directly. You get one flat row per post: text, hashtags, media, author, and engagement counts.
When to use this skill
- The user wants to scrape or export LinkedIn posts (to JSON, CSV, a sheet, or a database).
- They want a creator's, brand's, or competitor's recent posts.
- They want to build a dataset of posts for research, monitoring, or content ideas.
- They ask for a "LinkedIn posts scraper" or "LinkedIn posts API".
Not for: private or connection-only content, profile bio data (use the LinkedIn Profile API), or company pages (use the LinkedIn Company API).
What you get (one row per post)
postUrl, postId, postType, datePosted, title, text, hashtags, authorName, authorHeadline, authorUrl, authorFollowers, authorType, numLikes, numComments, numShares, images, videos, embeddedLinks, taggedCompanies, taggedPeople, topComments, summary. A post that cannot be collected comes back as an error row (result_type = "error") instead of failing the run.
Prerequisites
The Actor
Run it with the Apify CLI
Discover a profile's recent posts:
apify actors call "johnvc/linkedin-posts-api" -i '{"profileUrls":["https://www.linkedin.com/in/williamhgates"],"maxPostsPerProfile":20}' \
--json \
--user-agent apify-awesome-skills/apify-linkedin-posts-scraper \
2>/dev/null
Fetch specific posts by URL:
apify actors call "johnvc/linkedin-posts-api" -i '{"postUrls":["https://www.linkedin.com/feed/update/urn:li:activity:7446904645010210816"]}' \
--json \
--user-agent apify-awesome-skills/apify-linkedin-posts-scraper \
2>/dev/null
Every call carries the three flags this repo expects: --json, --user-agent apify-awesome-skills/apify-linkedin-posts-scraper, and 2>/dev/null.
Run it from Claude or another AI agent (MCP)
The Actor is MCP-ready. Add the hosted server URL:
https://mcp.apify.com/?tools=actors,docs,johnvc/linkedin-posts-api
Then ask, for example: "Use the LinkedIn Posts API to pull Bill Gates's last 20 posts and export them as JSON." MCP setup docs: https://docs.apify.com/platform/integrations/mcp
Workflow
- Pick the mode. Profile URLs for discovery (up to 25 per run), or post URLs for exact fetches (up to 1000 per run). You can pass both; supply at least one.
- Bound the volume. Set
maxPostsPerProfile (default 20, max 200), and, for a window, startDate and endDate (YYYY-MM-DD, discovery only).
- Estimate cost, then confirm with the user if the run is large. See
references/gotchas.md.
- Run the Actor and read the dataset. Deliver the rows as JSON or CSV, or hand back the dataset link.
Inputs
profileUrls (array of /in/ profile URLs, up to 25, discovery mode)
postUrls (array of post URLs, up to 1000, exact fetch)
maxPostsPerProfile (integer, default 20, max 200)
startDate / endDate (YYYY-MM-DD, discovery only)
Non-/in/ profile URLs (company or school pages) are skipped.
Cost
Billing is per post returned, so a discovery run costs roughly the number of profiles times maxPostsPerProfile. Estimate first and confirm large runs. Thresholds are in references/gotchas.md.
Troubleshooting
- Empty profile: you get an error row (
result_type "error", error_type "CollectionError"), not a failed run. Skip it; the rest of the batch still returns.
- Wrong URL type: only
/in/ profile URLs discover posts; company or school URLs are skipped.
- Over a limit: keep profiles at 25 or fewer and post URLs at 1000 or fewer per run; split larger jobs into batches.
See references/gotchas.md for cost guardrails and error recovery, and references/actor-index.md for the Actor routing table.
Related LinkedIn Actors
1---2name: apify-linkedin-posts-scraper3description: Scrape public LinkedIn posts into clean, structured JSON with the Apify LinkedIn Posts API Actor (johnvc/linkedin-posts-api). Give a profile URL to discover a person's recent posts, or specific post URLs to fetch directly, and get one row per post with text, hashtags, media, author details, and engagement counts (reactions, comments, shares). Use when the user wants to scrape LinkedIn posts, export LinkedIn posts to JSON or CSV, build a LinkedIn posts dataset, pull a creator's or a competitor's recent posts, or asks for a LinkedIn posts scraper or LinkedIn posts API. Pay-per-post billing, MCP-ready for Claude and other AI agents.4license: MIT5---67# LinkedIn Posts Scraper: Posts to Structured JSON89Scrape public LinkedIn posts into clean JSON with the Apify LinkedIn Posts API. Point it at a profile to pull that person's recent posts, or pass specific post URLs to fetch them directly. You get one flat row per post: text, hashtags, media, author, and engagement counts.1011## When to use this skill1213- The user wants to scrape or export LinkedIn posts (to JSON, CSV, a sheet, or a database).14- They want a creator's, brand's, or competitor's recent posts.15- They want to build a dataset of posts for research, monitoring, or content ideas.16- They ask for a "LinkedIn posts scraper" or "LinkedIn posts API".1718Not for: private or connection-only content, profile bio data (use the LinkedIn Profile API), or company pages (use the LinkedIn Company API).1920## What you get (one row per post)2122`postUrl`, `postId`, `postType`, `datePosted`, `title`, `text`, `hashtags`, `authorName`, `authorHeadline`, `authorUrl`, `authorFollowers`, `authorType`, `numLikes`, `numComments`, `numShares`, `images`, `videos`, `embeddedLinks`, `taggedCompanies`, `taggedPeople`, `topComments`, `summary`. A post that cannot be collected comes back as an error row (`result_type` = "error") instead of failing the run.2324## Prerequisites2526- Apify account (sign up at https://apify.com?fpr=9n7kx3&fp_sid=awesomeskills).27- Authentication via `apify login`, or an `APIFY_TOKEN` environment variable (Apify Console, Settings, Integrations).2829## The Actor3031- Store page: https://apify.com/johnvc/linkedin-posts-api?fpr=9n7kx3&fp_sid=awesomeskills32- Actor ID: `johnvc/linkedin-posts-api`33- Pricing: pay per post returned (see `references/gotchas.md`).3435## Run it with the Apify CLI3637Discover a profile's recent posts:3839```bash40apify actors call "johnvc/linkedin-posts-api" -i '{"profileUrls":["https://www.linkedin.com/in/williamhgates"],"maxPostsPerProfile":20}' \41 --json \42 --user-agent apify-awesome-skills/apify-linkedin-posts-scraper \43 2>/dev/null44```4546Fetch specific posts by URL:4748```bash49apify actors call "johnvc/linkedin-posts-api" -i '{"postUrls":["https://www.linkedin.com/feed/update/urn:li:activity:7446904645010210816"]}' \50 --json \51 --user-agent apify-awesome-skills/apify-linkedin-posts-scraper \52 2>/dev/null53```5455Every call carries the three flags this repo expects: `--json`, `--user-agent apify-awesome-skills/apify-linkedin-posts-scraper`, and `2>/dev/null`.5657## Run it from Claude or another AI agent (MCP)5859The Actor is MCP-ready. Add the hosted server URL:6061`https://mcp.apify.com/?tools=actors,docs,johnvc/linkedin-posts-api`6263Then ask, for example: "Use the LinkedIn Posts API to pull Bill Gates's last 20 posts and export them as JSON." MCP setup docs: https://docs.apify.com/platform/integrations/mcp6465## Workflow66671. Pick the mode. Profile URLs for discovery (up to 25 per run), or post URLs for exact fetches (up to 1000 per run). You can pass both; supply at least one.682. Bound the volume. Set `maxPostsPerProfile` (default 20, max 200), and, for a window, `startDate` and `endDate` (YYYY-MM-DD, discovery only).693. Estimate cost, then confirm with the user if the run is large. See `references/gotchas.md`.704. Run the Actor and read the dataset. Deliver the rows as JSON or CSV, or hand back the dataset link.7172## Inputs7374- `profileUrls` (array of `/in/` profile URLs, up to 25, discovery mode)75- `postUrls` (array of post URLs, up to 1000, exact fetch)76- `maxPostsPerProfile` (integer, default 20, max 200)77- `startDate` / `endDate` (YYYY-MM-DD, discovery only)7879Non-`/in/` profile URLs (company or school pages) are skipped.8081## Cost8283Billing is per post returned, so a discovery run costs roughly the number of profiles times `maxPostsPerProfile`. Estimate first and confirm large runs. Thresholds are in `references/gotchas.md`.8485## Troubleshooting8687- Empty profile: you get an error row (`result_type` "error", `error_type` "CollectionError"), not a failed run. Skip it; the rest of the batch still returns.88- Wrong URL type: only `/in/` profile URLs discover posts; company or school URLs are skipped.89- Over a limit: keep profiles at 25 or fewer and post URLs at 1000 or fewer per run; split larger jobs into batches.9091See `references/gotchas.md` for cost guardrails and error recovery, and `references/actor-index.md` for the Actor routing table.9293## Related LinkedIn Actors9495- LinkedIn Profile API: https://apify.com/johnvc/linkedin-profile-api?fpr=9n7kx3&fp_sid=awesomeskills96- LinkedIn Company API: https://apify.com/johnvc/linkedin-company-api?fpr=9n7kx3&fp_sid=awesomeskills97- LinkedIn Jobs API: https://apify.com/johnvc/linkedin-jobs-api?fpr=9n7kx3&fp_sid=awesomeskills