LinkedIn Profile API – Unofficial and 100% Open Source

December 11, 2008 15 Comments Category: Open Source, Products

  LinkedIn Profile API (10.5 KiB, 391 hits)

Presenting the open source PHP LinkedIn Public Profile API, released under the GNU

How does it work?
This PHP Class (requires php5) imports a users LinkedIn public profile (by supplying their public profile username) and turns the results in to a simple XML document.

You can see my example at http://brandonshead.com/work/linkedinProfile/profile.php

How do you use it?
Inside you will find 3 files.
1. linkedin.php – the actual PHP Class (requires PHP5)
2. profile.php – an example of how to use the Class.
3. livingresume.xsl – the default XSL that is attached to the Users XML Profile.

Usage:

<?
include_once('linkedin.php');
$LIProfile=new linkedinprofile('brandoncorbin');
// OUTPUT THE RESULTS
header("Content-Type:application/xml");
echo $LIProfile->getProfileXML()->asXML();
?>

Questions? Leave them in the Comments and I will reply ASAP.

Disclaimer: I offer absolutely no guarantees that this will work on your system. As a matter of fact, it’s possible that this script could ask you to play “global thermal nuclear war” – if it does, please answer no. We all know what about happened last time.

  LinkedIn Profile API (10.5 KiB, 391 hits)


15 Responses

Write a comment
  1. Hey Brandon -
    Fantastic idea! I’ve really been getting into using social media as a marketing tool and started doing my homepage updates with a twitter feed. Came across your page looking for a way to do the same thing with my LinkedIn public profile.

    Noticed your example doesn’t work, and I’m just wondering if that was due to LinkedIn shutting it down or something else…

    I’m trying to do this script in ASP, so I was going to use this as a basis. If I manage to pull it off, I’d be happy to share for you to re-post.

    -Pete

    portjump 3 March 2009 at 8:07 pm Permalink
  2. Pete, by now, I am sure that linkedin is rejecting requests from the html2xml service that I was using – but finding another service would remedy the problem :) – And I would absolutely love to hear if you end up porting it over to asp, that would be pretty cool.

    brandon.corbin 3 March 2009 at 8:22 pm Permalink
  3. I did see something on their blog that they decided to make their own widget to be able to allow you to include it on your website, but it’s still not as flexible as what you were doing. It’s really to bad they stifled your development rather than embracing it.

    portjump 17 March 2009 at 10:06 am Permalink
  4. Hey Brandon,

    Your code seems to work fine. Great. I have just one problem (and i’m not a php expert..). Its just loads one job, education etc. The loop is working fine ($experience) and has got the right content (more jobs), but its doesn’t save it in the job array ($this->profilexml->jobs->job[$i]->..) Any idea?

    Eric 16 June 2009 at 8:12 am Permalink
  5. Hey Eric, it might be that they modified their Jobs list basic HTML which could make the parser no longer find it… If they have changed it, then the change will need to be reflected in the Xpath call… Does that help?

    brandon.corbin 17 June 2009 at 11:13 am Permalink
  6. http://brandonshead.com/work/linkedinProfile.zip link is not work so how i can download the linkedin open source API.

    Please help me..

    Nitin 3 August 2009 at 4:57 am Permalink
  7. Hey Nitin, I have updated the link and it is now available. Sorry about that, I lost it while moving from my previous host!

    Thanks! Brandon

    brandon.corbin 3 August 2009 at 10:56 am Permalink
  8. thanks for the reply.

    Can you please provide me a link for download linkedinProfile.zip file.

    Please help me.

    thanks
    nitin

    Nitin 4 August 2009 at 12:27 am Permalink
  9. Hi,
    Iam using your linked in api and iam able to dispaly user id of the logged in user. Now i want to provide an interface in my own website where user can able to login in linkedin through my website. Please provide the details ASAP.

    Thanks in advance.

    Varun 16 August 2009 at 6:51 am Permalink
  10. Hey Varun, unfortunately I don’t have the time to write some code for you to use – but if all you are looking for is a the form fields (username,password) and where to send the POST to – check out how LinkedIn handles it at https://www.linkedin.com/secure/login

    You should be able to take the basic code, and post it straight to the same page “https://www.linkedin.com/secure/login”

    brandon.corbin 16 August 2009 at 3:34 pm Permalink
  11. Hi Brandon,
    If you are able to provide me some code for login in linkedin, that would be a great help. What my plan is to provide own login page to the user. as soon as user feed the informations. page should redirect to linkedin page, if he/she has selected to use linkedin facility. [means single sign on facility for my and linkedin website].

    Thanks in advance,
    Varun

    Varun 20 August 2009 at 5:47 am Permalink
  12. Nice class. Would like to see access to the updates (or news feed as Facebook refers to it)

    Clinton 3 February 2010 at 8:03 pm Permalink
  13. hello dear ,

    this is simon i m making a social networking site and need linkedin api to my blog . i use ur api its realy outstanding , but there is some problem in XML parser so plz help me to make it …….. thanks for this post .

    Simon 19 February 2010 at 3:10 am Permalink
  14. Simon, what seems to be the problem?

    brandon.corbin 20 February 2010 at 7:53 pm Permalink

Write a Comment

Commenter Gravatar