Connections API
Note
The use of this API is restricted to those developers approved by LinkedIn and subject to applicable data restrictions in their agreements.
The Connections API returns a list of 1st-degree connections for a user who has granted access to their account via OAuth.
Usage
Note
You cannot "browse connections." That is, you can only get the connections of the user who granted your application access. You cannot get connections of that user's connections (2nd-degree connections). Access to connections data is subject to the relevant members' privacy settings.
The Connections API does not permit browsing member connections. Connections are only available for the given member who has granted access to your application. 2nd-degree connections, or connections of your member's connections, are not available from LinkedIn.
Permissions
To use the Connections API, you must request an access token to make an authenticated call on behalf of a member. The Connections API requires one of the following permissions:
Permission | Description |
---|---|
r_1st_connections | Required to retrieve 1st-degree connections |
r_compliance | Required to retrieve your activity for compliance monitoring and archiving |
Sample Request
GET https://api.linkedin.com/v2/connections?q=viewer&start=0&count=50
Sample Response
{
"elements":[
{
"to":"urn:li:person:9HfhE6QlBz"
}
],
"paging":{
"count":50,
"links":[
],
"start":0,
"total":1
}
}
Total Number of Connections
A Member's total number of 1st-degree connections is returned along with the paging
response. To retrieve the number of connections only, use projection syntax to request the paging field. For example:
Sample Request
GET https://api.linkedin.com/v2/connections?q=viewer&projection=(paging)
Sample Response
{
"paging": {
"total": 42,
"count": 10,
"start": 0,
"links": []
}
}
Field Selection
By default, the Connections API returns a list of Person URNs only. To retrieve additional information about each connection, use decoration syntax to retrieve the id, first and last names.
Sample Request
Note
Recommended max limit of pagination count is 50. Requests containing both decoration and higher pagination count may timeout due to longer processing time.
GET https://api.linkedin.com/v2/connections?q=viewer&projection=(elements(*(to~)),paging)&start=0&count=10
Sample Response
{
"elements": [
{
"to~": {
"lastName": {
"localized": {
"en_US": "Belcher"
},
"preferredLocale": {
"country": "US",
"language": "en"
}
},
"firstName": {
"localized": {
"en_US": "Louise"
},
"preferredLocale": {
"country": "US",
"language": "en"
}
},
"id": "9HfhE6QlBz"
},
"to": "urn:li:person:9HfhE6QlBz"
},
.
.
.
}
],
"paging": {
"total": 42,
"count": 10,
"start": 0,
"links": []
}
Feedback
Submit and view feedback for