How to extract data from the LinkedIn API

Alfie Lambert Updated 14 January 2024

LinkedIn API
Reading Time: 13 minutes

Contents

LinkedIn is one of the most popular professional networking platforms, with over 800 million users and 30m companies worldwide. It offers a range of useful data points for talent, sales, marketing, business intelligence and many more. Accessing this data via API (Application Programming Interface) allows companies to integrate this data into their own applications, creating a more seamless user experience and enabling new functionality. The issue is, accessing this data (particularly at scale) can be tricky.

There are currently two ways to extract data from LinkedIn via API:

  1. Getting approved as an official LinkedIn Partner
  2. Using an unofficial API, such as Lix’s LinkedIn API*

*View the Lix LinkedIn API Docs

This blog explains both options, along with the benefits and use cases for a LinkedIn API and the technical capabilities of Lix’s LinkedIn API along with Python examples.

It will also discuss some of the challenges and considerations that businesses should keep in mind when working with the LinkedIn API. Whether you’re a developer looking to integrate LinkedIn into your application, or a business looking to leverage LinkedIn’s data for marketing or recruitment purposes, the LinkedIn API offers a wealth of possibilities.

The LinkedIn Partner Program

LinkedIn offer four official partner programs that grant access to their API:

Approval can be slow and difficult to obtain. LinkedIn removed their API from public access back in 2015 and have (understandably) been picky about who has been granted access, since. Even with official partner status, getting the data you need at scale can still be an issue. For example, if you’re looking to export LinkedIn Profile data, you will either need permission from each individual profile owner or you will need a paid subscription to LinkedIn’s consumer solution platform. Even with a paid subscription, you may still face issues with throttling when calling large numbers of profiles.

Lix LinkedIn API: Overview

Accessing the treasure-trove of LinkedIn data via the Lix API is quick and simple. We handle Proxy rotation, account management and rate limiting for you – so all you need to do, is request the data you need! Currently, we offer LinkedIn Profile exports (Enrichment), Search, Jobs, Posts, Connections and Contact Information; with more endpoints to be released in the coming months.

The API is organized around REST. All requests should be made over SSL. All request and response bodies, including errors, are encoded in JSON.

Please take a look at our documentation, within which we have some specific language code examples to make integration easier. These include Node, Python, Go, Javascript & Java.

LinkedIn Profile API (Profile Enrichment)

Perhaps the most sought-after export, is the complete LinkedIn profile. Some of the most popular use cases include:

Talent sourcing and recruitment: Talent and recruitment firms can use the API to export LinkedIn profiles of potential job candidates to build a candidate pool, assess their skills, experience and professional network.

Market research: Companies can export LinkedIn profiles of industry professionals to analyse their experience, education, skills, and work history. This can help them identify market trends, assess competitors and make informed business decisions.

Sales prospecting: Sales teams can export LinkedIn profiles of potential customers to identify decision-makers, assess their interests, work history, and professional network. This can help them personalize their sales pitch and increase their chances of conversion.

Competitive intelligence: Companies can use the API to export LinkedIn profiles of their competitors to analyse their skills, experience, and professional network. This can help them identify areas where they need to improve and take informed decisions.

1 API credit will return 1 complete profile.

Here is an example of a Profile Enrichment API call in Python:

import requests

url = "<https://api.lix-it.com/v1/person?profile_link=https://linkedin.com/in/alfie-lambert>"

payload={}
headers = {
  'Authorization': [lixApiKey]
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)

This call will return JSON, structured like this:

