How to Scrape LinkedIn Profiles (Without Getting Your Account Banned)
There are three ways to do this and only one of them does not put your own LinkedIn account at risk. Here is the trade-off, honestly, with code.
Founder, Enricho
There are three ways to get profile data off LinkedIn, and they differ far more in risk than in difficulty. Picking the wrong one is how people end up with a restricted account and a pipeline that breaks every fortnight.
Option 1: browser automation with your own cookies
Tools in this category log in as you, using your session cookie, and drive a headless browser. It works, it reaches things only a logged-in user can see, and it is the fastest route to a demo.
It is also the option that puts your account on the line. Automated behaviour from an account is detectable — the request rate, the navigation pattern, the absence of the small human hesitations that real browsing produces. When LinkedIn acts on it, it restricts the account, not the tool. Plenty of people have discovered this with the account their career is attached to.
If you go this route, use a throwaway account you can afford to lose, and never the one with your professional network on it.
Option 2: write your own scraper
No cookies, no account, just fetching public pages and parsing them. Conceptually clean, and the maintenance is relentless.
You will need proxies, because a single IP making thousands of requests gets blocked quickly. You will need to handle markup changes, which happen without warning and break your parser silently — the worst failure mode, because you get plausible-looking empty fields rather than an error. And you will need to keep doing that forever, for one data source.
It is a reasonable choice if scraping is your product. It is a poor one if you are trying to ship something else.
Option 3: call an API
Someone else absorbs the proxies, the parsing and the breakage, and you make an HTTP request. Your own account is never involved.
import requests
response = requests.get(
"https://api.enricho.io/v1/profile",
headers={"X-API-Key": "YOUR_API_KEY"},
params={"publicIdentifier": "williamhgates"},
timeout=30,
)
response.raise_for_status()
profile = response.json()["element"]
print(profile["firstName"], profile["headline"])
That returns the full profile: work history with dates, education, skills, certifications, languages, location and follower counts.
The parameter that halves your bill
If you are checking whether someone still works where you think they do, you do not need their education history. Add short=1:
params={"publicIdentifier": "williamhgates", "short": 1}
It returns identity and current position, and costs meaningfully less per call. On a database refresh across tens of thousands of contacts, that difference is the whole budget. Resolve the full profile only for the records that changed.
Handle these three cases from day one
Empty results. A private or deleted profile returns a successful response with an empty element, not an error. Retrying it costs you again every time. Handle it explicitly.
Vanity URL changes. Anyone can change the /in/ part of their URL, and the old one stops resolving. Store the opaque profile ID as your key and treat the URL as a display field — this is the single most common reason enrichment pipelines quietly rot.
Rate limits. Run calls in parallel up to your concurrency limit and no further. Going over returns 429 with a Retry-After; respect it rather than retrying in a tight loop.
What no method will get you
Email addresses are not on a public profile. Any provider offering them is inferring or buying them elsewhere — that may be fine for your use case, but know which one you are getting. We do not offer them at all.
Nor can you get a complete employee roster for a company. That runs through relevance-ranked search with a paging ceiling, and anyone promising exhaustive coverage is overselling.
Before you build
Whichever route you take, you are the data controller for the personal data you collect. Under the GDPR that means having a lawful basis and honouring deletion requests. Our acceptable use policy sets out what we expect; take your own advice on what applies to you.
If you want to try the API route, the Profile API page has the full parameter list, and new accounts start with free balance.
Last updated 12 Aug 2026.
Try the API
Free balance on signup, no card. Enough to pull a few hundred records and judge the data before you spend anything.
Start free