How to get a LinkedIn company page's latest posts in Python
Checked on 2026-11-24.
LinkedIn's official API returns a company page's posts only to apps LinkedIn has approved, and only for pages on which the signed-in member has a role such as administrator. For any other company, what remains is the public page, which shows a visitor who is not logged in about the 10 latest posts. Both routes are below, with code and with where each one stops.
1. The official route: the Posts API, for pages you manage
LinkedIn's Posts API has a finder, "Find Posts by Authors", that lists the posts of a member or an organization. For an organization it needs the permission r_organization_social, which the documentation describes as "Retrieve organizations' posts, comments, and likes. Restricted to organizations in which the authenticated member has one of the following company page roles": ADMINISTRATOR, DIRECT_SPONSORED_CONTENT_POSTER or CONTENT_ADMIN. The request, with the headers the documentation lists:
import os
import requests
org = "urn:li:organization:" + os.environ["LINKEDIN_ORG_ID"] # a page on which you have a role
res = requests.get(
"https://api.linkedin.com/rest/posts",
params={"author": org, "q": "author", "count": 10, "sortBy": "CREATED"},
headers={
"Authorization": "Bearer " + os.environ["LINKEDIN_ACCESS_TOKEN"],
"Linkedin-Version": "202611", # a month, YYYYMM
"X-Restli-Protocol-Version": "2.0.0",
"X-RestLi-Method": "FINDER",
},
timeout=30,
)
res.raise_for_status()
for post in res.json()["elements"]:
if post.get("distribution", {}).get("feedDistribution") == "NONE":
continue # not distributed in the feed: a post made for an ad
print(post["id"], post.get("publishedAt"), post.get("commentary", "")[:80])requests encodes the URN in the address, as the documentation asks. count is 10 by default and at most 100, and further pages come through the links of the answer. Without sortBy=CREATED the order is by last modification, so an old post that was edited can come first. Sponsored posts are included by default, and posts made only for ads have feedDistribution set to NONE, "Do not distribute within LinkedIn via feed", which the code skips. publishedAt is an epoch time, in milliseconds in LinkedIn's samples. The organization's ID comes from its page name through the Organization Lookup API, shown in the guide to LinkedIn company data.
A post here has no reaction or comment counts. Those come from the Social Metadata API (reactionSummaries and commentSummary.count), under a permission of its own, r_organization_social_feed, again limited to pages on which the member has a role.
Where the official route stops
Where it stops: at pages you manage, and at LinkedIn's review. r_organization_social comes with the Community Management API or the Advertising API. The review page says "our Community Management APIs are only available to registered legal organizations for commercial use cases only", asks for a business email address and the organization's legal name, registered address, website and privacy policy, and wants a super admin of the organization's LinkedIn Page to verify the app. An approved app starts in the Development tier, with 500 API calls per app and 100 per member in 24 hours and no batch calls, and twelve months to finish the integration; the Standard tier takes a second form and a screen recording (access tiers).
The use is restricted too. LinkedIn's restricted uses include "No Social Feeds": none of the Community Management data "can be used in a social feed use case (e.g. to display a feed of LinkedIn company updates on the company's website or intranet)". Data about members' activity, their posts, comments and reactions, "can only be stored for 48 hours". So the official API rules out a common wish: a feed of a company's posts on its own website. Also mind the version header: Marketing version 202601 will be sunset on 15 January 2027, so send a current month.
Showing one post on a website
For a single post, LinkedIn offers an embed code: on a desktop, open the post, click the More icon and choose "Embed this post" (help article). "Only posts that an author has shared as Public can be embedded", multi-photo posts and reposts with commentary cannot be, and the embed disappears when the author deletes the post. No API and no app, but one post at a time, chosen by hand.
2. An HTTP API for any public company page
A company page's public side shows its latest posts to anyone. With Pipefetch that is one request with one key, for any company, with no LinkedIn account, app or review.
import os
import requests
res = requests.get(
"https://pipefetch.com/v1/linkedin/posts",
params={"page": "https://www.linkedin.com/company/apify", "limit": 10},
headers={"x-api-key": os.environ["PIPEFETCH_API_KEY"]},
timeout=90,
)
if res.status_code == 404:
print(res.json()["error"]["code"]) # page_not_found or no_posts: not charged
else:
res.raise_for_status()
for post in res.json()["data"]["posts"]:
print(post["activityType"], post["publishedAt"], post["author"]["name"], post["reactionCount"], post["commentCount"])
print((post["text"] or "")[:120], post["url"])page is the address of the company page on any country subdomain, or company/apify; a slug on its own is not accepted, because it would name a person's profile. limit is 1 to 10. Each post has its text, an exact publishedAt, its author, reaction and comment counts, image addresses or a video's cover image, links, hashtags and mentions. The reference lists every field.
A company page's feed mixes its own posts with posts it reposted. activityType is post, quote or repost, and a repost row holds the original post and its author, with the company in repostedBy. In the answer saved for Apify on 19 November 2026, 5 of the 6 posts were reposts, so skip rows whose activityType is repost when you want only what the company wrote. Its own post there had 58 reactions, 18 comments and an engagementRate of 0.1516: reactions plus comments as a percentage of the page's 50,143 followers. engagementRate is filled only when the page shows the author's follower count.
Where it stops: at what LinkedIn shows a visitor who is not logged in: about the 10 latest posts, nothing older, and no comments or lists of people who reacted. For a repost, publishedAt can be the time of the repost rather than of the original post. LinkedIn limits how many requests one address may make; when it refuses, the answer is a 502 that costs nothing and can be retried. A request costs 1 credit, a page that does not exist or shows no posts answers 404 and costs nothing, and most requests take 2 to 9 seconds. It is not an official API, and Pipefetch is not affiliated with LinkedIn or Microsoft. A new account has 100 free credits and needs no card. If you also want the company's size, industry and followers, the company endpoint returns them with the 3 latest posts.
Which one should you use?
| Situation | Use |
|---|---|
| You run the page and build a tool for its administrators, through LinkedIn's review | The official Posts API |
| One chosen post on your website | LinkedIn's "Embed this post" |
| The latest posts of companies you do not manage | An HTTP API such as Pipefetch |
Keeping more than the latest 10
The public page shows only the latest posts, so a history has to be built: call the endpoint on a schedule, once a day is plenty for most companies, and store the post IDs you have not seen yet. Libraries that sign in with your own LinkedIn account act under its User Agreement, whose section 8.2 forbids using "software, devices, scripts, robots or any other means or processes" to "scrape or copy the Services". Posts name the people who wrote them or are mentioned in them, which is personal data under laws such as the GDPR: keep only what your purpose needs.
Try it with 100 free credits. No card needed. No scraper to build or maintain. Get an API key or read the docs.
APIs used in this guide
-
1 credit
LinkedIn Company API
The public LinkedIn page of a company: industry, size, exact followers, headquarters, website, specialties and its latest posts.
GET /v1/linkedin/company -
1 credit
LinkedIn Posts API
The latest posts of a LinkedIn profile or company page: text, author, publish time, reactions, comments, media and reposts.
GET /v1/linkedin/posts
More LinkedIn guides
Guides for other sources
Every source
YouTube
- How to get a YouTube transcript in Python
- How to get a YouTube transcript in Node.js
- YouTube API quota exceeded: what the error means and how to fix it
- How to find a YouTube channel ID from a handle or URL
- How to download YouTube subtitles as SRT or VTT
- youtube-transcript-api RequestBlocked or IpBlocked: why it happens and how to fix it
- How to get YouTube comments in Python
- How to search YouTube from Python
- How to list a YouTube channel's videos in Python
- How to summarize a YouTube video with an LLM in Python
- How to get YouTube transcripts and video stats in Google Sheets
- How to get YouTube video views and likes in Python
- How to get YouTube transcripts in n8n, Make and Zapier
- LangChain YoutubeLoader fails on a server: why, and a loader that works
- How to get a YouTube channel's subscriber count in Python
- How to give Claude or Cursor access to YouTube (MCP server)
- How to get YouTube comments in Node.js
- How to analyze YouTube comments with an LLM in Python
- How to list a YouTube channel's Shorts in Python
- How to search YouTube from JavaScript
- How to get an Instagram follower count in Python
- Instagram Basic Display API alternatives: what to use after the shutdown
- Instaloader 401 Unauthorized, 429 and "Login required": what to do
- How to calculate an Instagram engagement rate in Python
- How to get an Instagram follower count in Node.js
- How to get Instagram follower counts in Google Sheets
- How to get Instagram Reel views in Python
Websites
- Clearbit Logo API alternatives: get a company logo from its domain
- How to extract email addresses from a website in Python
- How to turn a web page into Markdown in Python
- How to detect what a website is built with, in Python
- How to get the contact emails and phone numbers of websites in Google Sheets
- How to build a LangChain tool that reads web pages and searches Google
- How to turn a web page into Markdown in JavaScript for RAG
- How to extract social media links from a website in Python
- How to get a website's favicon in Python
- How to check robots.txt in Python before you fetch a page
TikTok
- How to get a TikTok video's views and likes in Python
- How to get the comments of a TikTok video in Python
- How to get a TikTok follower count in Python
- TikTok Research API: who can get access, and what to do if you cannot
- How to get TikTok video views, likes and shares in Node.js
- How to get TikTok views, likes and follower counts in Google Sheets
- How to get a Facebook Page's posts without app review
- Is there a Facebook Marketplace API?
- Facebook Groups API alternatives after its removal in 2024
- How to get a Facebook Page's follower count and contact details in Python
- How to get Google search results in Python
- pytrends 429 TooManyRequestsError: what it means and what to do
- How to get Google Trends data in Python
- Why is Wyoming first in Google Trends?
- How to get Google search results in Node.js
- How to get Google search results into Google Sheets
- How to give an LLM live Google results with tool calling