Tutorials

How to Access LinkedIn API - Step-by-Step Guide

Unlock the power of LinkedIn data with Scrapin. Explore insights, tips, and guides on leveraging the LinkedIn API for seamless data extraction and analysis
Julien Keraval
November 10, 2023
5 min

What’s a Rich Text element?

The rich text element allows you to create and format headings, paragraphs, blockquotes, images, and video all in one place instead of having to add and format them individually. Just double-click and easily create content.

Static and dynamic content editing

A rich text element can be used with static or dynamic content. For static content, just drop it into any page and begin editing. For dynamic content, add a rich text field to any collection and then connect a rich text element to that field in the settings panel. Voila!

How to customize formatting for each rich text

Headings, paragraphs, blockquotes, figures, images, and figure captions can all be styled after a class is added to the rich text element using the "When inside of" nested selector system.

LinkedIn has proven its worth as one of the most authentic professional networking platforms. It offers a wide array of structured data points for talent, marketing, sales, etc. Companies can access this data by using LinkedIn APIs (Application Programming Interface). An API serves as a gateway for integrating LinkedIn data into applications created by businesses.

As a result, businesses can offer a streamlined experience to their customers. However, the biggest challenge in this regard is to access LinkedIn’s data. To access this data, you can either use an official or unofficial LinkedIn API. To offer you a clear picture, we have explained both these options.

Apart from this, this post also talks about the challenges and issues that you might face when using the LinkedIn API. So, without any further ado, let’s dive in!

Why Access to LinkedIn API?

Being a central interface, a LinkedIn API allows developers to interact with LinkedIn account using a programming language. Hence, developers can scrape the vast LinkedIn network with a LinkedIn profile API.

Here are some of the reasons why you should use a LinkedIn API:

  • Extend business reach and strengthen online presence
  • Create data software
  • Get data insights for fostering connections
  • Get accurate professional information for Better brand marketing
  • Improves the outcome of marketing campaigns
  • Get accurate personal information for recruitment purposes

Besides, here are a few other benefits of accessing a LinkedIn API:

  • LinkedIn profiles API integration
  • Credential and content sharing
  • Extend brand exposure
  • Elevated app functionality
  • Streamlined user management

How to Access to LinkedIn API?

Accessing data of LinkedIn via API allows businesses to integrate the accessed data into their applications. APIs helps getting the most out of your LinkedIn search. It not only creates a seamless experience for the users but also enables new functionality.

However, accessing this data isn’t smooth sailing. Accessing the LinkedIn API tends to be a challenging task. It takes time and effort while extracting data from LinkedIn. Also, don't forget to carefully read the API documentation requirements.

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

  1. First way (Most Complex): Using the Official LinkedIn Partner API
  2. Second way (Quick and Easy): Using an Unofficial LinkedIn API like ScrapIn

Using the Official LinkedIn Partner API (Most Complex)

Getting access to LinkedIn Partner API is hard for startups. This is because you need approval from the LinkedIn team, which is a slow and challenging process. LinkedIn tends to be quite picky when granting access to its API. So, be prepared for the challenges you might encounter when accessing LinkedIn API.

There are 4 kinds of LinkedIn partner programs:

  1. Talent Solutions Partnership Request Form
  2. Marketing Developer Program
  3. Sales Navigator Application Platform
  4. LinkedIn Learning Integration Partner Program

Talent Solutions Partnership Request Form

By joining this program, LinkedIn allows you to integrate your products with LinkedIn Talent Solutions (LTS). LinkedIn prioritizes its LTS integrations to create an ecosystem that allows connecting talent with the most promising opportunities. This is also done to offer valuable insights to the recruiter. Besides, recruiters can also get comprehensive information about LinkedIn groups.

Talent Solutions Partnership Request Form

Below are the LTS integrations offered by this program. Make sure to review these integrations before submitting a request.

  • Recruiter System Connect
  • Apply Connect
  • Job Postings
  • Apply With LinkedIn

Marketing Developer Program

The LinkedIn Marketing Developer Platform allows businesses to grow by expanding their reach. It helps engage and convert professional audiences.

Marketing Developer Program

By using this platform, APIs can perform the following functions:

  • Develop LinkedIn marketing campaigns
  • Report campaign performance
  • Manage leads
  • Grow the company’s page

Sales Navigator Application Platform

The LinkedIn Sales Navigator Application Platform (SNAP) proves to be a handy program. It offers the most essential integrations, which allow access to the key Sales Navigator features throughout the sales stack.

Sales Navigator Application Platform

SNAP partnerships program offers the following integrations. Most of these are continuously updated to offer better functionality, look, and feel:

  • CRM
  • Business Intelligence
  • Marketing Automation
  • Web Conference
  • eSignature
  • Sales Acceleration

LinkedIn Learning Integration Partner Program

LinkedIn Learning runs a partner program with a wide range of LMS (Learning Management System) providers. This makes learning easy for the admins to learn seamlessly. You can learn to configure Blackboard and Canvas LTI implementation with LinkedIn Learning.

LinkedIn Learning Integration Partner Program

