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:

Python
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.

Python
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?

SituationUse
You run the page and build a tool for its administrators, through LinkedIn's reviewThe official Posts API
One chosen post on your websiteLinkedIn's "Embed this post"
The latest posts of companies you do not manageAn 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.

Every source

YouTube

Instagram

Websites

TikTok

Facebook

Google

Threads

App stores

Steam

X

Pinterest

Airbnb

Real estate

Keywords

Job boards

Eventbrite

Shopify stores

Public tenders

All guides