Get Post Comments
Get comments from a LinkedIn post with optional pagination
POST
/linkedin/posts/commentsGet 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
| Field | Type | Required | Description |
|---|---|---|---|
accountId | string | No | LinkedIn account ID (uses default if not provided) |
postUrl | string | Yes | LinkedIn post URL |
commentCount | number | No | Number of comments per page for manual pagination (1-100) |
start | number | No | Starting position for pagination (0-based) |
paginationToken | string | No | Pagination token from previous request |
maxComments | number | No | Maximum total comments when fetching all (10-5000, default: 1000) |
batchSize | number | No | Batch size when fetching all comments (10-100, default: 50) |
Example
{
"postUrl": "https://www.linkedin.com/posts/john-doe-123_..."
}Responses
| Status | Description |
|---|---|
| 200 | Successful 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"
}
}