APIs / Social media / Lemmy
1 credit per call5 endpointsChecked working 6 Dec 2026
Lemmy API
Lemmy API for searching posts and communities, community details, community feeds and single posts as JSON. 5 endpoints, 1 credit per successful call.
curl "https://api.perceptlayer.com/v1/lemmy/search?q=linux" \
-H "X-API-Key: $API_KEY"Playground
Run this API
curl "https://api.perceptlayer.com/v1/lemmy/search?q=linux" \
-H "X-API-Key: $API_KEY"Lemmy · 5 endpoints
Endpoints
Every endpoint takes the same key. Open one for its parameters, the fields it returns and an example request.
| Endpoint | Required parameters | Returns | Cost |
|---|---|---|---|
GET/v1/lemmy/community | name+1 optionalNeeds terms | community | 1 credit |
GET/v1/lemmy/post | id+4 optionalNeeds terms | postcommentscomments_has_more | 1 credit |
GET/v1/lemmy/posts | community+5 optionalNeeds terms | idtitlecommunitycreatorscoreupvotes+9 more | 1 credit |
GET/v1/lemmy/search | q+5 optionalNeeds terms | idtitlecommunitycreatorscoreupvotes+9 more | 1 credit |
GET/v1/lemmy/user | username+4 optionalNeeds terms | idtitlecommunitycreatorscoreupvotes+7 more | 1 credit |
Overview
About the Lemmy API
What you can get
The Lemmy API returns public Lemmy data as JSON through 5 endpoints. All of them are restricted endpoints: the restricted-endpoint terms apply, and they don't permit collecting personal data without a lawful basis or using it to contact people.
- Search:
searchtakes a query inq, withtype_(All, Posts, Communities, Users or Comments),sort(19 values, such as Active, Hot, New, TopWeek and Controversial),limitandpage. - Communities:
communitytakes a communityname;poststakes acommunity, withsort(Hot, Active, New, TopDay, TopWeek, TopMonth, TopYear, TopAll, MostComments or NewComments),type_(All, Local or Subscribed),limitandpage_cursor. - Posts:
posttakes anid, withcomment_sort(Top, New, Old or Hot),comment_limitandmax_depth. - Users:
usertakes ausername, withsort,limitandpage.
Every endpoint also takes an optional instance.
How a call works
Read a community's top posts of the week: GET /v1/lemmy/posts?community=...&sort=TopWeek with your key in the X-API-Key header. posts pages with page_cursor; search and user page with page. Every successful call costs 1 credit; failed calls cost nothing.
More social media APIs
Use cases
Find the communities that discuss a topic with `type_=Communities`
Use the Lemmy API to find the communities that discuss a topic with `type_=Communities`Follow what a community posts about, by day, week or month
Use the Lemmy API to follow what a community posts about, by day, week or monthTrack how a topic, product or brand is discussed across communities over time
Use the Lemmy API to track how a topic, product or brand is discussed across communities over timeCompare the most-commented posts on a topic with `sort=MostComments`
Use the Lemmy API to compare the most-commented posts on a topic with `sort=MostComments`FAQ
Questions
Do I need a Lemmy API key?
No. You call this Lemmy API with your Perceptlayer key in the `X-API-Key` header, with no Lemmy account. You do need to accept the restricted-endpoint terms first.
How much does the Lemmy API cost?
Each successful call costs one credit. New accounts get free credits to start, and credit packs bring the price down as you scale.
What format are responses in?
Every endpoint returns JSON, with no HTML parsing on your side.
Is this the official Lemmy API?
No. Perceptlayer is an independent service and is not affiliated with Lemmy. It returns Lemmy data as JSON with a Perceptlayer key, so there is no Lemmy developer account, app review or partner approval to get first. It only reads data: if Lemmy has an official API and you need to act on your own Lemmy account, such as posting, managing orders or reading private data, use that one.
Should I build a Lemmy scraper instead?
You can, but a Lemmy scraper is code you maintain: page changes break it, requests get blocked, and Lemmy's terms govern how you collect data. The Lemmy API gives you 5 endpoints of named JSON fields for 1 credit per successful call, and failed calls cost nothing. A scraper makes sense only for data these endpoints don't return, so check the response in the playground on this page first. Some of these endpoints return social or personal data and need the restricted-endpoint terms; collect only what you have a lawful basis for.
Try the Lemmy API with 100 free credits
No credit card. Failed calls are never billed.