APILinkedIn User
Get profile visitors
Retrieve a list of people who viewed your LinkedIn profile. Shows visitor name, headline, location, and visit timestamp. Some visitors may be anonymous depending on their privacy settings. Supports pagination and various time ranges.
POST
/profile/visitorsAuthentication requiredUser
Code Examples
curl -X POST 'https://api.connectsafely.ai/linkedin/profile/visitors' \ -H 'Authorization: Bearer <your_api_key>' \ -H 'Content-Type: application/json' \ -d '{"maxVisitors":20}'Parameters
No parameters.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
accountId | string | No | LinkedIn account ID to use. If not provided, uses the default account. |
timeRange | string | No | Time range to filter visitors |
count | number | No | Page size for pagination (visitors fetched per API request). Use maxVisitors to control the total limit. |
start | number | No | Pagination offset (0-indexed) |
fetchAll | boolean | No | When true, automatically paginates to fetch all visitors up to maxVisitors limit |
maxVisitors | number | Yes | Total number of visitors to retrieve. This is the primary limit - use this parameter to specify how many visitors you want (e.g., maxVisitors: 50 for 50 visitors). |
Example
{
"maxVisitors": 20
}Responses
| Status | Description |
|---|---|
| 200 | Profile visitors retrieved successfully |
| 401 | Unauthorized - Invalid or missing API key |
| 403 | Access forbidden - LinkedIn Premium may be required to see all visitors |
| 500 | Internal server error |
200 Response Parameters
| Name | Type | Description |
|---|---|---|
success | boolean | Whether the request was successful |
accountId | string | LinkedIn account ID used for the request |
visitors | array | |
pagination | object | |
hasMore | boolean | Whether more visitors are available for pagination |
timeRange | string | Time range filter applied |
filters | object | Filters applied to the request |
200 Example
{
"success": true,
"accountId": "696ce9e780e0483585e4e553",
"visitors": [
{
"entityUrn": "urn:li:fsd_profile:ACoAADlVtYMBLWFFOJ1ezKvVfycTiiAjoFmMK68",
"publicIdentifier": "ritika-kulkarni-85718922a",
"name": "Ritika Kulkarni",
"headline": "Full Stack Developer | Agentic AI | Python | Gen AI",
"profilePicture": "https://media.licdn.com/dms/image/v2/D4D03AQEi_YdnvAQoew/profile-displayphoto-shrink_100_100/...",
"viewedAt": "Viewed 47m ago",
"connectionDegree": "1st",
"profileUrl": "https://www.linkedin.com/in/ritika-kulkarni-85718922a"
},
{
"entityUrn": "urn:li:fsd_profile:ACoAAFcWhRYB8fzl-VIyjFSFXfhToQE6M5bJiuw",
"publicIdentifier": "mamta-mishra-386398349",
"name": "Mamta Mishra",
"headline": "Student at Dr. Ram Manohar Lohia Awadh University",
"profilePicture": "https://media.licdn.com/dms/image/v2/D5603AQFdaHjJWpZbww/profile-displayphoto-shrink_100_100/...",
"viewedAt": "Viewed 52m ago",
"connectionDegree": "2nd",
"profileUrl": "https://www.linkedin.com/in/mamta-mishra-386398349"
}
],
"pagination": {
"start": 0,
"count": 10,
"total": 8
},
"hasMore": false,
"timeRange": null,
"filters": {
"timeRange": "past_90_days",
"count": 20,
"start": 0,
"fetchAll": false,
"maxVisitors": 10
}
}401 Response Parameters
| Name | Type | Description |
|---|---|---|
error | string |
401 Example
{
"error": "Unauthorized - Invalid credentials"
}403 Response Parameters
| Name | Type | Description |
|---|---|---|
error | string |
403 Example
{
"error": "LinkedIn Premium required to view profile visitors"
}500 Response Parameters
| Name | Type | Description |
|---|---|---|
error | string |
500 Example
{
"error": "Failed to fetch profile visitors"
}Get user organizations
Fetch all LinkedIn organizations (company pages) the authenticated user has admin or posting access to. Returns organization details including URN, name, logo, follower count, and visitor count. Use the organization URN for posting content as a company or commenting as a company page.
LinkedIn Actions API
Programmatic follow, messaging, and connection workflows for LinkedIn.
