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.

Lemmy
GET/v1/lemmy/search?q=linux
curl "https://api.perceptlayer.com/v1/lemmy/search?q=linux" \
  -H "X-API-Key: $API_KEY"
cURL1 credit per successful call
Run this call below or from your dashboard to see a live response.

Playground

Run this API

cURLshell
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.

Note
Endpoints marked “Needs terms” return personal or social data. They work once you accept the restricted-endpoint terms in your dashboard.
EndpointRequired parametersReturnsCost
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: search takes a query in q, with type_ (All, Posts, Communities, Users or Comments), sort (19 values, such as Active, Hot, New, TopWeek and Controversial), limit and page.
  • Communities: community takes a community name; posts takes a community, with sort (Hot, Active, New, TopDay, TopWeek, TopMonth, TopYear, TopAll, MostComments or NewComments), type_ (All, Local or Subscribed), limit and page_cursor.
  • Posts: post takes an id, with comment_sort (Top, New, Old or Hot), comment_limit and max_depth.
  • Users: user takes a username, with sort, limit and page.

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.

Social mediaJSONRESTMCPSome endpoints need terms

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 month

Track 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 time

Compare 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.