Facebook Pixel
APILinkedIn Profiles

Fetch LinkedIn profile information

Retrieve detailed profile information for a LinkedIn member including name, headline, premium status, and profile URNs. Results are cached for 6 hours to reduce API calls. Optionally include geo location details and contact information (email, phone if visible). Rate limit: 120 unique profiles per day per LinkedIn account (cached requests do not count against limit).

POST/profile
Authentication requiredProfile

Code Examples

curl -X POST 'https://api.connectsafely.ai/linkedin/profile' \
-H 'Authorization: Bearer <your_api_key>' \
-H 'Content-Type: application/json' \
-d '{"profileId":"john-doe-123"}'

Parameters

No parameters.

Request Body

FieldTypeRequiredDescription
accountIdstringNoLinkedIn account ID to use. If not provided, uses the default account.
profileIdstringYesLinkedIn profile public ID (e.g., "john-doe-123")
includeGeoLocationbooleanNoInclude detailed geo location data (city, country, coordinates)
includeContactbooleanNoInclude contact info (email, phone) if visible to viewer
includeExperiencebooleanNoInclude work experience history
includeEducationbooleanNoInclude education history
includeSkillsbooleanNoInclude skills with endorsement counts
forceRefreshbooleanNoSkip cache and fetch fresh data from LinkedIn. Use sparingly as it counts against rate limit.

Example

{
  "profileId": "john-doe-123",
  "includeGeoLocation": false,
  "includeContact": false,
  "includeExperience": false,
  "includeEducation": false,
  "includeSkills": false,
  "forceRefresh": false
}

Responses

StatusDescription
200Profile information retrieved successfully
400Bad request - Missing or invalid profileId
401Unauthorized - Invalid or missing API key
429Rate limit exceeded - Maximum 120 unique profiles per day

Rate Limit Headers

All responses include rate limit information in the headers:

HeaderDescription
X-RateLimit-ActionThe action type being rate limited
X-RateLimit-LimitMaximum actions allowed per period
X-RateLimit-UsedActions used in current period
X-RateLimit-RemainingActions remaining
X-RateLimit-ResetISO 8601 timestamp when limit resets

200 Response Parameters

NameTypeDescription
successbooleanWhether the request was successful
profileIdstringThe requested profile public ID
accountIdstringLinkedIn account ID used for the request
profileobjectProfile data (empty object if profile not found)
experiencearrayWork experience history (only included when includeExperience=true)
skillsarraySkills with endorsement counts (only included when includeSkills=true)
educationarrayEducation history (only included when includeEducation=true)
cachedbooleanWhether the response was served from cache
cachedAtstring (date-time)When the profile was cached (only if cached=true)
expiresAtstring (date-time)When the cache expires
messagestringStatus message

200 Example

{
  "success": true,
  "profileId": "anandi-devi",
  "accountId": "696ce9e780e0483585e4e553",
  "profile": {
    "firstName": "Anandi",
    "lastName": "Devi",
    "headline": "Go-To-Market (GTM) Engineer @ ConnectSafely | MBA",
    "location": {
      "countryCode": "in",
      "postalCode": null,
      "geoLocationName": null
    },
    "entityUrn": "urn:li:fsd_profile:ACoAAFpqSoMB8vTqRbg4mN_wbabO8w0gjgFu-6o",
    "publicIdentifier": "anandi-devi",
    "profilePicture": "https://media.licdn.com/dms/image/v2/D5603AQF2Iu7GGz-H2A/profile-displayphoto-shrink_100_100/...",
    "isPremium": true,
    "isVerified": true,
    "supportsFreeEmail": true,
    "connectionCount": 958,
    "followerCount": 1243,
    "isConnected": true,
    "connectionDegree": "DISTANCE_1",
    "invitationSent": false,
    "invitationReceived": false,
    "geoLocation": {
      "city": "Delhi",
      "state": null,
      "country": "India",
      "fullLocation": "Delhi, India",
      "birthDate": null
    }
  },
  "message": "Profile information retrieved successfully"
}

400 Response Parameters

NameTypeDescription
successboolean
errorobject

400 Example

{
  "success": false,
  "error": {
    "issues": [
      {
        "code": "invalid_type",
        "expected": "string",
        "received": "undefined",
        "path": [
          "profileId"
        ],
        "message": "Required"
      }
    ],
    "name": "ZodError"
  }
}

401 Response Parameters

NameTypeDescription
errorstring

401 Example

{
  "error": "Unauthorized - Invalid credentials"
}

429 Response Parameters

NameTypeDescription
errorstring
successboolean

429 Example

{
  "error": "Rate limit exceeded for PROFILE: 120/120 used. Resets at 2024-01-16T00:00:00.000Z",
  "success": false
}