LinkedIn Developer Network

Currently Being Moderated

Profile API

VERSION 14  Click to view document history

Created on: Oct 20, 2009 2:07 AM by Lucian - Last Modified:  Feb 2, 2010 8:57 AM by Mike Repass

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 Rules

  • You must use an access token with this call for either public or standard profile. There is no way to get a profile without representing the user making the request.

 

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:

                                                                                                                           
FieldParent NodeDescription
first-namepersonthe member's first name
last-namepersonthe member's last name
headlinepersonthe member's headline (often "Job Title at Company")
site-standard-profile-request/urlpersonthe 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.

 

Choosing public or standard profile

The URL to retrieve the standard and public profiles are the same. To return a public profile, simply add  :public to the end of the profile. Without that, the call will return a standard profile.

 

Selecting the amount of detail returned

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>
    </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 XML 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
15,917 Views Tags: profile, public_profile
Average User Rating
(1 rating)

Having Problems?

If you would like to leave a comment, please log in with your LinkedIn account credentials.

Vinothkumar M Vinothkumar M  says:
Hi ,
   It's Good!. I am able to fetch user profile using "Profile API".
I would like to update profile fields but I couldn't find it in the Profile API.
Is there any otherway to update the profile? orelse when it will be available?
Lucian Lucian  says in response to Vinothkumar M:

We are looking at update APIs for the profile but this is longer term work, so not right around the corner.

Nils Thorell Nils Thorell  says:

I can't see a way to extract phone numbers.  Is that really so?

Lucian Lucian  says in response to Nils Thorell:

We don't currently send out phone numbers with the profiles.

Thomas Benita Thomas Benita  says:

Hi,

Given that my users already have a profile on my application, is there an API I can use to automatically create an account on LinkedIn on their behalf by posting the records I have in my Database (matching fields by fields) ?

 

Say some of my users already are LinkedIn users, what's your roadmap for profile update APIs ? I read "this is longer term work, so not right around the corner" in one of your replies above, how longer ?

 

Thanks,

 

Thomas

Quyen Nguyen Quyen Nguyen  says in response to Lucian:

Hi Lucian,

 

As far as I see from Profile Fields, there is only one field for company is "company/name" in position mode. Do you have a plan to support retrieving more company data fields, such as: type, industry, website, size, headquater address, etc. ????

 

Cheers,

Quyen

Michael Lim Michael Lim  says:

Hi,

 

When requesting profile for a user using the profile API and id=, I noticed if 'connections' is part of the requested field, I get a 403 status, but removing 'connections' from the list of requested fields works fine.  According to the profile fields doc, the 'connections' field was to return only the connections count:

 

From Basic Profile Fields description for 'connections':

"an empty collection, indicating the # of connections the member has with a total attribute"

 

Am I not understanding or using this correctly?  I am simply trying to get the connections count given a user id.

 

Many thanks.

 

Michael

Veya Alexandre Veya Alexandre  says in response to Michael Lim:

I have the same error with the fields "connections".

Is any solutions?

Anila Kazani Anila Kazani  says:

I am using

http://api.linkedin.com/v1/people/url=

and it just doesn't work! I have a public url, and I am searching a connection of the logged in user, and still I can not find a profile. It returns "(400) Bad Request" error. I am encoding the URL and adding it to the request still nothing! What should I do?

Bookmarked By (1)

More Like This

  • Retrieving data ...