Facebook Pixel
APILinkedIn Posts

Get latest posts from a profile

Retrieve the most recent posts from a LinkedIn profile. Useful for monitoring competitor content, tracking influencer activity, or finding engagement opportunities. Can include or exclude reposts/shares.

POST/posts/latest
Authentication requiredPosts

Code Examples

curl -X POST 'https://api.connectsafely.ai/linkedin/posts/latest' \
-H 'Authorization: Bearer <your_api_key>' \
-H 'Content-Type: application/json' \
-d '{"accountId":"acc_12345","profileId":"john-doe-123","count":1,"includeReposts":true}'

Parameters

No parameters.

Request Body

FieldTypeRequiredDescription
accountIdstringNoLinkedIn account ID to use. If not provided, uses the default account.
profileIdstringConditionalLinkedIn profile vanity URL slug (the part after linkedin.com/in/, e.g., "john-doe-123"). When possible, use profileUrn instead for more reliable results. Either profileId or profileUrn must be provided.
profileUrnstringConditionalLinkedIn profile URN (e.g., "urn:li:fsd_profile:ACoAABJefVoBrz2LR3f..."). Preferred over profileId — avoids an extra API call to resolve the vanity name. Either profileUrn or profileId must be provided.
countnumberNoNumber of recent posts to retrieve (max 20)
includeRepostsbooleanNoWhether to include reposts/shares in results

Example

{
  "accountId": "acc_12345",
  "profileId": "john-doe-123",
  "profileUrn": "urn:li:fsd_profile:ACoAABcdefgh",
  "count": 1,
  "includeReposts": true
}

Responses

StatusDescription
200Posts retrieved successfully
400Bad request - Missing required fields
401Unauthorized - Invalid or missing API key
404Profile not found

200 Response Parameters

NameTypeDescription
successboolean
profileUrnstringLinkedIn profile URN of the target user
accountIdstringLinkedIn account ID used for the request
postsarray
countnumberNumber of posts requested
totalPostsFoundnumberTotal number of posts found and returned
messagestringStatus message describing the result

200 Example

{
  "success": true,
  "profileUrn": "urn:li:fsd_profile:ACoAAA24A-MBVEvT49xpVF2gnWrhvmUIPDJshSM",
  "accountId": "696ce9e780e0483585e4e553",
  "posts": [
    {
      "activityUrn": "urn:li:activity:7429892659739029504",
      "url": "https://www.linkedin.com/feed/update/urn:li:activity:7429892659739029504",
      "content": "The end of Q1. And what a three months it's been...",
      "isGroupPost": false,
      "numLikes": 86,
      "numComments": 5,
      "numShares": 2,
      "authorName": "Andy Burrows",
      "authorProfileUrl": "https://www.linkedin.com/in/andy-burrows-60256731",
      "authorProfilePicture": "https://media.licdn.com/dms/image/...",
      "authorType": "person",
      "isEdited": false,
      "isArticle": false,
      "isRepost": false,
      "timestamp": "1w"
    }
  ],
  "count": 1,
  "totalPostsFound": 1,
  "message": "Found 1 valid posts out of 1 total posts"
}

400 Response Parameters

NameTypeDescription
errorstring

400 Example

{
  "error": "Either profileId or profileUrn must be provided",
  "success": false
}

401 Response Parameters

NameTypeDescription
errorstring

401 Example

{
  "error": "Unauthorized"
}

404 Response Parameters

NameTypeDescription
errorstring

404 Example

{
  "error": "LinkedIn profile not found: invalid-profile-id",
  "success": false
}