{"fullName":"Alfie Lambert","headline":"Co-founder at Lix","summary":"Building the cybernetic sales workforce by connecting all software with verified, actionable B2B data. 🤖","location":"London, England, United Kingdom","emails":[""],"socialAccounts":{"linkedin":{"username":"alfie-lambert","url":"<https://www.linkedin.com/in/alfie-lambert"},"twitter":{"username":"AlfieLambert"}},"workExperiences":[{"organisation":{"name":"Lix","socialAccounts":{"linkedin":{},"twitter":{}}},"title":"Co-founder","description":"Lix> provides industry-leading contact intelligence technology to sales teams, marketers and business intelligence professionals around the world. Our primary goal is simple: bring Contact Intelligence into the business mainstream. \\n\\nSales teams, especially those in fast-growing b2b SaaS businesses, need an alternative to broad-brush leads lists. They need more information about the people they are selling to. They need to spend less time hunting for leads and inputting contact information. They need to spend more time doing what they do best: selling.","location":"London, England, United Kingdom","startedOn":{"year":2020,"month":11},"endedOn":{}},{"organisation":{"name":"Lambert \\u0026 Bizzle","socialAccounts":{"linkedin":{},"twitter":{}}},"title":"Growth Consultant","description":"Our speciality lies at the intersection of performance marketing and immaculate presentation. We understand what powers real growth: marrying our expertise with an intimate knowledge of your business to create tailored solutions to your most pressing problems. \\n\\nWith shared backgrounds in growth hacking, automation, graphic design, video editing and startup \\u0026 scale-up marketing we can provide a full solution for your business - or we can dip in and solve individual problems as needed.","location":"London, England, United Kingdom","startedOn":{"year":2018,"month":3},"endedOn":{"year":2020,"month":11}},{"organisation":{"name":"Strawberries \\u0026 Creem Festival","socialAccounts":{"linkedin":{},"twitter":{}}},"title":"Director of Marketing and Communications","description":"Last year saw 10,000 revellers at S\\u0026C - a 10 fold increase from when I started less than 4 years ago. We have struck 6-figure partnerships with household names, been featured in every national newspaper and radio station worth mentioning and become a mainstay of the festival scene. ","location":"Cambridge, United Kingdom","startedOn":{"year":2014,"month":7},"endedOn":{"year":2018,"month":3}},{"organisation":{"name":"Pivigo","socialAccounts":{"linkedin":{},"twitter":{}}},"title":"Growth Hacker","description":"Pivigo is passionate about what the data revolution will bring to the commercial and public sectors. Data science can, and will, impact every industry. It is only a matter of time before every company will employ data science in their business, and those that start earlier will have a strategic advantage.\\n\\nAs the data science hub, Pivigo is at the cutting edge of a flourishing industry. We provide all the tools for those looking to a career in data science, from leading training (S2DS) to resources and challenges. For business, we can help you identify what data could do for you and connect you with the skilled practitioners to deliver on that goal.","location":"London, United Kingdom","startedOn":{"year":2017,"month":2},"endedOn":{"year":2017,"month":12}},{"organisation":{"name":"CityMunch","socialAccounts":{"linkedin":{},"twitter":{}}},"title":"Chief Marketing Officer","description":"CityMunch is a two-sided marketplace looking to connect savvy consumers with eager restaurateurs. We are putting the power into their hands, helping restaurants fill their seats and customers fill their stomachs. \\n\\nFor consumers, the mobile app allows anyone with time on their hands to explore London's food scene without breaking the bank. CityMunch offers free real-time discount vouchers across 250+ restaurants in London. \\n\\nFor restaurants, a simple web-based platform helps fill spare tables during quiet periods.\\n\\nAs CMO of a new and fledgling company, all processes had to be started from scratch; immediately designing and implementing a full media and communications strategy that has continued to be the foundation of all their b2c communication. \\n\\nDuring my tenure, the user base increased by +48%!a(MISSING)nd the daily covers (our key metric) rocketed 10x: from 5 on the day that I started to 52 on the day that I left. The average daily validations grew from 6 to 40. \\n\\nDAU (Daily Average Users) increased by +315.6%!,(MISSING) Daily Engagement rose by +532%!,(MISSING) Sessions Per User +18%!,(MISSING) Daily Engagement Per User +52%!\\(MISSING)n\\nMy communications work led to CityMunch receiving a prominent specialist feature in the Daily Telegraph, as well as coverage in other major news outlets and online channels","location":"London, United Kingdom","startedOn":{"year":2016,"month":10},"endedOn":{"year":2017,"month":1}},{"organisation":{"name":"Freelance Journalism","socialAccounts":{"linkedin":{},"twitter":{}}},"title":"Freelance Journalist","description":"In addition to reading for my degree, I currently write articles and submit them on a freelance basis to a number of publications including: BRIC - A high-end glossy political publication focusing on the emerging BRIC nations. Croco - An arts and lifestyle magazine originally based in Spain; I was approached by the editor to assist in targeting UK music artists and scenes in order to help them bridge the gap into a new market. DV8 - A sneaker-based fashion magazine based in London.","location":"London, United Kingdom","startedOn":{"year":2013,"month":10},"endedOn":{"year":2016,"month":7}},{"organisation":{"name":"The Tab","socialAccounts":{"linkedin":{},"twitter":{}}},"title":"Music Editor","description":"As editor of the music section for the Cambridge Tab I chase leads, find stories and commission writers to cover all aspects of the music scene in and around the University.\\n\\nDuring my time as editor over the busy May Ball period I successfully negotiated exclusive coverage with the vast majority of Cambridge colleges for their headline act announcements - putting The Tab music way ahead of the pack of student papers in terms of hits, readership and content sharing. I am consistently within the Top 100 journalists Nationwide and often in the Top 20 / Top 10.","location":"Cambridge, United Kingdom","startedOn":{"year":2015,"month":5},"endedOn":{"year":2016,"month":1}},{"organisation":{"name":"Futurecoins","socialAccounts":{"linkedin":{},"twitter":{}}},"title":"CMO","description":"As a new start-up, Future Coins needed a fast and powerful media strategy. I arranged for Joel Moss to be interviewed, along with our product, by: CNN, Al-Jazeera, The Telegraph, Time Out, Vice and a number of industry publications. Our social media presence grew in both quality and quantity, with targeted marketing through Facebook a great success when looking to reach out to tech savvy 20-somethings in the London area. As well as building awareness for our initial installation in London, I also put together a marketing plan based on bitcoin usage data against population and sought out other areas of the UK to install our units. I successful brokered the deal with the host of our unit in Brighton, which was the first in the city attracting attention from the BBC and local press.","location":"London, United Kingdom","startedOn":{"year":2013,"month":4},"endedOn":{"year":2015,"month":1}},{"organisation":{"name":"The Guestlist Network","socialAccounts":{"linkedin":{},"twitter":{}}},"title":"Journalist \\u0026 Section editor","description":"Producing articles for both online \\u0026 a print run of 50k. I also interview artists (both written and on camera), as well as contributing to comedy sketch writing.","location":"London, United Kingdom","startedOn":{"year":2013},"endedOn":{"year":2013}}],"education":[{"schoolName":"University of Cambridge","degree":"Bachelor's degree","startedOn":{"year":2013},"endedOn":{"year":2016},"fieldsOfStudy":["Human, Social \\u0026 Political Sciences"]},{"schoolName":"City and Islington College","degree":"Access Diploma","startedOn":{"year":2012},"endedOn":{"year":2013},"fieldsOfStudy":["Mixed Media"]}]}

