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/latestAuthentication 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
| Field | Type | Required | Description |
|---|---|---|---|
accountId | string | No | LinkedIn account ID to use. If not provided, uses the default account. |
profileId | string | Conditional | Target LinkedIn profile public ID (e.g., "john-doe-123") Either profileId or profileUrn must be provided. |
profileUrn | string | Conditional | Target LinkedIn profile URN (e.g., "urn:li:fsd_profile:ABC123") Either profileUrn or profileId must be provided. |
count | number | No | Number of recent posts to retrieve (max 20) |
includeReposts | boolean | No | Whether 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
| Status | Description |
|---|---|
| 200 | Posts retrieved successfully |
| 400 | Bad request - Missing required fields |
| 401 | Unauthorized - Invalid or missing API key |
| 404 | Profile not found |
200 Response Parameters
| Name | Type | Description |
|---|---|---|
success | boolean | |
profileUrn | string | LinkedIn profile URN of the target user |
accountId | string | LinkedIn account ID used for the request |
posts | array | |
count | number | Number of posts requested |
totalPostsFound | number | Total number of posts found and returned |
message | string | Status 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
| Name | Type | Description |
|---|---|---|
error | string |
400 Example
{
"error": "Either profileId or profileUrn must be provided",
"success": false
}401 Response Parameters
| Name | Type | Description |
|---|---|---|
error | string |
401 Example
{
"error": "Unauthorized"
}404 Response Parameters
| Name | Type | Description |
|---|---|---|
error | string |
404 Example
{
"error": "LinkedIn profile not found: invalid-profile-id",
"success": false
}LinkedIn Posts API
Fetch, engage, and analyse LinkedIn posts with the ConnectSafely API.
Comment on a LinkedIn post
Add a comment to a LinkedIn post. Comments increase engagement and visibility. Can optionally tag the post author for notification. Supports posting as a company page if you have admin access. Rate limit: 100 comments per day.