The following are the major benefits of joining the LinkedIn learning integration partner program:

  • Enabling the automatic uploads of learning content into the LMS
  • Allows learners to access the learning content seamlessly
  • Add course completion data and learner progress directly into the LMS

With deep integration and using APIs, LinkedIn Learning dynamically refreshes the content library. So, the admin no longer needs to upload the latest content to the LMS.

1.      Creating a LinkedIn App with a Developer Account

A LinkedIn developer account is essential for accessing the LinkedIn API. It allows you to create and manage applications that interact with LinkedIn's platform. To create a LinkedIn developer account, follow these steps:

Create an app in Linkedin developer platform

  1. Go to the LinkedIn Developer website (developer.linkedin.com) and sign in with your LinkedIn credentials.
  2. Once you’re signed in, navigate to the “My Apps” section.
  3. Click on “Create App” to start the app creation process.
  4. Fill out the required fields, including the name and description of your app, the website URL, and the OAuth 2.0 Redirect URLs.
  5. Take some time to carefully read and accept the LinkedIn API Terms of Use and the Developer Program Agreement.
  6. Click “Create App” to finish setting up your LinkedIn app.

By creating a LinkedIn developer account and registering your application, you gain access to the necessary credentials and permissions to interact with the LinkedIn API.

2.      Get Approved by LinkedIn Team

After creating a LinkedIn developer account, it’s time to get ready for the hardest part. In 2015, LinkedIn removed its API from public access, which means getting approval from the LinkedIn team takes a lot of time. Therefore, you need to show patience, as getting approval might take more time than you might expect.

3.      Obtaining API Keys

Once your app is created and the settings are configured, you can obtain your API keys. The API keys consist of a Client ID and a Client Secret. These keys are required to authenticate your app and make API requests.

To get your API keys:

  • Go to the “Auth” tab in your app’s settings in the developer dashboard.
  • Make a note of the Client ID and Client Secret values.
  • Keep the API keys secure and never share them publicly.
  • Fetch profile data via the official LinkedIn Profile API

Get Client ID and Client Secret from Linkedin developer platform

By using this method, you don’t need user permission. However, your application requires approval before you start using the People’s Profile API endpoint (Using a 2-legged OAuth).

Step by Step Guide to LinkedIn API Integration

Although these steps appear to be fairly straightforward, businesses usually encounter a lot of challenges when performing API integration. For instance, you might deal with the strict usage policies of LinkedIn or face the complexities associated with API integration.

Step 1: Using your application’s CLIENT_ID and CLIENT_SECRET, exchange for access_token.


const axios = require('axios');

const getAccessToken = async () => {
  const LI_ACCESS_TOKEN_EXCHANGE_URL = 'https://www.linkedin.com/oauth/v2/accessToken';
  const LINKEDIN_CLIENT_ID = 'your-client-id'; // Replace with your LinkedIn client ID
  const LINKEDIN_CLIENT_SECRET = 'your-client-secret'; // Replace with your LinkedIn client secret

  try {
    const response = await axios.post(LI_ACCESS_TOKEN_EXCHANGE_URL, null, {
      params: {
        grant_type: 'client_credentials',
        client_id: LINKEDIN_CLIENT_ID,
        client_secret: LINKEDIN_CLIENT_SECRET,
      },
    });
    return response.data.access_token;
  } catch (error) {
    console.error('Error fetching access token:', error);
    return null;
  }
};

// This method allow you to get your access token
getAccessToken().then((accessToken) => {
  if (accessToken) {
    console.log('Access Token:', accessToken);
  }
});

Step 2: Fetch any profile with profile_id


const axios = require('axios');

const getProfile = async (accessToken, profileId) => {
  const LI_PROFILE_API_ENDPOINT = `https://api.linkedin.com/v2/people/${profileId}`;

  try {
    const response = await axios.get(LI_PROFILE_API_ENDPOINT, {
      headers: {
        'Authorization': `Bearer ${accessToken}`,
        'X-RestLi-Protocol-Version': '2.0.0'
      }
    });
    return response.data;
  } catch (error) {
    console.error('Error fetching profile:', error);
    return null;
  }
};

// Replace 'access-token' with the actual access token and 'profile-id' with the actual profile ID
getProfile('access-token', 'profile-id').then((profileData) => {
  if (profileData) {
    console.log('Profile Data:', profileData);
  }
});

Important Note: It is imperative to understand that a LinkedIn official API only allows retrieving LinkedIn profile data from a profile ID. This suggests you can’t use the official LinkedIn API if you only have a profile slug or LinkedIn profile URL. If this is the case, you need an unofficial API like ScrapIn API. This API makes it possible to retrieve LinkedIn data from profile ID and profile slug (LinkedIn profile URL).

Using ScrapIn LinkedIn API (Quick and Easy)

Step 1: Sign up to ScrapIn website

ScrapIn website

Step 2: Get your API key

Get ScrapIn LinkedIn API key

Step 3: Fetch any profile with profile_id or LinkedIn URL


const axios = require('axios');

