Skip to content
Scrappa Get API key
Lemmy API 1 credit/request

Lemmy Community Posts API Documentation

GET https://scrappa.co/api/lemmy/posts

Lemmy Community Posts API returns a page of public posts from a Lemmy community as JSON. Each post carries the id, title, url, body (markdown plus plain-text), community, creator, score, upvotes, downvotes, comment count, publish date and thumbnail. Cursor pagination: pass the next_page value back as page_cursor to fetch the next page. A valid empty result (community with no posts) is a successful response.

Lemmy Community Posts API Documentation 1 credit/request

Endpoint

Request preview
GET
https://scrappa.co/api/lemmy/posts
Auth header
x-api-key
Cost
1 credit/request
community = example
Response preview
200 OK
{
    "data": {
        "posts": [
            {
                "id": 53070436,
                "url": "https://lemmy.world/pictrs/image/def456.jpeg",
                "body": "Post body markdown content",
                "score": 42,
                "title": "A technology post title",
                "creator": {
                    "id": 3100864,
                    "name": "EatingPies"
                },
                "upvotes": 45,
...

Parameters

Start with the required fields, then add optional filters only when your use case needs them.

Runnable path

1 required parameter needed before sending a request.

5 optional filters available.

community string Required

Lemmy community name. Example: technology.

Example value example
sort string Optional

Sort order. One of: Hot, Active, New, TopDay, TopWeek, TopMonth, TopYear, TopAll, MostComments, NewComments. Defaults to Hot.

Example value relevance
type_ string Optional

Listing type. One of: All, Local, Subscribed. Defaults to All.

Example value example
limit integer Optional

Posts per page. Server caps at 50. Defaults to 20.

Example value 10
page_cursor string Optional

Cursor from a previous response's next_page field. Omit for the first page.

Example value example
instance string Optional

Lemmy instance hostname. Defaults to lemmy.world. The hostname must resolve to a public address; private, loopback and unresolvable hosts are rejected without charge.

Example value example

Response Schema

Example response fields are illustrative; inspect the JSON before integrating.

Example response fields

Scan these fields before integrating.

data meta success
JSON Response
200 OK
{
    "data": {
        "posts": [
            {
                "id": 53070436,
                "url": "https://lemmy.world/pictrs/image/def456.jpeg",
                "body": "Post body markdown content",
                "score": 42,
                "title": "A technology post title",
                "creator": {
                    "id": 3100864,
                    "name": "EatingPies"
                },
                "upvotes": 45,
                "community": {
                    "id": 2478,
                    "name": "technology",
                    "title": "Technology"
                },
                "downvotes": 3,
                "published": "2026-10-10T14:30:00.000000Z",
                "body_plain": "Post body plain text",
                "language_id": 0,
                "thumbnail_url": "https://lemmy.world/pictrs/image/ghi789.jpeg",
                "comments_count": 167
            }
        ],
        "has_more": true,
        "next_page": "P329c8fa"
    },
    "meta": {
        "billable": true,
        "endpoint_family": "post_list"
    },
    "success": true
}

Errors

Handle these documented responses before retrying or showing customer-facing failures.

422

Validation Error

The community parameter is missing or a parameter value is invalid. This response is not billable.

{
    "errors": {
        "community": [
            "The community field is required."
        ]
    },
    "message": "The request validation failed"
}
422

Invalid Parameter

Lemmy rejected one or more parameter values (for example an unknown sort). This response is not billable.

{
    "error": {
        "code": "INVALID_PARAMETER",
        "message": "The Lemmy API is temporarily unavailable. Please retry."
    },
    "success": false
}
404

Community Not Found

The requested Lemmy community was not found. This response is not billable.

{
    "error": {
        "code": "NOT_FOUND",
        "message": "The requested Lemmy resource was not found."
    },
    "success": false
}
503

Upstream Unavailable

The Lemmy API is temporarily unavailable. This response is not billable.

{
    "error": {
        "code": "UPSTREAM_UNAVAILABLE",
        "message": "The Lemmy API is temporarily unavailable. Please retry."
    },
    "success": false
}

Generate Code with AI

Copy a ready-made prompt with all the endpoint details, parameters, and example responses. Paste it into ChatGPT, Claude, or any AI assistant to instantly generate working code.

Try It Live

Test this endpoint in our interactive playground with real data.