Search code examples
phplinkedin-api

How to get public profile details from profile url using linkedin Rest API


I am trying to fetch whole information of user's by using linkedin public profile url But I am getting firstname, lastname and id in response.

How to get whole details.

I have tried on linkedin console

https://api.linkedin.com/v1/people/url=https%3a%2f%2fwww.linkedin.com%2fin%2fashishmishraoft?format=json

Response
{
  "firstName": "Ashish",
  "headline": "Sr PHP Developer at Myapp Generation.",
  "id": "STaDeFHBBN",
  "lastName": "Mishra"
}

Solution

  • LinkedIn does not return all possible member profile fields that are available to you by default. There is a limited selection of additional member fields that are also available to you which may be relevant to your application. Refer to the Basic Profile Fields page for a complete list of the basic member profile fields.

    The following example demonstrates how to customize your API call to request specific member profile fields that you wish to be returned during the Sign In with LinkedIn workflow:

    GET https://api.linkedin.com/v1/people/~:(id,num-connections,picture-url)?format=json

    sample api response:

    {
        "id": "1R2RtA",
        "numConnections": 42,
        "pictureUrl": "https://media.licdn.com/mpr/mprx/…"
    } 
    

    https://developer.linkedin.com/docs/signin-with-linkedin