Facebook Pixel
APILinkedIn Posts

Get the current user's LinkedIn home feed

Fetch posts from the authenticated user's LinkedIn home feed. Returns a mix of organic and promoted posts with author info, engagement metrics, and feed context (why the post appeared). Promoted posts are flagged with isPromoted: true.

POST/feed
Authentication requiredPosts

Code Examples

curl -X POST 'https://api.connectsafely.ai/linkedin/feed' \
-H 'Authorization: Bearer <your_api_key>' \
-H 'Content-Type: application/json' \
-d '{"accountId":"acc_12345","count":5,"start":0,"sortOrder":"relevance"}'

Parameters

No parameters.

Request Body

FieldTypeRequiredDescription
accountIdstringNoLinkedIn account ID to use. If not provided, uses the default account.
countnumberNoNumber of feed posts to retrieve (max 50)
startnumberNoStarting offset for pagination
sortOrderstringNoFeed sort order: relevance (default algorithm) or recent (newest first)

Example

{
  "accountId": "acc_12345",
  "count": 5,
  "start": 0,
  "sortOrder": "relevance"
}

Responses

StatusDescription
200Feed posts retrieved successfully
401Unauthorized
500Internal Server Error

200 Response Parameters

NameTypeDescription
successboolean
postsarray
countnumberNumber of posts returned

200 Example

{
  "success": true,
  "posts": [
    {
      "activityUrn": "urn:li:example:123456",
      "postUrl": "https://linkedin.com/posts/example-post",
      "author": {},
      "content": "example_value",
      "timestamp": "2024-01-15",
      "engagement": {},
      "hashtags": [],
      "isPromoted": false,
      "feedContext": "example_value"
    }
  ],
  "count": 25
}

401 Response Parameters

NameTypeDescription
errorstring

401 Example

{
  "error": "example_value"
}

500 Response Parameters

NameTypeDescription
errorstring

500 Example

{
  "error": "Failed to fetch feed",
  "success": false
}