# Lemmy Community Posts API Documentation

<p><strong>Lemmy Community Posts API</strong> 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.</p>

- **Documentation:** [https://scrappa.co/docs/lemmy-api/lemmy_posts](https://scrappa.co/docs/lemmy-api/lemmy_posts)
- **API group:** Lemmy API
- **Endpoint:** `GET https://scrappa.co/api/lemmy/posts`

## Authentication

Send your Scrappa API key in the `X-API-KEY` request header. Paid endpoints also support accountless x402 payments when called without an API key.

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `community` | string | Yes | Lemmy community name. Example: technology. |
| `sort` | string | No | Sort order. One of: Hot, Active, New, TopDay, TopWeek, TopMonth, TopYear, TopAll, MostComments, NewComments. Defaults to Hot. |
| `type_` | string | No | Listing type. One of: All, Local, Subscribed. Defaults to All. |
| `limit` | integer | No | Posts per page. Server caps at 50. Defaults to 20. |
| `page_cursor` | string | No | Cursor from a previous response's next_page field. Omit for the first page. |
| `instance` | string | No | 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 response

```json
{
    "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

| Status | Error | Description |
| --- | --- | --- |
| 422 | Validation Error | The community parameter is missing or a parameter value is invalid. This response is not billable. |
| 422 | Invalid Parameter | Lemmy rejected one or more parameter values (for example an unknown sort). This response is not billable. |
| 404 | Community Not Found | The requested Lemmy community was not found. This response is not billable. |
| 503 | Upstream Unavailable | The Lemmy API is temporarily unavailable. This response is not billable. |

## More Scrappa resources

- [API documentation](https://scrappa.co/docs)
- [Full LLM-readable API reference](https://scrappa.co/llms-full.txt)
- [OpenAPI specification](https://scrappa.co/docs/api.json)
- [Pricing](https://scrappa.co/pricing)