LinkedIn Account API

The Account API is the fastest and simplest way to export an individual’s LinkedIn Connections. This method does require the user to be logged in to LinkedIn and have their LinkedIn account connected to Lix, in order to access their connections list.

Exporting LinkedIn connections has a number of potential applications. For individuals, exporting their LinkedIn connections allows them to maintain a backup of their contacts, import that data into their CRM and potentially use that information for networking purposes outside of LinkedIn.

For companies, exporting their employees LinkedIn connections can help to build a database of potential leads or customers. This information can be used to support sales and marketing efforts, or to identify potential candidates for job openings within the organization.

1 API credit will return 10 connections.

Here is an example of an Account API call in Python:

import requests
url = "<https://api.lix-it.com/v1/connections?count=1000&start=0&viewer_id=alfie-lambert>"
payload={}
headers = {
  'Authorization': lix_api_key
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)

This call will return JSON, structured like this:

json { "connections_response": { "elements": [ Connection ], "paging": { "count": 10 } } }

The LinkedIn Search API endpoint allows you to export pages of search results, as you would from within the LinkedIn search. As well as People (standard LinkedIn) and Leads (Sales Navigator) search results, this is where you will find and export Posts and Jobs search data.*

*note: Jobs search results no longer contain the description, “posted by” and other data points. To export this data you will need to use the Jobs Enrichment endpoint.

For all variations of the Lix LinkedIn Search API you will need to provide the search result URL from LinkedIn:

People Search

The data available from People Search results provides less depth than the Profile API, as it will show the search result rather than the profile data. However, each API credit returns 10 results, as opposed to the Profile API which is 1 credit per profile. So if less data is needed for each individual, the People Search is a more cost-effective method.

As search results are tailored to the individual performing the search, you have the option to use the “viewer_id” parameter to view the search results as an individual. This viewer must be connected to Lix. Read more in the documentation.

Here is an example of an LinkedIn People Search API call in Python:

import requests

url = "<https://api.lix-it.com/v1/li/linkedin/search/people?viewer_id=alfie-lambert&url=https://www.linkedin.com/search/results/people/?keywords=lix&origin=SWITCH_SEARCH_VERTICAL&sid=%40%2Co>"

payload={}
headers = {
  'Authorization': lix_api_key
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)

This call will return JSON, structured like this:

{
  "searchResponse": {
    "people": [ Person ],
    "paging": { "count": 25, "start": 0, "total": 1000 },
  },
}

LinkedIn Job Search API

There are some super interesting use cases for tapping into a LinkedIn API to export LinkedIn Jobs search data:

Talent Sourcing: Companies can use the LinkedIn Jobs search data to identify potential candidates who match their job requirements and target them with relevant job postings or recruitment messages.

