How to get LinkedIn company data in Python
Checked on 2026-11-19.
LinkedIn has an official API for company pages, but only approved apps may call it, and for a company you do not manage it returns the name, website, logo, locations and follower count: not the industry and not the size. Those two come from the page's administrators or from the public page itself. Both routes are below, with code.
1. The official API: Organization Lookup
Company pages are "organizations" in LinkedIn's API. The Organization Lookup API finds one by its vanity name, the last part of the page address, and a second call returns its follower count. Both are made with the OAuth token of a LinkedIn member who signed in to your app and granted it rw_organization_admin.
import os
import requests
headers = {
"Authorization": "Bearer " + os.environ["LINKEDIN_ACCESS_TOKEN"],
"X-Restli-Protocol-Version": "2.0.0",
"Linkedin-Version": "202611", # a month, YYYYMM
}
# What LinkedIn returns for a page you do not administer: name, website, logo, locations
found = requests.get(
"https://api.linkedin.com/rest/organizations",
params={"q": "vanityName", "vanityName": "LinkedIn"},
headers=headers,
timeout=30,
).json()
org = found["elements"][0]
print(org["id"], org["localizedName"], org.get("localizedWebsite"))
# The follower count
size = requests.get(
"https://api.linkedin.com/rest/networkSizes/urn:li:organization:" + str(org["id"]),
params={"edgeType": "COMPANY_FOLLOWED_BY_MEMBER"},
headers=headers,
timeout=30,
).json()
print(size["firstDegreeSize"], "followers")The addresses, parameters and headers are the ones in LinkedIn's documentation. It describes the second call as returning the number of followers "for any organization".
What it returns, and for whom
The same documentation marks each field of an organization as admin only or not. A member who does not administer the page gets the short list.
| Data | Field | Any company | A page you administer |
|---|---|---|---|
| Name, page slug | localizedName, vanityName | Yes | Yes |
| Website, logo, locations | localizedWebsite, logoV2, locations | Yes | Yes |
| Followers | firstDegreeSize of networkSizes | Yes | Yes |
| Industry | industries | No | Yes |
| Size range | staffCountRange | No | Yes |
| Description, specialties, founding date | localizedDescription, localizedSpecialties, foundedOn | No | Yes |
Asking for the full record of a page you do not administer answers 403 Forbidden. For your own page the industry arrives as an id such as urn:li:industry:4 and the size as a range such as SIZE_201_TO_500.
Where the official API stops: access
Where it stops: before the first request. rw_organization_admin comes with LinkedIn's Community Management API or its Advertising API, and both are given to approved apps only. LinkedIn's review page says the Community Management APIs are "only available to registered legal organizations for commercial use cases". The application asks for a business email address and the organization's legal name, registered address, website and privacy policy, and a super admin of the organization's LinkedIn Page has to verify the app. The use cases LinkedIn lists as approved are page management, page and member analytics, profile management and employee advocacy.
An approved app starts in the Development tier: 500 API calls per app and 100 per member in 24 hours, no batch calls, and twelve months to complete the integration. The Standard tier lifts those limits and takes a second form with a screen recording of your app. The access page has the current terms.
2. An HTTP API for the public page
A company page also has a public side: what LinkedIn shows a visitor who is not logged in. It states the industry, the size range and the follower count. With Pipefetch that page is one HTTPS request with one key, and there is no app to get approved.
import os
import requests
res = requests.get(
"https://pipefetch.com/v1/linkedin/company",
params={"company": "apify"}, # or https://www.linkedin.com/company/apify
headers={"x-api-key": os.environ["PIPEFETCH_API_KEY"]},
timeout=90,
)
if res.status_code == 404:
print("No such company page") # not charged
else:
res.raise_for_status()
data = res.json()["data"]
print(data["name"], data["followerCount"])
print(data["industry"], "|", data["companySize"])
print(data["headquarters"], data["foundedYear"], data["website"])Some of the fields of an answer saved on 19 November 2026:
{
"slug": "apify",
"name": "Apify",
"website": "https://apify.com/",
"industry": "Technology, Information and Internet",
"companyType": "Privately Held",
"companySize": "201-500 employees",
"companySizeMin": 201,
"companySizeMax": 500,
"employeeCount": null,
"followerCount": 50143,
"foundedYear": 2016,
"headquarters": "Prague"
}company is the page address or its slug; company names, numeric company ids and school pages are not accepted. followerCount is the exact number. companySize is the range the company chose on LinkedIn, and employeeCount is filled only when the page states a number, as the null above shows. The answer also holds the headquarters address, the specialties, the 3 latest posts and the companies LinkedIn lists as similar. The reference lists every field.
Where it stops: at the public page. Employee lists and people's profiles are not included, and the 3 posts are a recent sample, not the post history. It is not an official API, and Pipefetch is not affiliated with LinkedIn or Microsoft. A request costs 1 credit. A page that does not exist answers 404 and costs nothing; so does a request LinkedIn refuses, which answers 502 and can be retried. Most requests take 2 to 9 seconds, and a new account has 100 free credits and needs no card.
Which one should you use?
| Situation | Use |
|---|---|
| You manage the page and want its full record or its analytics | The official API |
| You build a tool for page administrators and can go through LinkedIn's review | The official API |
| You already have an approved app and need only names, websites and follower counts | The official API |
| Industry, size and followers of companies you do not manage | An HTTP API such as Pipefetch |
What about linkedin-api and other unofficial libraries?
Older tutorials use the linkedin-api package. Its PyPI page says "Just use a valid LinkedIn user account", so it signs in as you, and it warns: "Using this library might violate LinkedIn's Terms of Service. Use it at your own risk." The latest release there is 2.3.1 of 7 November 2024, and the GitHub repository the page names answered "not found" on 19 November 2026.
LinkedIn's User Agreement lists, among the things its members agree not to do, using software, scripts or bots to "scrape or copy the Services" (section 8.2). A tool that signs in with your account acts under that agreement, in your name.
Follower counts over time
The official API has follower statistics that go back 12 months, but only for pages the signed-in member administers. For any other company neither route returns history: call it on a schedule and store the number with the date.
Try it with 100 free credits. No card needed. No scraper to build or maintain. Get an API key or read the docs.
Free tools for this
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