Facebook Pixel
APILinkedIn Posts

Get all comments from a post

Fetch all comments from a LinkedIn post in a single request. Automatically handles pagination internally. Ideal for bulk analysis of post engagement. Use for posts with many comments where you need complete data.

POST/posts/comments/all
Authentication requiredPosts

Code Examples

curl -X POST 'https://api.connectsafely.ai/linkedin/posts/comments/all' \
-H 'Authorization: Bearer <your_api_key>' \
-H 'Content-Type: application/json' \
-d '{"postUrl":"https://linkedin.com/posts/example-post"}'

Parameters

No parameters.

Request Body

FieldTypeRequiredDescription
accountIdstringNoLinkedIn account ID to use. If not provided, uses the default account.
postUrlstringYesFull URL of the LinkedIn post to get all comments from
batchSizenumberNoNumber of comments to fetch per internal request
maxCommentsnumberNoMaximum total comments to retrieve (safety limit)

Example

{
  "postUrl": "https://linkedin.com/posts/example-post"
}

Responses

StatusDescription
200All comments retrieved successfully
400Bad request - Missing required fields
401Unauthorized - Invalid or missing API key

200 Response Parameters

NameTypeDescription
successboolean
postUrlstringURL of the post
accountIdstringLinkedIn account ID used for the request
commentsarray
summaryobjectSummary of the fetch operation
postDetailsobject

200 Example

{
  "success": true,
  "postUrl": "https://www.linkedin.com/feed/update/urn:li:activity:7431898703118110720",
  "accountId": "696ce9e780e0483585e4e553",
  "comments": [
    {
      "commentId": "urn:li:fsd_comment:(7431913248658059265,urn:li:ugcPost:7431898701888966656)",
      "authorName": "John Doe",
      "commentText": "Great post!",
      "authorDesignation": "Engineer",
      "commenterProfileId": "ACoAAA...",
      "publicIdentifier": "john-doe",
      "profileUrl": "https://www.linkedin.com/in/john-doe",
      "authorProfilePicture": "https://media.licdn.com/...",
      "createdAt": 1771906196752,
      "likeCount": 3,
      "replyCount": 1,
      "hasProfile": true,
      "commenterUrn": "urn:li:fsd_profile:ACoAAA..."
    }
  ],
  "summary": {
    "totalComments": 15,
    "fetchDurationMs": 4253,
    "maxCommentsLimit": 1000,
    "batchSize": 50,
    "truncated": false
  },
  "postDetails": {
    "activityUrn": "urn:li:activity:7431898703118110720",
    "ugcPostUrn": "urn:li:ugcPost:7431898701888966656",
    "shareUrn": null,
    "featuredActivityUrn": null,
    "content": "Post content here..."
  }
}

400 Response Parameters

NameTypeDescription
successboolean
errorobject

400 Example

{
  "success": false,
  "error": {
    "issues": [
      {
        "code": "invalid_type",
        "expected": "string",
        "received": "undefined",
        "path": [
          "postUrl"
        ],
        "message": "Required"
      }
    ],
    "name": "ZodError"
  }
}

401 Response Parameters

NameTypeDescription
errorstring

401 Example

{
  "error": "Unauthorized - Invalid credentials"
}