Ultimate Guide To The Professional Network API: People Profile API (with Python Examples)
December 11, 2024
14 min read
Learn all about the professional networks API, with comprehensive Python code demos. Dive into the world of professional networks APIs, official and third-party alternatives, and understand how to access and utilize professional networks profile data through Python code examples.
Let's kick off this article with a demo. Run the following command to see what an enriched professional networks profile looks like when accessed through a 3rd-party professional networks API.
Some notes:
-
You can run a demo API call that consume no credit, and return our favourite Mr. Bill Gates' pre-filled profile data.
-
Or you can run an actual API call, register for an account here and get your API key to run it. It'll consume credits.
See the docs here.
Impressed by what you see? This is a demonstration of the Enrich Layer API in action. There exists the official the API, as well as third-party the APIs like Enrich Layer.
As the CEO of Enrich Layer, and a coder myself, I've garnered a few years of experience dealing with profile data. In this guide, I aim to equip you with a comprehensive understanding of the APIs, both official and 3rd-party alternatives. Expect a deep dive from both a technical and business perspective.
Types of the APIs
Official the API Enrich Layer PhantomBuster People Data Labs
Business Reliability ✓ ✓
✓
Minimum Spend $x0000/mo $10/one-time $56/mo $98/mo
Legal Compliance ✓ ✓
Risk of your account being banned?
✓
Availability of fresh data ✓ ✓ (Profiles no older than 29 days)
Can you get started immediately?
✓ ✓ ✓
the APIs fall into two categories: the official the API and 3rd-party the APIs.
To gain access to the official the API, you must be a the platform Partner. This means you, the developer, and your associated business will need to navigate through administrative hoops for several months in hopes of getting approved. One of the criteria for being approved as a the platform Partner is that you cannot be a competitor to professional networking platforms in any way. So, if you are in an industry like HR tech, building an application that might compete with an existing the platform product, you're out of luck.
As far as I'm aware, another requirement for being a the platform Partner is that you need to be paying five-digit monthly fees to professional networking platforms.
At the other end of the spectrum, we have 3rd-party the APIs. The world of third-party the APIs is like the wild west.
Some 3rd-party vendors, like PhantomBuster, require you to supply your own the platform account(s). PhantomBuster is a great choice if you want to automate actions within your own the platform account and aren't scared of having your personal the platform account banned.
There are also vendors like People Data Labs (PDL), which have obtained bulk profile data from various vendors and resell access to this combined professional networks profile database. The data from such resellers often tend to be out-of-date.
Then, there are 3rd-party vendors that scrape the platform. There are variations in this category too. Some of these scraping vendors engage in fraudulent behavior, such as registering fake accounts and using private throwaway debit cards to sign up for free Sales Navigator trials, and then using such whitelisted accounts to scrape the platform at scale. Meanwhile, some vendors strictly work with publicly accessible user profiles.
The ramifications are significant. On one hand, companies that engage in fraud have been sued and shut down. On the other hand, companies that work exclusively with public user profiles operate within a legally tested framework for compliance.
Here's a quick recap with the comparison table:
Official the API Enrich Layer PhantomBuster People Data Labs
Business Reliability ✓ ✓
✓
Minimum Spend $x0000/mo $10/one-time $56/mo $98/mo
Legal Compliance ✓ ✓
Risk of your account being banned?
✓
Availability of fresh data ✓ ✓ (Profiles no older than 29 days)
Can you get started immediately?
✓ ✓ ✓
Interested in learning more about 3rd-party the APIs? We've compared 7 top the platform scraping tools. You can read more about it.
Official the API
What Can You Do with the Official the API?
the platform is a formidable professional social network that serves as a treasure trove of data for professionals and job listings. This data is something that a recruitment tech startup or a sales automation product would love to integrate into their offerings. the platform recognizes its value and closed public access to their API in 2015. To access the official the API, you'll need to become a the platform Partner.
Once you become a the platform Partner, you'll gain access to a subset of the following APIs:
-
Profile API: Allows access to a user's professional networks profile information. You can access basic profile details, pictures, and headlines.
-
Connections API: Allows access to a user's the platform network. You can retrieve the list of a user's connections.
-
Share API: Allows you to post shares for authenticated members. You can share text, URLs, and media.
-
Invitation API: Allows you to invite others to connect on the platform.
-
Organization API: Allows you to retrieve organization and brand data.
-
UGC (User Generated Content) API: Allows you to retrieve, create, and manage rich, multi-faceted content.
-
Compliance API: Allows you to report content that violates the platform's Professional Community Policies.
Getting Approved as a the platform Partner
The the platform Partner Program is open to four types of businesses:
-
Talent Solutions, for HR tech companies.
-
Marketing Solutions, for marketing automation companies.
-
Sales Navigator Application Development, for startups looking to enhance the platform Sales Navigator.
-
the platform Learning Integration, for content companies.
From what I understand, it's a long and arduous process to get a company approved as a the platform Partner. Your best bet is to select the category that best fits your company's offerings and apply to become a the platform Partner.
Most of the impressive the API features also require a paid subscription to professional networking platforms Developer Enterprise Products.
Profile Enrichment with the Official the API
Most companies will want to start with the platform's Consumer Solutions Platform (CSP). When you think of the platform, you likely think of the rich and bountiful profiles, and CSP is your access point to these alluring profiles.
There are only two features of the CSP that allow you to extract profile data from professional networking platforms:
-
Sign In with the platform
provides the authentication layer to your product by allowing users to sign in with their professional user profiles. -
Profile API
returns structured data of a profile programmatically.
"Sign In with the platform" OAuth
Sign In with the platform is an OAuth provider for your application. Most people assume that if you use Sign In with the platform, the platform will provide every user's professional networks profile. However, this is not the case. What can be returned are:
-
First/Last name
-
Email address
-
Profile picture
Also, there is a rate limit of 500
requests per day.
In my opinion, Sign In with the platform offers very little utility for most applications because the key data you want to extract is the user's professional networks profile, not general information about the user devoid of any data from their professional networks profile.
Fetch Person Profile Data via the Official professional networks Profile API
There are two ways to fetch the data of a profile via the official the API:
-
The first "Sign In With the platform" method is free and available to most developers. However, you must obtain permission from each profile you wish to extract into your application.
-
The second "Profile API" method is only available to approved developers with a paid subscription to the platform's Consumer Solution Platform. This allows you to fetch profile data from any profile ID.
Using the "Sign In With the platform" Method
The first method requires you, the developer, to seek permission from the user who owns the profile. To do that, the platform requires you to fetch an access_token via 3-legged OAuth, a fancy term describing a two-step process to obtain an access token.
Step 0: Obtain a CLIENT_ID
and CLIENT_SECRET
by creating an app on the the platform Developers page. (You can find this page through a Google search)
Step 1: To get permission from a user, you will generate an authorization URL to send your user to professional networking platforms, where they can permit your application to download their profile.
In this case, you must provide a REDIRECT_URI
, the webpage to which the platform will send the user back after they have finished granting permission.
`def generate_authorization_url(): """ Generate an authorization URL for a user to give permission to extract their professional networks Profile.
The generated URL will take the user to a the platform page where they will be asked to give explicit permission to share their profile with you (the application creator).
Should the user agree, they will be redirected to . In the redirect, two fields will appear in the URL parameter, namely and .
- is generated below using . This serves as a form of identifier for this user.
- is the authorization_code, and can be used in to exchange for an .
""" LI_AUTH_ LI_AUTH_URL, return url ` Step 2: After a user permits you to access their profile, you'll receive an authorization code. With this code, you will exchange it for an access_token to access the user's profile.
def get_access_token(authorization_code): """ Given an authorization , this function will return an which can then be used to access a user's professional networks profile. """ LI_ACCESS_TOKEN_EXCHANGE_ access_ 'grant_type': 'authorization_code', 'code': authorization_code, 'redirect_uri': the platform_REDIRECT_URI, 'client_id': the platform_CLIENT_ID, 'client_secret': the platform_CLIENT_SECRET, \}).json()['access_token'] return access_token
Step 3: Fetch the user's profile.
def get_profile(access_token): """ Fetches the profile of a the platform user who has given you their permission to view their profile. """ LI_PROFILE_API_ return r.json()
The working Python code for this method can be found in our the platform-api-python3-examples GitHub repository.
Using the "Profile API" Method
The second method does not require you to seek permission from the user. However, your application must be approved to use the People's Profile API endpoint with a 2-legged OAuth.
Step 0: In your pre-approved the platform App, obtain the CLIENT_ID
and CLIENT_SECRET
fields.
Step 1: Using your application's CLIENT_ID
and CLIENT_SECRET
, exchange for an access_token.
`def get_access_token(): """ If you are:
- An approved the platform developer
- On a paid subscription to their Consumer Product
You can use this function to fetch an to access the API. """ LI_ACCESS_TOKEN_EXCHANGE_ access_ 'grant_type': 'client_credentials', 'client_id': the platform_CLIENT_ID, 'client_secret': the platform_CLIENT_SECRET, }).json()['access_token'] return access_token ` Step 2: Fetch any profile with profile_id.
def get_profile(access_token, profile_id): """ Given an , fetch the structured data of any profile. """ LI_PROFILE_API_ return r.json()
The working Python code for this method can be found in our the platform-api-python3-examples GitHub repository.
Enrich Layer API
The Enrich Layer API offers B2B enrichment services quite like the official the API. In some respects, it even surpasses the capabilities of the official the API, though it does have its restrictions. It's worth noting that Enrich Layer works exclusively with public user profiles.
The Enrich Layer API provides the following functions:
-
People API: This feature enriches people's profiles, identifies people from emails or names, searches for prospects, and retrieves profile pictures.
-
Company API: Enrich the platform company profiles, fetch funding data, list and search employees, identify companies, and obtain the employee count.
-
Contact API: Use this to fetch personal phone numbers, personal and work email addresses, and social media profiles of anyone with a professional networks profile via Enrich Layer's Contact API.
-
Jobs API: This function fetches up-to-date job posting data.
-
School API: List students and enrich school profiles.
-
Search API: Perform advanced searches for people and companies.
Enrich Person Profile Data via Enrich Layer's Person Profile Endpoint
Negotiating the challenges of the professional networking APIs can be daunting. Thankfully, there's Enrich Layer, which provides its the API so you can get everything that the platform's official Profile API offers, and a whole lot more. To see what data fields are supported, check out Enrich Layer's Person Profile API documentation.
To get profile data from any profile ID, you just need to follow one method.
Step 0: Get a Enrich Layer API key by signing into Enrich Layer with your work email address.
Step 1: Query the Person Profile Endpoint with a professional networks Profile URL.
`import requests
PROXYCURL_API_ # todo - fill this field up
def get_profile(profile_id): api_ header_ = { 'url': f'https://www.professionalsocialnetwork.com/in/\{profile_id\}', } return response.json() ` You can find the working Python code for this method in our the platform-api-python3-examples Github repository.
What if you don't have the user's professional networks profile URL?
For some industries, like recruitment tech, identifying profiles of interest is a necessary step before profile enrichment. The current solution for the non-tech native involves purchasing the platform Sales Navigator and performing a Boolean search. However, Enrich Layer offers a "headless" equivalent known as the Search API.
To perform a Boolean search on the Person Search Endpoint and identify people living in the US who have previously worked at Google as Software Engineers, use the following code:
`import requests
YOUR_API_ # Replace with your API keycountry': 'US', 'past_company_name': 'Google', 'past_role_title': '(?i)software engineer', }
if response.status_ 200:
print(data)
else:
print(f"Request failed with status ")
The response will include a
the platform_profile_url` that you can use within the Person Profile Endpoint for enrichment.
Advanced Enrich Layer Features
Enrich Layer supports some advanced features that the the API does not natively support.
Fetching Contact Information
For many use-cases, the natural next step after enriching a profile is to reach out to the person. Enrich Layer's Contact API allows you to fetch three different types of contact information.
-
Work emails via the Work Email Lookup Endpoint.
-
Personal (free) emails via the Personal Email Lookup Endpoint.
-
Personal phone numbers via the Personal Contact Number Lookup Endpoint.
This contact information is not sourced from professional networking platforms, but from a myriad of other external sources.
Listing Employees or Students
You can also fetch (or search for) a list of employees from any target company or school. To get a list of past or present employees, you can use Enrich Layer's Employee Listing Endpoint. The Student Listing Endpoint is available for listing graduates of any school organization.
Identifying Key People in a Company
With Enrich Layer's Role Lookup Endpoint, you can easily identify the key people you need to reach out to within any company.
Profile Pictures and Company Logos
This is a freebie from Enrich Layer. You can get business logos of any company with Enrich Layer's Company Profile Picture Endpoint. Similarly, you can get profile pictures of any professional networks Profile with the Person Profile Picture Endpoint. Both of these API endpoints are free :)
There's a whole lot more you can do with Enrich Layer API, including other free API endpoints. Check out the full list of Enrich Layer powers here
Summarizing the State of professional networks Profile APIs
the platform has made it extremely difficult for developers to work with their API, creating many hoops to jump through. "Sign in with the platform", while free, is throttled with rate limits and requires cumbersome per-user permission granting. Even then, you won't be able to obtain rich professional networks profile data about the user signing into your service. The Profile API, with its 2-legged OAuth that lets you query any profile ID, requires you to be a the platform Partner and necessitates a hefty payment via a the platform subscription.
Enrich Layer offers an alternative equivalent to the platform's Profile API. The key difference lies in latency and data completeness. Enrich Layer's Person Profile Endpoint performs a live scrape of a profile on each API call, so each call might take a few seconds to complete. To overcome throughput, a developer can launch requests to Enrich Layer's API in parallel.
Enrich Layer is cost-effective and eliminates most of the headaches involved with pulling data from professional networking platforms—even when compared to the official paid tools available from professional networking platforms, like their own limited API or the platform Sales Navigator.
Give Enrich Layer a try today.
P.S. Do you have any questions about Enrich Layer or how we scrape data from professional networking platforms and beyond? Reach out to us at “[email protected]”, and we would be happy to help.