LinkedIn Scraping with Python in 2026: 4 Approaches Compared (Native Script, Open-Source Libs, Public API, MCP)
Should you write your own LinkedIn scraper in Python? The 4 approaches with their tradeoffs - when DIY is worth it, when it's a trap.
You want to scrape LinkedIn data from Python. Logical: Python has the libraries, you have the dev skills, why pay for a tool? Reality check: writing your own LinkedIn scraper in 2026 is a maintenance burden that costs more than most paid tools - unless your use case is very specific.
Here are the 4 approaches that actually exist in 2026, with their real-world tradeoffs.
Approach 1: Native Python script (requests + BeautifulSoup)
The DIY classic. You authenticate via cookie, send GET requests, parse HTML.
Pros: zero cost, full control, learn the structure of LinkedIn pages.
Cons:
- LinkedIn changes its HTML structure every 2-3 months - your selectors break constantly
- You need to rotate cookies, manage proxies if you want any volume
- Anti-bot detection: too many requests from one IP = your account is flagged
- Maintenance cost: ~5-10h/month minimum once you're past the prototype
When it works: one-shot extraction of <100 profiles for research. Stop there.
Approach 2: Open-source libraries (linkedin-scraper, etc.)
GitHub libs like linkedin-scraper, linkedin-api, linkedin-jobs-api wrap the messy parts.
Pros: faster setup, community-maintained selectors, examples for common workflows.
Cons:
- Most are unmaintained - last commit 8-12 months ago means they're already broken
- Still cookie-bound: you risk your account
- No anti-detection layer - same IP issues as native script
- License risk: some libs violate LinkedIn ToS explicitly
When it works: small-team prototyping where you can stomach breakage every 2-3 months and don't mind babysitting.
Through the Derrick API
The call to make instead of the script to maintain
The four approaches compared here differ mostly in how much breakage you accept. If you are writing Python anyway, the Derrick API gives you an HTTP call that returns structured fields, with nothing to keep in sync with a page layout.
- Feature
- Derrick API
- Credit cost
- Included
The first button opens the web app, where your account and key live. API and MCP access starts on the PLUS plan. The second details the surface.
Approach 3: Public LinkedIn API (Marketing / Talent / Sales Navigator)
LinkedIn has 3 official APIs. None of them give you full profile scraping.
- Marketing API: ads management, audience insights. Not for profile data.
- Talent API: job postings, applicant data. Restricted to LinkedIn Talent customers.
- Sales Navigator API: limited list export. Requires Sales Nav Advanced Plus.
Pros: compliant, your account is safe, structured JSON output.
Cons:
- Coverage is intentionally limited (LinkedIn doesn't want you to scrape)
- Approval process for production access is slow (weeks)
- You don't get individual profile data via any of these APIs
When it works: if you're in Talent Solutions, building on top of LinkedIn data with their blessing.
The app works through your list row by row. 100 free credits every month.
Approach 4: MCP server wrapper (modern, conversational)
MCP (Model Context Protocol) servers expose LinkedIn data through a standardized interface that Claude and other LLMs can call directly. The Python side is just calling the MCP server, not writing scraping logic yourself.
Pros:
- Zero scraping code to maintain - the MCP server handles it
- Conversational interface: "Get me the headcount of TechCorp" instead of writing a function
- Native fit with AI workflows
Cons:
- Newer ecosystem - fewer mature MCP servers as of 2026
- You're dependent on the MCP server's coverage and reliability
- Not all data sources have an MCP yet
When it works: AI-native workflows where the LinkedIn data feeds into Claude/GPT for analysis or generation.
Decision matrix: which approach for which use case
| Use case | Recommended approach | Why |
|---|---|---|
| One-shot research (<100 profiles) | Native script | Fastest setup, throwaway code is fine |
| Recurring extraction 200-2k/mo | Open-source lib + babysit | Manageable maintenance at this volume |
| Production app needing LinkedIn data | Public API or paid service | Compliance + reliability matter |
| AI workflow / agentic use | MCP server | Conversational interface fits LLM stack |
| Bulk sales prospecting | Paid tool (not Python) | The maintenance cost of DIY exceeds tool price |
Key takeaways
- Writing your own Python LinkedIn scraper is rarely worth it in 2026 - the maintenance cost outpaces paid tools at most volumes.
- Native scripts and open-source libs both depend on stable cookies and IPs you don't have access to at scale.
- Official LinkedIn APIs don't give you profile data - they're aimed at advertising and recruiting workflows.
- MCP servers are the modern alternative if you're building an AI workflow; they remove scraping from your code path entirely.
- Decision rule: if your use case is sales prospecting, use a paid tool. If it's research or AI integration, pick from the 4 approaches above based on the matrix.
Frequently asked questions
Is it legal to scrape LinkedIn with Python?
Scraping public data without logging in is defensible, but it breaks LinkedIn's User Agreement. The hiQ Labs v. LinkedIn rulings are US case law and do not carry over to Europe, where data protection obligations apply as soon as you store personal data about EU residents.
What is the best Python library to scrape LinkedIn?
linkedin-api by tomquirk if you want a quick setup (session cookie, no Selenium). linkedin-scraper by joeyism for a sturdier Selenium-based approach. Both need a personal LinkedIn account.Can you scrape LinkedIn without using your own account in the script?
Yes, through the jobs-guest endpoint (job posts only), or through a third-party API like Derrick, which runs the extraction server side. With Derrick you connect LinkedIn once through its Chrome extension, so your Python script never stores a cookie or a password.
How many requests can my script make before it gets blocked?
Without login: around 50 requests per hour from one IP. With a session cookie: 100 to 500 profiles a day, depending on how fresh the cookie is. With a native API: it depends on your plan, usually several thousand a day.
BeautifulSoup or Selenium to scrape LinkedIn?
BeautifulSoup is enough for the static HTML of public pages. Selenium becomes necessary as soon as the data is rendered by JavaScript or sits behind a login. For a native Python workflow without a browser,
linkedin-api (session cookie) is lighter than Selenium.Keep reading