fetchPerson
This method allows you to retrieve various data about a person: basic information, experience, education, skills, languages, posts, comments, and reactions.
try {
const workflowId = await linkedapi.fetchPerson.execute({
personUrl: "https://www.linkedin.com/in/john-doe",
retrieveExperience: true,
retrieveEducation: true,
retrieveSkills: true,
retrieveLanguages: true,
retrievePosts: true,
retrieveComments: true,
retrieveReactions: true,
postsRetrievalConfig: {
limit: 20,
since: "2024-01-01T00:00:00Z"
},
commentsRetrievalConfig: {
limit: 15,
since: "2024-01-01T00:00:00Z"
},
reactionsRetrievalConfig: {
limit: 10,
since: "2024-01-01T00:00:00Z"
}
});
const { data, errors } = await linkedapi.fetchPerson.result(workflowId);
// The list of possible execution errors is below
if (errors && errors.length > 0) {
console.warn('Workflow completed with execution errors:');
errors.forEach(error => {
console.warn(` - Type: ${error.type}, Message: ${error.message}`);
});
}
// The structure of the 'data' object is below
if (data) {
console.log('Person name:', data.name);
console.log('Headline:', data.headline);
console.log('Location:', data.location);
console.log('Experience:', data.experience);
console.log('Education:', data.education);
console.log('Skills:', data.skills);
console.log('Languages:', data.languages);
console.log('Posts:', data.posts);
console.log('Comments:', data.comments);
console.log('Reactions:', data.reactions);
console.log('Workflow completed successfully. Data:', data);
}
} catch (e) {
// A list of all critical errors can be found here:
// https://linkedapi.io/sdks/handling-results-and-errors/#handling-critical-errors
if (e instanceof LinkedApiError) {
console.error(`Critical Error - Type: ${e.type}, Message: ${e.message}`);
} else {
console.error('An unexpected, non-API error occurred:', e);
}
}
# Python SDK is coming soon!
#
# You can always use Linked API through HTTP
# https://linkedapi.io/docs/
// Go SDK is coming soon!
//
// You can always use Linked API through HTTP
// https://linkedapi.io/docs/
Params
personUrl– public or hashed LinkedIn URL of the person you want to retrieve data for.retrieveExperience(optional) – when set totrue, includes work experience and job history in the results.retrieveEducation(optional) – when set totrue, includes educational background and degrees in the results.retrieveSkills(optional) – when set totrue, includes skills and endorsements in the results.retrieveLanguages(optional) – when set totrue, includes languages and proficiency levels in the results.retrievePosts(optional) – when set totrue, includes recent posts and articles in the results.retrieveComments(optional) – when set totrue, includes comments made by the person in the results.retrieveReactions(optional) – when set totrue, includes reactions/likes given by the person in the results.postsRetrievalConfig(optional) – configuration for retrieving posts. Available only ifretrievePostsistrue.limit(optional) – number of posts to retrieve. Defaults to 20, with a maximum value of 20.since(optional) – timestamp to filter posts published after the specified time.
commentsRetrievalConfig(optional) – configuration for retrieving comments. Available only ifretrieveCommentsistrue.limit(optional) – number of comments to retrieve. Defaults to 20, with a maximum value of 20.since(optional) – timestamp to filter comments made after the specified time.
reactionsRetrievalConfig(optional) – configuration for retrieving reactions. Available only ifretrieveReactionsistrue.limit(optional) – number of reaction to retrieve. Defaults to 20, with a maximum value of 20.since(optional) – timestamp to filter reactions made after the specified time.
Data
name– full name of the person.publicUrl– public LinkedIn URL of the person.hashedUrl– hashed LinkedIn URL of the person.headline– headline of the person.location– free-form string indicating the person's location.countryCode– two-character code of the person's country.position– current job position of the person.companyName– name of the person's current company.companyHashedUrl– hashed LinkedIn URL of the person's current company.followersCount– number of followers the person has.experiences– array of work experience entries (included only ifretrieveExperienceistrue).position– job position held by the person.companyName– name of the company where the person worked.companyHashedUrl– hashed LinkedIn URL of the company where the person worked.employmentType– type of employment. Enum with the following values:fullTime– full-time employment.partTime– part-time employment.selfEmployed– self-employed work.freelance– freelance work.contract– contract-based employment.internship– internship position.apprenticeship– apprenticeship program.seasonal– seasonal employment.
locationType– type of location. Enum with the following values:remote– position is fully remote.onSite– position requires on-site work.hybrid– position is a mix of remote and on-site work.
description– description of the job or responsibilities.duration– number of months the person worked in the position.startTime– timestamp of the first day of the month when the person started the position.endTime– timestamp of the last day of the month when the person ended the position. Returnsnullif the person is still working in this position.location– free-form string indicating the location of the position.
education– array of education entries (included only ifretrieveEducationistrue).schoolName– name of the institution.schoolHashedUrl– hashed LinkedIn URL of the institution.details– information about the person's education, such as the degree, major, field of study, and other related details.
skills– array of skills (included only ifretrieveSkillsistrue).name– name of the skill.
languages– array of languages with proficiency levels (included only ifretrieveLanguagesistrue).name– name of the language.proficiency– proficiency level in the language. Enum with the following possible values:elementary– basic understanding.limitedWorking– limited ability for routine tasks.professionalWorking– effective in professional settings.fullProfessional– near-native proficiency.nativeOrBilingual– fluent, like a native speaker.
posts– array of recent posts and articles (included only ifretrievePostsistrue).url– URL of the post.time– timestamp when the post was published.type– type of the post. Enum with possible values:original– for original posts.repost– for reposts.
repostText– additional text added during repost, if applicable.text– text content of the post, if available.images– array of top 3 preview image URLs, if available.hasVideo– boolean indicating if the post contains a video.hasPoll– boolean indicating if the post contains a poll.reactionsCount– number of reactions on the post.commentsCount– number of comments on the post.repostsCount– number of reposts on the post.
comments– array of person comments (included only ifretrieveCommentsistrue).postUrl– URL of the post the comment belongs to.time– timestamp when the comment was left.text– text content of the comment, if available.image– URL of the comment's image, if available.reactionsCount– number of reactions on the comment.
reactions– array of person reactions (included only ifretrieveReactionsistrue).postUrl– URL of the post the reaction belongs to.time– timestamp when the reaction was made.type– enum describing the reaction type. May take one of the following values:like– standard "like".celebrate– celebrates an achievement.support– shows support.love– expresses love or admiration.insightful– appreciates insightful content.funny– reacts to something humorous.
Errors
personNotFound– provided URL is not an existing LinkedIn person.