️♂️ LinkedIn profile scraper returning structured profile data in JSON.
️♂️ LinkedIn profile scraper returning structured profile data in JSON.
LinkedIn profile scraper using Puppeteer headless browser. So you can use it on a server. Returns structured data in JSON format.
This scraper will extract publicly available data:
Profile: name, title, location, picture, description and url
Experiences: title, company name, location, duration, start date, end date and the description
Education: school name, degree name, start date and end date
** Volunteer experiences:** title, company, description, start date and end date name
️♂️ Skills: name and endorsement count
All dates are formatted to a generic format.
Scrape public LinkedIn profile data at scale with Proxycurl APIs.
Built for developers, by developers.
In order to scrape LinkedIn profiles, you need to make sure the scraper is logged-in into LinkedIn. For that you need to find your account's session cookie. I suggest creating a new account on LinkedIn and enable all the privacy options so people don't see you visiting their profiles when using the scraper.
li_at. Use that value for sessionCookieValue when setting up the scraper.npm install linkedin-profile-scraper// TypeScript
import { LinkedInProfileScraper } from 'linkedin-profile-scraper';
// Plain Javascript
// const { LinkedInProfileScraper } = require('linkedin-profile-scraper')
(async() => {
const scraper = new LinkedInProfileScraper({
sessionCookieValue: 'LI_AT_COOKIE_VALUE',
keepAlive: false
});
// Prepare the scraper
// Loading it in memory
await scraper.setup()
const result = await scraper.run('https://www.linkedin.com/in/someone/')
console.log(result)
})()See Example response for an example response.
Set keepAlive to true to keep Puppeteer running in the background for faster recurring scrapes. This will keep your memory usage high as Puppeteer will sit idle in the background.
By default the scraper will close after a successful scrape. Freeing up your memory.
Known LinkedIn sessions could expire after some time. This usually happens when you do not use LinkedIn for a while. The scraper can notify you about this specifically, so you can act upon that.
You should obtain a new li_at cookie value from the LinkedIn.com website when this error shows and update the sessionCookieValue with that new value. For that, follow the Getting started steps above in this readme.
(async() => {
try {
const scraper = new LinkedInProfileScraper({
sessionCookieValue: 'LI_AT_COOKIE_VALUE'
});
await scraper.setup()
const result = await scraper.run('https://www.linkedin.com/in/someone/')
console.log(result)
} catch (err) {
if (err.name === 'SessionExpired) {
// Do something when the scraper notifies you it's not logged-in anymore
}
}
})()…This module uses the session cookie of a succesfull login into LinkedIn, instead of an e-mail and password to set you logged-in. I did this because LinkedIn has security measures by blocking login requests from unknown locations or requiring you to fill in Captcha's upon login. So, if you run this from a server and try to login with an e-mail address and password, your login could be blocked. By using a known session, we prevent this from happening and allows you to use this scraper on any server on any location.
So, using a session cookie is the most reliable way that I currently know.
You probably need to follow the setup steps when the scraper logs show it's not logged-in anymore.
keepAlive option. Chromium uses about 75MB memory when in idle.LinkedIn has some usage limits in place. Please respect those and use their options to increase limits. More info: LinkedIn Commercial Use Limit
No open issues yet, or sync has not completed.