Competitor Analysis: Companies can use LinkedIn Jobs search data to analyse the job postings of their competitors and identify their hiring trends, skills requirements, and hiring volume.

Job Market Insights: Companies can use LinkedIn Jobs search data to get insights into job market trends, such as job titles, salaries, locations, and industries, to inform their talent acquisition strategies.

Sales Prospecting: Sales teams can use LinkedIn Jobs search data to identify companies that are hiring for specific positions, which could indicate growth or expansion, and target them with relevant sales messages or solutions.

Job Board Aggregation: Job board aggregators can use LinkedIn Jobs search data to aggregate job postings from LinkedIn and other job boards, and provide users with a comprehensive job search platform.

Again, you have the option to use the “viewer_id” parameter to view the search results as an individual. This viewer must be connected to Lix. Read more in the documentation.

Each credit will return 10 results – however the data is now limited. LinkedIn displays very little data in the Jobs search results, the majority is within the job posting itself for which you will need to use the Jobs Enrichment API.

Here is an example of a Job Search API call in Python:

import requests

url = "<https://api.lix-it.com/v1/li/linkedin/search/jobs?viewer_id=alfie-lambert&url=https://www.linkedin.com/jobs/search/?currentJobId=3436671233&keywords=lix>"

payload={}
headers = {
  'Authorization': lix_api_key
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)

This call will return JSON, structured like this:

{
  "searchResponse": {
    "people": [ JobPosting ],
    "paging": { "count": 10, "start": 0, "total": 1000 },
  },
}

LinkedIn Posts API

The Lix LinkedIn Posts API endpoint is exciting, because it offers real-time insights into the content that LinkedIn users are posting and sharing; which have a number of applications:

Social Listening: Companies can use the LinkedIn API to monitor what people are saying about their brand on LinkedIn. This can help them to quickly identify any negative feedback and respond to it in a timely manner.

Content Marketing: By analysing posts related to a particular industry or topic, companies can identify trends and create relevant content to engage their audience.

Competitive Intelligence: Companies can use the LinkedIn API to monitor the activity of their competitors on LinkedIn. This can help them to identify their strengths and weaknesses, and develop strategies to compete more effectively.

Sales Prospecting: Sales teams can use the LinkedIn API to identify potential customers by searching for posts related to their industry or pain points. This can help them to engage with potential customers and build relationships that can lead to sales.

Once again, you have the option of using the “viewer_id” parameter & each credit returns 10 results.

Here is an example of a Post Search API call in Python:

import requests

url = "<https://api.lix-it.com/v1/li/linkedin/search/posts?viewer_id=alfie-lambert&url=https://www.linkedin.com/search/results/CONTENT/?keywords=lix&origin=SWITCH_SEARCH_VERTICAL&sid=V2J>"

payload={}
headers = {
  'Authorization': lix_api_key
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)

This call will return JSON, structured like this:

{
  "searchResponse": {
    "posts": [ Post ],
    "paging": { "count": 10, "start": 0, "total": 1000 },
  },
}

Sales Navigator Leads Search API

The Sales Navigator Leads Search returns more data than the standard LinkedIn ‘People’ Search results, including Past Roles and Education – information otherwise only available from the Profile Enrichment endpoint. Also, as Sales Navigator shows 25 results per page, versus 10 per page from standard LinkedIn, you will receive 25 results per credit.

Once again, you have the option of using the “viewer_id” parameter.

Here is an example of a Sales Navigator Leads Search API call in Python:

import requests

url = "<https://api.lix-it.com/v1/li/sales/search/people?viewer_id=alfie-lambert&url=https://www.linkedin.com/sales/search/people?query=(spellCorrectionEnabled%3Atrue%2CrecentSearchParam%3A(id%3A2154062338%2CdoLogHistory%3Atrue)%2Ckeywords%3Alix>)&sessionId=GumqcP8vR0aPVWr3cNR74A%3D%3D"

payload={}
headers = {
  'Authorization': lix_api_key
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text){
  "searchResponse": {
    "people": [ Person ],
    "paging": { "count": 25, "start": 0, "total": 2500 },
  },
  "meta": {
    "sequenceId": "jAkFkdjfi19kFdf"
  }
}

This call will return JSON, structured like this:

{
  "searchResponse": {
    "posts": [ Post ],
    "paging": { "count": 10, "start": 0, "total": 1000 },
  },
}

LinkedIn Jobs Enrichment API

Much like the Profile Enrichment endpoint, Jobs Enrichment allows you to export a greater depth of data than the standard search results. Recently, LinkedIn changed the layout of Jobs search results. Whereas previously all Jobs post data was available in the search, now the deeper detail (description, posted by, etc.) is contained within the post:

