LinkedIn Profile Scraper

Collect valuable information you need from LinkedIn profiles, including emails

Share:  
Table of Contents

New! This API now supports email discovery.


Extract info from LinkedIn profiles

When building your CRM, you sometimes need to gather information from LinkedIn contacts/prospects. Don't waste your time copy/pasting anymore. Retrieve all the data you need of the specific LinkedIn profiles you're targeting in a CSV file.

Our Solution

Launch an automated agent that will connect on LinkedIn as you. It will then browse and collect all the info from the designated profiles.

Caution

  1. As the agent will connect to your account, use this script sparingly. LinkedIn only allows you to view a certain number of profiles per day/month. Consider this when launching the agent or it might get your account slowed down.
    More infos about >> LinkedIn Commercial Use Limit <<
  2. We've noticed that without LinkedIn Premium, you can only scrape 100 profiles in one go. Your mileage may vary.

What will you need? ⚙️

  • Session cookie: Your session cookie from LinkedIn.
  • Spreadsheet URL: The link of a Google Spreadsheet with LinkedIn profile URLs in it.

(You already have all that? Click straight away on "Use this API")

Which data will you collect?

IN CSV

  1. LinkedIn profile link

  2. Headline

  3. Description

  4. First name

  5. Last name

  6. Full name

  7. N° of subscribers

  8. Company name

  9. Current job title

  10. Description of the current job

  11. Location of that job

  12. Email (if available)

  13. Discovered email (New! See below)

  14. Phone number (if available)

  15. Twitter (if available)

  16. Website (if available)

  17. Profile image URL

  18. Skills

  19. Number of endorsements per skill

IN JSON

In addition to everything listed above:

  • Connections

  • Following infos from all listed Job

    • Company name
    • Company URL
    • Job title
    • Date range
    • Location
    • Description
  • Following infos from all listed education

    • School name
    • School URL
    • Degree
    • Degree specifications
    • Date range
    • Description

Which steps to follow?

1. Create an account on Phantombuster.com 💻

If you haven't already, create a FREE account on Phantombuster. Our service will browse the web for you. It’s a website automator which runs in the cloud. Once done we'll follow up.

2. Use this API on your account.👌

Now that you're connected to Phantombuster, Click on the following button (it will open a new tab).

3. Click on Configure me!

You'll now see the 3 configuration dots blinking. Click on them.

4. Linkedin authentication 🔑

Because the script will manipulate LinkedIn for you, it needs to be logged on your LinkedIn account. For that you just need to copy paste your session cookie in the script argument:

  • Using Chrome, go to your LinkedIn homepage and open the inspector
    → Right click anywhere on the page and select “Inspect”
    CMD+OPT+i on macOS
    or
    F12 or CTRL+MAJ+i on Windows

  • Locate the “Application” tab

  • Select “Cookies” > “http://www.linkedin.com” on the left menu.

  • Locate the “li_at” cookie.

  • Copy what’s under “Value” (Double click on it then Ctrl+C) and paste it into your API Configuration

// How to access your cookies with Firefox and Safari //

5. Add a Google Spreadsheet 📑

Below your session cookie you’ll find Spreadsheet URL

Enter in the text field a link of a Google Spreadsheet with this same format (only column A is mandatory):

Add every linkedIn profiles link in column A (one link per row)

Please make sure your file is publicly accessible!

You can also enter a CSV file URL, it will work the same :)

6. Email discovery (optional)

Thanks to our friends at Hunter (an email discovery service), this API can guess the email of each profile it visits.

To use this feature, first create an account at Hunter here. Once done, get your Hunter API key by going to "Dashboard" > "API" > "Copy API key".

Paste your API key in the "Hunter.io API key" field in your API configuration. It will now guess the email of every visited profile! Expect a success rate between 20% and 50%.

Hunter gives you 100 free email guesses per month. After that, you'll have to buy one of their plans or wait a month.

Important note: When email discovery is enabled, the API will open LinkedIn company pages to get company domains. For this reason, we recommend you limit your scraping to 40 profiles per day.

Click on Launch & Enjoy!

It’s done! All that is left to do is to click on "launch" to try your script!

This will launch the bot and, if you didn't already change the spreadsheet URL, will collect the information of the Phantombuster team.

⚙️️Repetition setup ⚙️

Now that your API is ready, you should set up repetitive launches. That way, your scraping will be spread over days, weeks or even months.

Every time the API is launched, it will scrape 10 profiles and then stop. (This number can be changed in the configuration, the maximum is 25 per launch.)

To do so, simply hit the “Settings” button to define when your API is launched:

Then, select a frequency:

Don't forget to click 💾 Save at the bottom of the page!

For example, 10 profiles scraped per launch, 8 launches per day: you'll have a total of 80 profiles per day. We recommend not exceeding these values with this API. (Read more below about LinkedIn's limits.)

Limits

Please be aware that this API, like most of our LinkedIn APIs, will manipulate your own account on your behalf. Like Uncle Ben once said, "With great power comes great responsibility."

We have noticed that visiting more than 80 profiles per day will almost always result in LinkedIn invalidating your session cookie (that is, logging you out). We recommend no more than 4 launches per day of 20 scraped profiles for this reason.

Note: When email discovery is enabled, we recommend you divide this limit by 2 (that is, 40 profiles per day).

Having a LinkedIn Premium subscription might raise this limit. Please see these official LinkedIn help pages: Commercial Use Limit and Finding People on LinkedIn.

⚙ ️HTTP API 🤓

If you want to use this API programmatically you can replace the argument spreadsheetUrl by profileUrls which must be an array of strings. Additionally, you should set noDatabase to true so that the API does not maintain a state on its own (so that you can re-scrape the same profiles).

It should look just like this :
{ "profileUrls": ["www.linkedin.com/in/foo", "www.linkedin.com/in/bar"], "noDatabase": true, "sessionCookie": "xxxx" }

Output

This API will output CSV and/or JSON containing the following fields:

  • linkedinProfile (LinkedIn profile URL)
  • description (LinkedIn profile description)
  • firstName
  • lastName
  • fullName
  • subscribers (How many subscribers does she/he have)
  • company (What is the name of the company she/he is currently working for)
  • companyUrl (What is the url of the company she/he is currently working for)
  • jobTitle (What is her/his current job title)
  • jobDescription (Description of the current job)
  • location (Where is she/he located)
  • mail (Email address displayed on profile page (very few people do that))
  • mailFromHunter (Discovered email (see 'Email discovery' section))
  • profileImageUrl
  • phoneNumber
  • twitter
  • skill1 to skill6 (Top skills)
  • endorsements1 to endorsements6 (Number of endorsements per top skill)

Developers

Like all APIs on Phantombuster, this API comes with an HTTP endpoint. Launch it from your computer, app or server with a simple HTTP request and get its result as JSON. Click Use this API above to create your new endpoint.

Clone this API

The script below is all that's required to make the API work. If you're a developer, click the button to clone the code into a new Custom API Agent in your Phantombuster account. This operation will allow you to customize the API to your exact needs. This will also create a custom HTTP endpoint.

Contribute on GitHub

Feeling adventurous? Unsatisfied with the current state of this API? Send us pull requests on GitHub to improve the API store! The script is here and you might be interested in reading our documentation here

You can also edit the page you're reading right now

(we reward contributions we like with free Phantombuster accounts :D)

Share this API

Your friends & colleagues need to know about this!