Lemmy hub

Lemmy Posts API

A community's posts or the instance feed, with scores, comments and the author, in one typed list.

GET /v1/lemmy/posts

1 credit Failed requests are free

About this endpoint

GET /v1/lemmy/posts?instance=lemmy.world&scope=local&sort=New returns data.posts, each with id, title, body, url, urlContentType, thumbnailUrl, publishedAt, score, upvotes, downvotes, commentCount, nsfw, locked, removed, deleted, languageId, community and author. Add community=technology for one community, or a remote community=canada@lemmy.ca.

Sorts follow the instance: New, Hot, Active, TopDay and the longer windows work on both 0.18 and 0.19; Scaled and Controversial are refused by 0.18. On 0.19 and later the instance sends its own next_page, which is returned inside page.nextCursor and can walk past the numbered 100-page ceiling. A cursor only works with the filters it was issued for.

Lemmy Posts API FAQ

How do I list one community's posts?

Pass community=technology, or community=canada@lemmy.ca for a community on another instance. Leave community out to read the instance listing chosen by scope.

Which sort should I use?

New and TopDay are the safest for current work. Scaled and Controversial are refused by 0.18 instances, and the full Top... range covers hour through all time.

How does the posts cursor differ from other lists?

On 0.19 and later the instance also returns its own next_page value. It is carried in page.nextCursor and can continue past page 100. On 0.18 the cursor is a numbered page alias, and page.limitReached tells you when the ceiling stopped a full page.

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