Lemmy hub

Lemmy Latest Comments API

What an instance or community is saying right now, with each comment's post and author attached.

GET /v1/lemmy/comments

1 credit Failed requests are free

About this endpoint

GET /v1/lemmy/comments?instance=lemmy.world&scope=local&sort=New returns data.comments, each with id, content, postId, path, depth, parentId, distinguished, publishedAt, score, upvotes, downvotes, replyCount, plus the post, community and author objects. Add community=technology to read one community's latest comments.

This is the cross-post feed, not a post's comment thread; use the post-comments route for a thread or a branch. Sorts are Hot, Top, New, Old and Controversial, with Controversial refused by 0.18. The instance does not return a total, so page.hasMore follows from a full page and page.nextCursor continues the same filters.

Lemmy Latest Comments API FAQ

How is this different from a post's comments?

This route lists the latest comments across the whole instance or one community. A post's thread and its replies are on the post-comments route.

Can I filter to one community?

Yes. Pass community=technology, or a remote community as name@host. Combine it with scope=local or scope=all as you need.

Why is there no total?

The instance does not return one. Follow page.nextCursor while page.hasMore is true, and page.limitReached tells you when a numbered list hit the 100-page ceiling.

How many credits does a comments 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.