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.
profileIdstringConditionalTarget LinkedIn profile public ID (e.g., "john-doe-123") Either profileId or profileUrn must be provided.
profileUrnstringConditionalTarget LinkedIn profile URN (e.g., "urn:li:fsd_profile:ABC123") 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",
      "isGroupPost": false,
      "numLikes": 86,
      "numComments": 5,
      "numShares": 2
    }
  ],
  "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
}