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.

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

DataFieldAny companyA page you administer
Name, page sluglocalizedName, vanityNameYesYes
Website, logo, locationslocalizedWebsite, logoV2, locationsYesYes
FollowersfirstDegreeSize of networkSizesYesYes
IndustryindustriesNoYes
Size rangestaffCountRangeNoYes
Description, specialties, founding datelocalizedDescription, localizedSpecialties, foundedOnNoYes

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.

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

JSON
{
  "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?

SituationUse
You manage the page and want its full record or its analyticsThe official API
You build a tool for page administrators and can go through LinkedIn's reviewThe official API
You already have an approved app and need only names, websites and follower countsThe official API
Industry, size and followers of companies you do not manageAn 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

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