# fetchPerson

This method allows you to retrieve various data about a person: basic information, experience, education, skills, languages, posts, comments, and reactions.

```typescript
try {
  const workflow = 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(workflow.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
from linkedapi import FetchPersonParams, LinkedApiError

try:
    workflow = linkedapi.fetch_person.execute(
        FetchPersonParams(
            person_url="https://www.linkedin.com/in/john-doe",
            retrieve_experience=True,
            retrieve_education=True,
            retrieve_skills=True,
            retrieve_languages=True,
            retrieve_posts=True,
            retrieve_comments=True,
            retrieve_reactions=True,
            posts_retrieval_config={"limit": 20, "since": "2024-01-01T00:00:00Z"},
            comments_retrieval_config={"limit": 15, "since": "2024-01-01T00:00:00Z"},
            reactions_retrieval_config={"limit": 10, "since": "2024-01-01T00:00:00Z"},
        )
    )

    result = linkedapi.fetch_person.result(workflow.workflow_id)
    data = result.data
    errors = result.errors

    # The list of possible execution errors is below
    if errors:
        print("Workflow completed with execution errors:")
        for error in errors:
            print(f" - Type: {error.type}, Message: {error.message}")

    # The structure of the 'data' object is below
    if data:
        print("Person name:", data.name)
        print("Headline:", data.headline)
        print("Location:", data.location)
        print("Experience:", data.experiences)
        print("Education:", data.education)
        print("Skills:", data.skills)
        print("Languages:", data.languages)
        print("Posts:", data.posts)
        print("Comments:", data.comments)
        print("Reactions:", data.reactions)
        print("Workflow completed successfully. Data:", data)
except LinkedApiError as e:
    # A list of all critical errors can be found here:
    # https://linkedapi.io/sdks/handling-results-and-errors/#handling-critical-errors
    print(f"Critical Error - Type: {e.type}, Message: {e.message}")
except Exception as error:
    print("An unexpected, non-API error occurred:", error)
```

## Params

- `personUrl` – [public or hashed](/faq/what-are-hashed-url-and-public-url) LinkedIn URL of the person you want to retrieve data for.
- `retrieveExperience` (optional) – when set to `true`, includes work experience and job history in the results.
- `retrieveEducation` (optional) – when set to `true`, includes educational background and degrees in the results.
- `retrieveSkills` (optional) – when set to `true`, includes skills and endorsements in the results.
- `retrieveLanguages` (optional) – when set to `true`, includes languages and proficiency levels in the results.
- `retrievePosts` (optional) – when set to `true`, includes recent posts and articles in the results.
- `retrieveComments` (optional) – when set to `true`, includes comments made by the person in the results.
- `retrieveReactions` (optional) – when set to `true`, includes reactions/likes given by the person in the results.
- `postsRetrievalConfig` (optional) – configuration for retrieving posts. Available only if `retrievePosts` is `true`.
  - `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 if `retrieveComments` is `true`.
  - `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 if `retrieveReactions` is `true`.
  - `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](/faq/what-are-hashed-url-and-public-url) LinkedIn URL of the person.
- `hashedUrl` – [hashed](/faq/what-are-hashed-url-and-public-url) 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](/faq/what-are-hashed-url-and-public-url) LinkedIn URL of the person's current company.
- `about` – "About" section text from the person's profile.
- `followersCount` – number of followers the person has.
- `avatarUrl` – URL of the person's profile photo, or `null` if the person has no photo.
- `experiences` – array of work experience entries (included only if `retrieveExperience` is `true`).
  - `position` – job position held by the person.
  - `companyName` – name of the company where the person worked.
  - `companyHashedUrl` – [hashed](/faq/what-are-hashed-url-and-public-url) 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. Returns `null` if 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 if `retrieveEducation` is `true`).
  - `schoolName` – name of the institution.
  - `schoolHashedUrl` – [hashed](/faq/what-are-hashed-url-and-public-url) 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 if `retrieveSkills` is `true`).
  - `name` – name of the skill.
- `languages` – array of languages with proficiency levels (included only if `retrieveLanguages` is `true`).
  - `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 if `retrievePosts` is `true`).
  - `url` – URL of the post.
  - `activityUrn` – LinkedIn activity or UGC URN of the post, if available.
  - `time` – timestamp when the post was published.
  - `type` – type of the post. Enum with possible values:
    - `original` – for original posts.
    - `repost` – for reposts.
  - `author` – original content creator. Can be `null` if the actor cannot be parsed.
    - For person authors: `type`, `name`, `profileUrl`, `headline`.
    - For company authors: `type`, `name`, `companyUrl`.
  - `reposter` – person or company that reshared the post. Non-null only when `type` is `repost`.
    - For person reposters: `type`, `name`, `profileUrl`, `headline`.
    - For company reposters: `type`, `name`, `companyUrl`.
  - `text` – original author's post text, if available.
  - `repostText` – text added by the reposter on a repost with comment, if available.
  - `hashtags` – array of hashtags found in the post text, without leading `#`.
  - `mentions` – array of person and company profile URLs found in the post text.
  - `externalLinks` – array of outbound URLs found in the post text.
  - `images` – array of up to 3 preview image URLs, if available.
  - `documentSlides` – array of carousel or document slide image URLs, if available.
  - `hasVideo` – boolean indicating if the post contains a video.
  - `videoThumbnail` – URL of the video thumbnail, if available.
  - `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 if `retrieveComments` is `true`).
  - `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 if `retrieveReactions` is `true`).
  - `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.
- `selfProfileNotAllowed` – action cannot be performed on your own profile.