The information in the green box is Jobs Search data. The information in the red box can now only be extracted via the Jobs Enrichment endpoint.

As with the Search API, the “viewer_id” parameter can be used in order to tailor the results to an individual but this individual must have their LinkedIn account connected to a Lix account.

1 API credit = 1 Enriched Jobs Post

Here is an example of a Jobs Enrichment API call in Python:

import requests

url = "<https://api.lix-it.com/v1/enrich/job?job_id=3556453411>"

payload={}
headers = {
  'Authorization': [lixApiKey]
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)

LinkedIn Company / Organisation Enrichment API

Organisation Enrichment allows you to export company data beyond standard search results, from within the full company profile. Much like Jobs (above), LinkedIn stripped back the amount of data available in the search. Now, companies searches only provide a few data points. To really delve into that firmographic data, you will need to enrich.

The difference between Organisation Enrichment and the other kind of enrichment, is that it’s a different kind of credit. Org Credits also work on a 1 call, 1 credit basis but credits are much cheaper in order to reflect the lower density of data available.

Here is an example of a Jobs Enrichment API call in Python:

import requests

url = "https://api.lix-it.com/v1/organisations/by-linkedin?linkedin_url=https://linkedin.com/company/linkedin"

payload={}
headers = {
  'Authorization': [lixApiKey]
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.json())

This call will return JSON, structured like this:

{
    "liOrganisation": {
        "name": "LinkedIn",
        "link": "https://www.linkedin.com/company/linkedin",
        "industry": "Computer Software",
        "website": "https://careers.linkedin.com",
        "description": "Founded in 2003, LinkedIn connects the world's professionals to make them more productive and successful. With more than 850 million members worldwide, including executives from every Fortune 500 company, LinkedIn is the world's largest professional network. The company has a diversified business model with revenue coming from Talent Solutions, Marketing Solutions, Sales Solutions and Premium Subscriptions products. Headquartered in Silicon Valley, LinkedIn has offices across the globe.",
        "headquarters": "Sunnyvale, US",
        "companyType": "Public Company",
        "liEmployeeCount": "26383",
        "size": "10001+",
        "specialities": "Online Professional Network, Jobs, People Search, Company Search, Address Book, Advertising, Professional Identity, Group Collaboration, Recruiting",
        "numberOfInvestmentRounds": "7",
        "followers": "25072627",
        "crunchbaseId": "linkedin",
        "salesNavLink": "https://www.linkedin.com/sales/accounts/insights?companyId=1337&trk=li_comp_page",
        "logoUrl": "https://media.licdn.com/dms/image/C560BAQHaVYd13rRz3A/company-logo_",
    }
}

LinkedIn Contact Information API

Looking to find the email address for anyone on LinkedIn, in real-time, connected directly to your internal applications? Look no further. The Lix LinkedIn Contact Information API endpoint allows you to find validated email addresses from LinkedIn.

This endpoint is a lead generation supercharger for any sales, marketing or talent / recruitment team. You can integrate this with your CRM to generate a valid email address for any potential lead, or find and validate emails for large leads lists. The possibilities are huge.

The command requires you to enter a LinkedIn profile URL, to return an email. These can be exported either using the Lix It tool or the LinkedIn Search API.

Unlike the other endpoints, the LinkedIn Contact Information API requires email credits as opposed to API credits. These can be added to your account in the same way as API credits.

1 Valid email credit = 1 valid email. We only charge when a valid email is found.

Here is an example of a LinkedIn Contact Information API call in Python:

import requests
url = "<https://api.lix-it.com/v1/contact/email/by-linkedin?url=https://www.linkedin.com/in/alfie-lambert>"
payload={}
headers = {
  'Authorization': lix_api_key
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)

This call will return JSON, structured like this:

json { "email": "*****@lix-it.com", "status": "VALID", "alternatives": ["*****@lix-it.com"] }

The Lix LinkedIn API provides a powerful solution for talent sourcing and recruitment, market research, sales prospecting, and competitive intelligence teams to access high-quality employment and firmographic data. With its real-time API, businesses can easily gather LinkedIn data and use it to their advantage. Whether it’s exporting LinkedIn profiles, job search data, company search data, or posts, the Lix LinkedIn API provides a wealth of opportunities for businesses to improve their operations and make data-driven decisions. So if you’re looking for a reliable and efficient way to access LinkedIn data, give Lix LinkedIn API a try and see how it can transform your business.

Don't miss the next instalment!

Get the next blog (and the next one!) to your inbox.