Lemmy hub

Lemmy Post Comments API

A post's comments as a normal page, with path, depth and parent id so you can walk any branch.

GET /v1/lemmy/post/comments

1 credit Failed requests are free

About this endpoint

GET /v1/lemmy/post/comments?instance=lemmy.world&postId=53910627&sort=Top returns data.comments, each with id, content, postId, path, depth, parentId, distinguished, languageId, removed, deleted, publishedAt, score, upvotes, downvotes, replyCount, post, community and author. Give postId, parentId, or both; parentId lists that comment and its replies.

Large reply trees are not returned whole. Use path to see ancestry, depth for the level and parentId to walk one branch at a time. A postId or parentId that does not exist returns not_found; a real post with no comments returns a found answer with no rows.

Lemmy Post Comments API FAQ

How do I get replies to one comment?

Pass parentId with the comment id. The answer includes that comment and its replies; add postId to keep the request anchored to its post.

Why is the whole tree not in one response?

A full tree can be hundreds of kilobytes. This route returns a normal page; path, depth and parentId let you walk the branches you need.

Why is a comment's content empty?

A moderator can remove a comment or its author can delete it, and the instance then serves an empty content with removed or deleted set. The moderation log may still hold the removed text.

How many credits does a comment page cost?

Pricing is documented on the operation in the API registry (shown on this page). Confirm on every response with meta.creditsCharged: that field is the billing source of truth. Each paginated page is a separate billed request.