Get Post Comments

Get comments from a LinkedIn post with optional pagination

POST/linkedin/posts/comments

Get Post Comments

Get comments from a LinkedIn post with optional pagination

Authentication requiredLinkedIn Posts

Code Examples

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

Parameters

No parameters.

Request Body

FieldTypeRequiredDescription
accountIdstringNoLinkedIn account ID (uses default if not provided)
postUrlstringYesLinkedIn post URL
commentCountnumberNoNumber of comments per page for manual pagination (1-100)
startnumberNoStarting position for pagination (0-based)
paginationTokenstringNoPagination token from previous request
maxCommentsnumberNoMaximum total comments when fetching all (10-5000, default: 1000)
batchSizenumberNoBatch size when fetching all comments (10-100, default: 50)

Example

{
  "postUrl": "https://www.linkedin.com/posts/john-doe-123_..."
}

Responses

StatusDescription
200Successful response

200 Example

{
  "success": true,
  "postUrl": "https://www.linkedin.com/posts/john-doe-123_...",
  "accountId": "507f1f77bcf86cd799439011",
  "comments": [
    {
      "commentText": "Great post!",
      "commenterName": "Jane Smith",
      "commenterProfileId": "jane-smith-456",
      "createdAt": "2024-01-15T10:30:00Z"
    }
  ],
  "summary": {
    "totalComments": 1,
    "maxCommentsLimit": 100,
    "batchSize": 50,
    "truncated": false,
    "mode": "all_comments"
  }
}