Lemmy Community API

Community management and discovery

GitHub OpenAPI
Business capability
Social Networks & Community AE-170.50

Operations 7

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

GET /community Get a community's details · Get community details #
Ask an LLM
“What are the details of a Lemmy community?”
“Can I look up a community by its name?”
Tell an agent
Get community {name}.
Show the details of community {id}.
POST /community Create a new community · Create a community #
Ask an LLM
“How do I create a new community on my Lemmy instance?”
“Can I set a banner, icon and language for a new community?”
Tell an agent
Create a community named {name} with title {title}.
Create community {name} titled {title} visible as {visibility}.
PUT /community Edit a community's settings · Edit a community #
Ask an LLM
“How do I rename or change the description of a community?”
“Can I make a community NSFW or restrict posting to mods?”
Tell an agent
Rename community {id} to {title}.
Set community {id} to NSFW {nsfw} and description {description}.
DELETE /community Delete a community · Delete a community #
Ask an LLM
“How do I delete a community I created?”
“Can I mark a community as deleted?”
Tell an agent destructive · confirm first
Delete community {id} with deleted {deleted}.
Remove community {id} from the instance.
GET /community/list List communities · List communities #
Ask an LLM
“Which communities exist on this Lemmy instance?”
“Can I list only NSFW communities or sort communities?”
Tell an agent
List {type_} communities sorted by {sort}.
Show {limit} communities from page {page}.
POST /community/follow Follow or unfollow a community · Follow or unfollow a community #
Ask an LLM
“How do I subscribe to a community?”
“Can I unfollow a community I no longer read?”
Tell an agent
Follow community {id}.
Unfollow community {id} by setting follow {follow}.
GET /community/random Get a random community · Get a random community #
Ask an LLM
“Can I get a random community from the instance?”
“Is there a way to pick a community at random?”
Tell an agent
Get a random community.
Pick a community at random for me.

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/lemmy:lemmy-community-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

lemmy-community-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Lemmy REST Community API
  description: The Lemmy REST API provides programmatic access to all core platform features of Lemmy, a free, open-source, self-hostable federated link aggregator and discussion platform.
  version: 4.0.0
  license:
    name: AGPL-3.0
    url: https://github.com/LemmyNet/lemmy/blob/main/LICENSE
  contact:
    url: https://join-lemmy.org/docs/
servers:
- url: https://lemmy.world/api/v4
  description: Lemmy.world (largest public instance)
- url: https://{instance}/api/v4
  description: Any Lemmy instance
  variables:
    instance:
      default: lemmy.world
      description: The hostname of a Lemmy instance
security:
- bearerAuth: []
tags:
- name: Community
  description: Community management and discovery
paths:
  /community:
    get:
      operationId: getCommunity
      summary: Get community details
      description: Retrieve information about a specific community.
      tags:
      - Community
      security: []
      parameters:
      - name: id
        in: query
        schema:
          $ref: '#/components/schemas/CommunityId'
      - name: name
        in: query
        schema:
          type: string
      responses:
        '200':
          description: Community information
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CommunityResponse'
    post:
      operationId: createCommunity
      summary: Create a community
      description: Create a new community on this instance.
      tags:
      - Community
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - name
              - title
              properties:
                name:
                  type: string
                title:
                  type: string
                description:
                  type: string
                  nullable: true
                icon:
                  type: string
                  nullable: true
                banner:
                  type: string
                  nullable: true
                nsfw:
                  type: boolean
                  nullable: true
                posting_restricted_to_mods:
                  type: boolean
                  nullable: true
                discussion_languages:
                  type: array
                  items:
                    $ref: '#/components/schemas/LanguageId'
                  nullable: true
                visibility:
                  type: string
                  enum:
                  - Public
                  - LocalOnly
                  nullable: true
      responses:
        '200':
          description: Community created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CommunityResponse'
    put:
      operationId: editCommunity
      summary: Edit a community
      description: Update an existing community. Requires mod or admin.
      tags:
      - Community
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - community_id
              properties:
                community_id:
                  $ref: '#/components/schemas/CommunityId'
                title:
                  type: string
                  nullable: true
                description:
                  type: string
                  nullable: true
                nsfw:
                  type: boolean
                  nullable: true
                posting_restricted_to_mods:
                  type: boolean
                  nullable: true
      responses:
        '200':
          description: Community updated
    delete:
      operationId: deleteCommunity
      summary: Delete a community
      description: Delete a community. Requires community creator or admin.
      tags:
      - Community
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - community_id
              - deleted
              properties:
                community_id:
                  $ref: '#/components/schemas/CommunityId'
                deleted:
                  type: boolean
      responses:
        '200':
          description: Community deleted/restored
  /community/list:
    get:
      operationId: listCommunities
      summary: List communities
      description: List communities available on this instance or across the network.
      tags:
      - Community
      security: []
      parameters:
      - name: type_
        in: query
        schema:
          $ref: '#/components/schemas/ListingType'
      - name: sort
        in: query
        schema:
          type: string
          enum:
          - Active
          - Hot
          - New
          - Old
          - TopDay
          - TopWeek
          - TopMonth
          - TopYear
          - TopAll
          - MostComments
          - NewComments
          - TopHour
          - TopSixHour
          - TopTwelveHour
          - TopThreeMonths
          - TopSixMonths
          - TopNineMonths
      - name: show_nsfw
        in: query
        schema:
          type: boolean
      - name: page
        in: query
        schema:
          type: integer
      - name: limit
        in: query
        schema:
          type: integer
      responses:
        '200':
          description: List of communities
  /community/follow:
    post:
      operationId: followCommunity
      summary: Follow or unfollow a community
      description: Subscribe or unsubscribe from a community.
      tags:
      - Community
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - community_id
              - follow
              properties:
                community_id:
                  $ref: '#/components/schemas/CommunityId'
                follow:
                  type: boolean
      responses:
        '200':
          description: Follow status updated
  /community/random:
    get:
      operationId: getRandomCommunity
      summary: Get a random community
      description: Returns a random community from the instance.
      tags:
      - Community
      security: []
      responses:
        '200':
          description: A random community
components:
  schemas:
    CommunityResponse:
      type: object
      properties:
        community_view:
          type: object
          description: The community view with associated metadata
        discussion_languages:
          type: array
          items:
            $ref: '#/components/schemas/LanguageId'
    LanguageId:
      type: integer
      description: Unique identifier for a language
    CommunityId:
      type: integer
      description: Unique identifier for a community
    ListingType:
      type: string
      enum:
      - All
      - Local
      - Subscribed
      - ModeratorView
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
externalDocs:
  description: Lemmy Documentation
  url: https://join-lemmy.org/docs/