const API_KEY = 'YOUR_API_KEY'; // Replace with your API key from the Scrapin dashboard
const LINKEDIN_TARGET = 'LINKEDIN_URL_OR_PROFILE_ID'; // Replace with the LinkedIn URL or profile ID you want to fecth

const getLinkedInProfile = async () => {
  const endpoint = `https://api.scrapin.io/enrichment/profile?apikey=${API_KEY}&linkedinUrl=${LINKEDIN_TARGET}`;

  try {
    const response = await axios.get(endpoint);
    console.log('Data:', response.data);
  } catch (error) {
    console.error('Error:', error);
  }
};

getLinkedInProfile();

Step 4: Then you will have all this data in JSON response (example with https://www.LinkedIn.com/in/williamhgates/ LinkedIn URL):


{
  "success": true,
  "person": {
    "publicIdentifier": "williamhgates",
    "linkedInIdentifier": "ACoAAA8BYqEBCGLg_vT_ca6mMEqkpp9nVffJ3hc",
    "firstName": "Bill",
    "lastName": "Gates",
    "headline": "Co-chair, Bill & Melinda Gates Foundation",
    "location": "Seattle, Washington United States",
    "photoUrl": "https://media.licdn.com/dms/image/xxxxxxxxxx",
    "creationDate": {
      "month": 5,
      "year": 2013
    },
    "followerCount": 34903132,
    "connectionCount": 9,
    "positions": {
      "positionsCount": 3,
      "positionHistory": [
        {
          "startEndDate": {
            "start": {
              "year": 2000
            }
          },
          "title": "Co-chair",
          "companyName": "Bill & Melinda Gates Foundation",
          "companyLogo": "https://media.licdn.com/dms/image/xxxxxxxxxxxx",
          "linkedInUrl": "https://www.linkedin.com/company/8736/"
        },
        {
          "startEndDate": {
            "start": {
              "year": 2015
            }
          },
          "title": "Founder",
          "companyName": "Breakthrough Energy ",
          "companyLogo": "https://media.licdn.com/dms/image/xxxxxxxxxx",
          "linkedInUrl": "https://www.linkedin.com/company/19141006/"
        },
        {
          "startEndDate": {
            "start": {
              "year": 1975
            }
          },
          "title": "Co-founder",
          "companyName": "Microsoft",
          "companyLogo": "https://media.licdn.com/dms/image/xxxxxxxxx",
          "linkedInUrl": "https://www.linkedin.com/company/1035/"
        }
      ]
    },
    "schools": {
      "educationsCount": 2,
      "educationHistory": [
        {
          "startEndDate": {
            "start": {
              "year": 1973
            },
            "end": {
              "year": 1975
            }
          },
          "schoolName": "Harvard University",
          "schoolLogo": "https://media.licdn.com/dms/image/xxxxxxxxx",
          "linkedInUrl": "https://www.linkedin.com/company/1646/"
        },
        {
          "schoolName": "Lakeside School",
          "schoolLogo": "https://media.licdn.com/dms/image/xxxxxxxxxx",
          "linkedInUrl": "https://www.linkedin.com/company/30288/"
        }
      ]
    },
    "summary": "Co-chair of the Bill & Melinda Gates Foundation. Founder of Breakthrough Energy. Co-founder of Microsoft. Voracious reader. Avid traveler. Active blogger.",
    "skills": [
      
    ]
  },
  "company": {
    "websiteUrl": "https://www.gatesfoundation.org/about/careers",
    "name": "Bill & Melinda Gates Foundation",
    "logo": "https://media.licdn.com/dms/image/xxxxxxxxx",
    "employeeCount": 3509,
    "description": "We are optimists on a mission to create a world where every person has the chance to live a healthy, productive life. \n\nIn developing countries, the Bill and Melinda Gates Foundation focuses on improving people’s health and giving them the chance to lift themselves out of hunger and extreme poverty. In the United States, it seeks to ensure that all people—especially those with the fewest resources—have access to the opportunities they need to succeed in school and life. ",
    "tagline": "We are a nonprofit organization fighting poverty, disease, and inequity around the world.",
    "specialities": [
      "Global Health",
      "Global Development",
      "US Education",
      "Gender Equality"
    ],
    "headquarter": {
      "country": "US",
      "geographicArea": "WA",
      "city": "Seattle",
      "postalCode": "98109"
    },
    "industry": "Non-profit Organizations",
    "universalName": "bill-&-melinda-gates-foundation",
    "linkedinUrl": "https://www.linkedin.com/company/bill-&-melinda-gates-foundation/",
    "linkedinId": "8736"
  },
  "credits_left": 98950,
  "rate_limit_left": 19748
}

Final Thoughts

LinkedIn API offers businesses a vast range of opportunities, allowing them to accomplish their marketing goals. By utilizing appropriate tools and adopting a strategic approach, businesses can incorporate the LinkedIn API into their existing systems.

However, integrating an official LinkedIn API might be difficult for the developers. This is the area where an unofficial API like ScrapIn comes into play. ScrapIn proves to be a hassle-free way to integrate LinkedIn data into software. So, you can rely on this LinkedIn API for seamless integration with LinkedIn data.

Try for free now

Try ScrapIn now for fresh and reliable results!