LinkedIn Posts API
Collect public LinkedIn posts as clean, structured JSON. Discover every post from a profile URL, or fetch specific post URLs, with text, reactions, comments, shares, media, hashtags, and author details. Pay per post, MCP-ready for Claude and AI agents.
Input parameters
| PARAMETER | TYPE | REQ | DEFAULT | DESCRIPTION |
|---|---|---|---|---|
| profileUrls | string[] | no | — | One or more LinkedIn profile URLs, e.g. https://www.linkedin.com/in/williamhgates. |
| postUrls | string[] | no | — | One or more specific LinkedIn post URLs, e.g. https://www.linkedin.com/posts/...-activity-1234567890 or https://www.linkedin.com/feed/update/urn:li:activity:1234567890. |
| maxPostsPerProfile | integer | no | 20 | Maximum number of posts to return for each profile URL (discover mode). |
| startDate | string | no | — | Only discover posts on or after this date (YYYY-MM-DD). |
| endDate | string | no | — | Only discover posts on or before this date (YYYY-MM-DD). |
Worked examples
{
"profileUrls": [
"https://www.linkedin.com/in/williamhgates"
],
"postUrls": [
"example"
]
}
n8n templates
Free n8n workflows that run this source. Import one, add your Apify token, and it runs on a schedule.
Code
curl
curl -X POST "https://api.apify.com/v2/acts/johnvc~linkedin-posts-api/run-sync-get-dataset-items" \
-H "Authorization: Bearer $APIFY_TOKEN" \
-H "Content-Type: application/json" \
-d '{"profileUrls": ["https://www.linkedin.com/in/williamhgates"], "postUrls": ["example"]}'
Python
from apify_client import ApifyClient
client = ApifyClient("APIFY_TOKEN")
run = client.actor("johnvc/linkedin-posts-api").call(
run_input={'profileUrls': ['https://www.linkedin.com/in/williamhgates'], 'postUrls': ['example']}
)
for item in client.dataset(run.default_dataset_id).iterate_items():
print(item)
MCP
Apify's hosted MCP server loads this source from the URL below as the tool johnvc--linkedin-posts-api. Sign in to Apify when your client asks (OAuth), or send an Apify token as an Authorization: Bearer header.
https://mcp.apify.com/?tools=johnvc/linkedin-posts-api
Questions people ask
What does the LinkedIn Posts API return for each post?
Each public LinkedIn post comes back as structured JSON with its text, reactions, comments, shares, media, hashtags and author details.
What inputs does the LinkedIn Posts API take?
Pass profileUrls to discover every post from a LinkedIn profile, or postUrls to fetch specific posts. In discover mode, maxPostsPerProfile, 20 by default, caps the posts per profile, and startDate and endDate limit the date range.
How much does the LinkedIn Posts API cost per post?
The default edition is pay per post at $0.00001 for each post scraped, and there is a free tier on Apify.
Can I limit the LinkedIn Posts API to a date range?
Yes. Set startDate to discover only posts on or after a date and endDate for posts on or before one, both in YYYY-MM-DD format. The date filters apply when discovering posts from a profile URL.
Can an AI agent call the LinkedIn Posts API over MCP?
Yes. The LinkedIn Posts API is exposed as an MCP tool on Apify's hosted MCP server for Claude, Cursor and other agents, and it is also available over REST.