Fetch user profile
Learn how to fetch complete user profiles on LinkedIn using Unipile API.
Get basic user profile
To get the profile of a user, use the Get a User Profile endpoint, specifying the ID of the user.
You may also want to select a variant, which allows you to specify the product with which you want to retrieve the profile.
Note about variantsOn LinkedIn, there are 3 variants of the same profile :
linkedin_classic: The profile is from Classic. Specify the additional sections to be retrieved beyond the basic profile in the parameterwith_sections. In this variant, the user ID can be either a system ID (ACo...) or a public identifier (e.g.johndoeinwww.linkedin.com/in/johndoe/).linkedin_recruiter: The profile is from Recruiter. All sections are included, with additional data specific to the product (e.g. tags, notes, recruiting activities).linkedin_sales_navigator: The profile is from Sales Navigator. All sections are included, with additional data specific to the product (e.g. lists).
Note about sectionsOn LinkedIn Classic, retrieving a large number of profile sections may result in multiple consecutive requests. As a result, LinkedIn may throttle those section requests if they are made in excess over a short period of time.
The
with_sectionsparameter allows you to specify the sections that should be included. In general, it is recommended to include only the necessary sections. To further reduce the risk of having your requests throttled, you can add the_previewsuffix to the least critical sections. This method returns only the first entries of a section, exactly as they are presented on a LinkedIn profile.You can also combine sections: for example,
["linkedin_*_preview", "linkedin_experience", "linkedin_skills"]will return all sections in preview mode except experience and skills in full.
The
with_sectionsparameter has no effect on Recruiter and Sales Navigator.
const { data } = await usersApi.getUserProfile({
path: {
account_id: "acc_123456789",
user_id: "user_id",
},
query: {
with_sections: ['linkedin_*_preview', 'linkedin_experience', 'linkedin_skills']
},
});profile = users_api.get_user_profile(
"user_id",
"acc_123456789",
with_sections=["linkedin_*_preview", "linkedin_experience", "linkedin_skills"],
)curl --request GET \
--url https://api.unipile.com/v2/account_id/users/user_id?with_sections=linkedin_*_preview&with_sections=linkedin_experience&with_sections=linkedin_skills \
--header 'accept: application/json'Notify profile visit
In the LinkedIn application, visiting a profile triggers a notification to the user whose profile was visited (provided that the option has been activated).
This is not an automatic action.
To reproduce this behavious, you will first need to retrieve the value of the field notify_visit_token from the result of the Get a User Profile endpoint. Then use the Report a Profile Visit endpoint, specifying the value of the token.
RecommendationIn order to maintain a natural LinkedIn-like experience, ensure that the use of this method is immediately subsequent to the profile visit.
await usersApi.visitUserProfile({
path: {
account_id: "acc_123456789",
},
query: {
token: "token",
},
});users_api.visit_user_profile("token", "acc_123456789")curl --request POST \
--url https://api.unipile.com/v2/account_id/users/visit-profile?token=abcdef1234567 \
--header 'accept: application/json'List relations of a user
To get a list of a user's relations, use the List Relations of a User endpoint, specifying the ID of the user in question.
Specific use cases
- To list the relations of your own account, set
user_idtome.- The
searchfield can be used to filter users by name.- Pagination on this method uses exclusively the
offsetparameter.
const { data } = await usersApi.getUserRelations({
path: {
account_id: "acc_123456789",
user_id: "user_id",
},
});relations = users_api.get_user_relations("user_id", "acc_123456789")curl --request GET \
--url https://api.unipile.com/v2/account_id/users/user_id/relations \
--header 'accept: application/json'List followers of a user
To get a list of a user's followers, use the List Followers of a User endpoint, specifying the ID of the user in question.
Specific use cases
- To list the followers of your own account, set
user_idtome.- Pagination on this method uses exclusively the
offsetparameter.
const { data } = await usersApi.listUserFollowers({
path: {
account_id: "acc_123456789",
user_id: "user_id",
},
});followers = users_api.list_user_followers("user_id", "acc_123456789")curl --request GET \
--url https://api.unipile.com/v2/account_id/users/user_id/followers \
--header 'accept: application/json'List users followed by a user
You cannot list users followed by someone else then you.
To get a list of your own account's following, use the List Users followed by a User endpoint, specifying me in the user_id parameter.
Specific use cases
- Pagination on this endpoint uses exclusively the
offsetparameter.
const { data } = await usersApi.listUserFollowing({
path: {
account_id: "acc_123456789",
user_id: "me",
},
});following = users_api.list_user_following("me", "acc_123456789")curl --request GET \
--url https://api.unipile.com/v2/account_id/users/user_id/followings \
--header 'accept: application/json'Updated 3 months ago