LinkedIn Profile API – Unofficial and 100% Open Source
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)


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
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.
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.
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?
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?
http://brandonshead.com/work/linkedinProfile.zip link is not work so how i can download the linkedin open source API.
Please help me..
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
thanks for the reply.
Can you please provide me a link for download linkedinProfile.zip file.
Please help me.
thanks
nitin
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.
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”
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
Nice class. Would like to see access to the updates (or news feed as Facebook refers to it)
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, what seems to be the problem?