bannerColor WARNING_YELLOW templateName stackForums

Profile API

The Profile API returns a member's LinkedIn profile. You can use this call to return one of two versions of profile:

  • Standard: Displays the profile the requestor is allowed to see. The specific content will depend on the privacy settings of the profile owner, the relationship (degree separation or groups in common) between the owner and requestor, and in rare cases, the privacy settings of the requestor.
  • Public: Returns the public profile. The fields returned are only determined by the privacy settings of the profile owner.

Use the public profile in cases where you know the public profile URL and you want to make sure that the end user can always see the profile no matter the visibility rules. To get the public profile URL, you might have asked a user to use his/her profile on your site and retrieved that user's public profile URL for later use.

Use the standard profile in cases where you want to show a profile and include the relationship information. It will include the distance between the two users. However, there are visibility rules determining the level of detail any two profiles can see, so if you don't need this relationship information, its better to use the public profile.

Usage

You must use an access token to make an authenticated call on behalf of a user

Reminder: You may only store data returned from the People API for the authenticated member with their permission.
Reminder: You may never store data returned from the People API for profiles other than the authenticated member.

Permissions
This API requires the following permissions (see Member Permissions)

Permissions Description
r_basicprofile Required to retrieve name, photo, headline, and current positions for authenticated user
r_fullprofile Required to retrieve full profile for authenticated user

Throttle Limits
Please reference the limits applied to this API

URLs

Identifying the profile to return

There are several ways to identify the user profile you want to return:

  • ~: Use the tilde character to indicate that you want the profile of the current user. The access token will be used to determine the profile to return.
  • member_id: If you know the member token of the profile you want to display, you can use it as the key value for this API call. You should include id= to indicate that you are using a member token. Requesting by member token only returns a profile from the logged in person's three degree network and doesn't return any out-of-network profiles. You cannot use a member token to get a public profile.
  • Search result: If you found this profile through a search result, the search result should include an API URL that you can use to make this call, in addition to HTTP headers that would be required to access an out of network profile.
  • Public Profile URL:Using the Public Profile URL will return a profile from inside or outside the logged in member's three degree network. The Public Profile URL must be URL escaped.

Default Fields Returned

By default, only the following fields are returned for a profile request:

Field Parent Node Description
first-name person the member's first name
last-name person the member's last name
headline person the member's headline (often "Job Title at Company")
site-standard-profile-request/url person the URL to the member's authenticated profile on LinkedIn (requires a login to be viewed, unlike public profiles)

To request any fields beyond this limited set, you must use Field Selectors.

See the Profile Fields document for a full list of supported fields.

Fetching a user's standard profile

The following call will return a user's standard profile using their public profile URL

Requesting Secure URLs in Profile API response

By providing the secure-urls query parameter, you can indicate that you want the URLs in your response to be HTTPS

Selecting the amount of detail returned

Selecting the profile language

  • Some members have profiles in multiple languages. To specify the language you prefer, pass an Accept-Language HTTP header. Set the values to a comma separated list of locales ordered from highest to lowest preference.
  • For example, if your preferred order is Spanish, then English (American), and finally Italian, your header should be: Accept-Language: es-ES, en-US, it-IT.
  • At present, we will always return data if possible. So, if you specify just one locale, but the member hasn't localized her profile for that locale, we will return data in her primary language.
  • We support any language the member has specified. For example, for Simplified Chinese, use zh-CN. However, the six most popular languages, and their header values, are below.
Language Header Value
English (American) en-US
French fr-FR
German de-DE
Italian it-IT
Portuguese (Brazilian) pt-BR
Spanish es-ES

Sample Return XML: User's Own Full Profile

This is the XML you will see when making a call to get the current user's profile. The profile for the access token will be used. A successful call returns an XML document in the following format:

<person>
<id>
<first-name />
<last-name />
<headline>
<location>
<name>
<country>
<code>
</country>
</location>
<industry>
<distance>
<relation-to-viewer>
<distance>
</relation-to-viewer>
<num-recommenders>
<current-status>
<current-status-timestamp>
<connections total="" >
<summary/>
<positions total="">
<position>
<id>
<title>
<summary>
<start-date>
<year>
<month>
</start-date>
<is-current>
<company>
<name>
</company>
</position>
<educations total="">
<education>
<id>
<school-name>
<degree>
<start-date>
<year>
</start-date>
<end-date>
<year>
</end-date>
</education>
</educations>
<member-url-resources>
<member-url>
<url>
<name>
</member-url>
<api-standard-profile-request>
<url>
<headers>
<http-header>
<name>
<value>
</http-header>
</headers>
</api-standard-profile-request>
<site-standard-profile-request>
<url>
</site-standard-profile-request>
<picture-url>
</person>

Sample Return XML: Profiles Other Than the User's Own

This is the XML you will see when making a call to get a profile other than the current user. This could include a first, second, third degree, or out of network profile. A successful call returns an XML document in the following format:

<person>
<id>
<first-name>
<last-name>
<headline>
<location>
<name>
<country>
<code>
</country>
</location>
<industry>
<distance>
<num-recommenders>
<current-status>
<current-status-timestamp>
<connections total="" >
<summary/>
<positions total="">
<position>
<id>
<title>
<summary>
<start-date>
<year>
<month>
</start-date>
<is-current>
<company>
<name>
</company>
</position>
</positions>
<member-url-resources>
<member-url>
<url>
<name>
</member-url>
<api-standard-profile-request>
<url>
<headers>
<http-header>
<name>
<value>
</http-header>
</headers>
</api-standard-profile-request>
<site-standard-profile-request>
<url>
</site-standard-profile-request>
<picture-url>
</person>

Returned Member URL Resources

For your convenience, the response returns two URLs that let you easily display a standard profile.

  • api-standard-profile-request/url is the URL you use to return a standard profile.
  • site-standard-profile-request/url is URL you use to display a standard profile on LinkedIn.com