Get comments from a post

Fetch comments from a professional post including author information and replies (subcomments). Comments come back in the source's order for sortBy: relevance (default) returns a ranked SUBSET of the thread (measured: 224 of 299 top-level comments), recent returns the complete thread newest first and is the way to walk every comment or pick up new ones. Pages advance with start.

get/api/v1/post/comments

Request

  • Base URL: https://api.fetchin.io
  • URL: https://api.fetchin.io/api/v1/post/comments
  • Auth: API key in header X-API-Key

Query parameters

postUrlOrUrnstring required
Example:https://www.linkedin.com/posts/username_post-slug-1234567890-abcd

Professional post URL or URN: urn:li:activity:<id>, urn:li:ugcPost:<id>, a group post as urn:li:groupPost:<groupId>-<postId>, or any post URL containing one. A repost without commentary answers with the original post's comments.

sortBy'relevance' | 'recent'

Order of the comments. relevance (default) is the source's own ranking and returns a ranked SUBSET of the thread (measured: 224 of 299 top-level comments). recent returns the COMPLETE thread, newest first: use it to walk every comment or to pick up new ones. Any other value is a 400 that costs nothing.

countinteger

Number of comments to fetch (default: 100)

startinteger

Offset of the first item to return. This endpoint pages by offset: advance start by the number of items you received. Keep requesting while hasMore is true; an empty page ends the list.

paginationTokenstring

Returned for continuity with the other endpoints. It does not advance this thread - page with start.

Response

Successfully fetched comments

totalinteger

Number of top-level comments the source reports for the post (replies not included). Omitted when the source does not report one.

paginationTokenstring

Token for fetching the next page

hasMoreboolean

Whether more comments are available. Always false on an empty page.

Example response

{
  "comments": [
    {
      "urn": "urn:li:comment:(ugcPost:7287782484287606784,7287957733851484162)",
      "text": "Great post! Thanks for sharing.",
      "author": {
        "id": "urn:li:fsd_profile:ACoAABCDEFG",
        "name": "Jane Doe",
        "headline": "Software Engineer at Tech Company",
        "profilePictureUrl": "https://media.licdn.com/dms/image/...",
        "profileUrl": "https://www.linkedin.com/in/janedoe"
      }
    }
  ],
  "total": 42
}

Changes

No recorded changes to this operation across all 1 revision of this API.