Get Latest Posts

Get the latest posts from a LinkedIn user

POST/linkedin/posts/latest

Get Latest Posts

Get the latest posts from a LinkedIn user

Authentication requiredLinkedIn Posts

Code Examples

curl -X POST 'https://api.connectsafely.ai/linkedin/posts/latest' \
-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 (uses default if not provided)
profileIdstringNoLinkedIn profile ID (either profileId or profileUrn is required)
profileUrnstringNoLinkedIn profile URN (either profileId or profileUrn is required)
countnumberNoNumber of posts to fetch (1-20, default: 1)
includeRepostsbooleanNoInclude reposts/shares (default: true)

Example

{
  "profileId": "john-doe-123"
}

Responses

StatusDescription
200Successful response

200 Example

{
  "success": true,
  "profileUrn": "urn:li:fsd_profile:...",
  "accountId": "507f1f77bcf86cd799439011",
  "posts": [
    {
      "url": "https://www.linkedin.com/posts/...",
      "content": "Great insights on AI development...",
      "activityUrn": "urn:li:activity:...",
      "createdAt": "2024-01-15T10:30:00Z",
      "isGroupPost": false,
      "numLikes": 42,
      "numComments": 8,
      "numShares": 5
    }
  ],
  "count": 1,
  "message": "Found 1 valid posts out of 1 total posts"
}