# Lemmy Community Scraper (`devilscrapes/lemmy-community-scraper`) Actor

Scrape posts and comments from any public Lemmy community on any Lemmy instance — the federated Reddit alternative. We handle the pagination, retries, fingerprint rotation, and rate-limit pacing — you get typed dataset rows ready to export to CSV or JSON.

- **URL**: https://apify.com/devilscrapes/lemmy-community-scraper.md
- **Developed by:** [DevilScrapes](https://apify.com/devilscrapes) (community)
- **Categories:** Social media
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

<img src=".actor/icon.svg" width="160" alt="Lemmy Community Scraper" />

## Lemmy Community Scraper

_We do the dirty work so your dataset stays clean._ 😈

**$2.05 / 1,000 posts** — Export posts and optional comments from any public Lemmy community on any Lemmy instance, via the public `/api/v3/` REST API. No Lemmy account. No API key. No browser automation.

Lemmy is the federated Reddit alternative running the ActivityPub protocol; every Lemmy instance exposes the same versioned REST API with no authentication required for public reads. This Actor fetches community metadata once, cursor-paginates through posts, optionally fetches comments per post, and emits a flat dataset with community + post metadata denormalised onto every row — so flat CSV exports are self-contained for analytics, BI, or SQL with zero joins.

### 🎯 What this scrapes
This Actor exports two row types into a single dataset, discriminated by the `row_type` column:

1. **Post rows** (`row_type="post"`) — one row per post in the target community. Always emitted.
2. **Comment rows** (`row_type="comment"`) — one row per comment on each post. Emitted only when `includeComments` is enabled.

Every row carries the community context (name, title, subscriber count, posts count, ActivityPub `actor_id`) and the post context (id, title, score, upvotes, downvotes, comment count) so downstream tools see a fully denormalised, join-free table. Comment rows additionally carry the comment id, content, path, score, and a derived `comment_parent_id` field that preserves the parent-child relationship for tree reconstruction.

| Field | Type | Description |
|---|---|---|
| `row_type` | string | `post` or `comment` |
| `instance_url` | string | Lemmy instance base URL |
| `community_actor_id` | string | ActivityPub actor_id of the community |
| `community_name` | string | Local community name (e.g. `asklemmy`) |
| `community_title` | string | Human-readable community title |
| `community_description` | string \| null | Community description, if set |
| `community_subscribers` | integer | Subscriber count |
| `community_posts_count` | integer | Total posts in the community |
| `community_local` | boolean | True if the community is local to the instance |
| `post_id` | integer | Lemmy local post id |
| `post_ap_id` | string | ActivityPub canonical URL of the post |
| `post_url` | string | Canonical post URL (same as `post_ap_id`) |
| `post_title` | string | Post title |
| `post_body` | string \| null | Post body text; null on link posts |
| `post_external_url` | string \| null | External link URL; null on text posts |
| `post_score` | integer | Net post score (upvotes - downvotes) |
| `post_upvotes` | integer | Number of upvotes on the post |
| `post_downvotes` | integer | Number of downvotes on the post |
| `post_comments_count` | integer | Total comments on the post |
| `post_published` | string | ISO 8601 UTC datetime |
| `post_updated` | string \| null | ISO 8601 UTC datetime of last edit |
| `comment_id` | integer \| null | Lemmy local comment id (comment rows only) |
| `comment_path` | string \| null | Lemmy thread path (e.g. `0.12345.67890`) |
| `comment_content` | string \| null | Comment body text |
| `comment_score` | integer \| null | Net comment score |
| `comment_published` | string \| null | ISO 8601 UTC datetime |
| `comment_parent_id` | integer \| null | Parent comment id derived from path |
| `author_name` | string | Author username (local form) |
| `author_display_name` | string \| null | Author display name, if set |
| `scraped_at` | string | ISO 8601 UTC datetime this row was written |

### 🔥 Features
- No Lemmy account required — uses the public unauthenticated `/api/v3/` REST API.
- Supports any Lemmy instance — `lemmy.world`, `lemmy.ml`, `beehaw.org`, `sh.itjust.works`, and any other public instance running Lemmy v0.19.
- Two operating modes from one input — posts only, or posts + comments in the same dataset.
- Federated community syntax — pass `memes@lemmy.world` to scrape a remote community from any other instance, or `asklemmy` for a local community on the chosen instance.
- 17-token sort enum — `Active`, `Hot`, `New`, `Old`, `Scaled`, `Controversial`, `MostComments`, `NewComments`, `TopHour`, `TopSixHour`, `TopTwelveHour`, `TopDay`, `TopWeek`, `TopMonth`, `TopYear`, `TopAll`.
- Cursor-based post pagination + integer-page comment pagination — both verified against Lemmy v0.19 on live instances.
- Denormalised output — community metadata on every row, no joins needed for downstream analytics or CSV exports.
- `comment_parent_id` derived from `comment.path` — preserves the comment tree so callers can reconstruct threaded discussion.
- Exponential backoff with `Retry-After` honoured for `408 / 429 / 503` responses; max 5 attempts.
- Pure HTTP client (`curl-cffi` with browser fingerprint impersonation) — no browser automation, low compute footprint.
- Pydantic v2 input validation with named sort enum and range bounds; bare `Top` (invalid on v0.19) is rejected up-front before any network call.
- Pairs with `bluesky-feed-posts` and `bluesky-starter-pack` as the Federated Social Suite.

### 💡 Use cases
- **Reddit-alternative migration research** — track how communities and engagement migrate from Reddit to Lemmy after policy changes; compare subscriber and post growth across instances.
- **Newsroom monitoring** — subscribe to journalism, politics, or breaking-news Lemmy communities and pipe the latest top posts to Slack or Google Sheets via Apify integrations.
- **Brand monitoring on the fediverse** — Lemmy is a growing channel for product complaints, support discussions, and competitor mentions outside the Reddit walled garden; this Actor surfaces them on a schedule.
- **Academic federated-social research** — Lemmy's open, public REST API is significantly more accessible than Reddit's gated API; ideal for longitudinal community studies, sentiment tracking, or content-moderation research.
- **Community trend analysis** — pull `TopWeek` posts across multiple communities and rank by score, comment count, or upvote ratio to benchmark community health.
- **Comment-tree reconstruction** — combine post rows with comment rows (joined by `post_id`) and the `comment_parent_id` field to rebuild the full discussion tree for NLP or moderation pipelines.

### ⚙️ How to use it
1. Open the Actor input form.
2. Set **Lemmy instance URL** to the base URL of any public Lemmy instance — e.g. `https://lemmy.world` or `https://lemmy.ml`. Trailing slash is stripped automatically.
3. Set **Community name** to the community you want to scrape. Either local form (`asklemmy`) for a community on the chosen instance, or federated form (`memes@lemmy.world`) for a remote community visible from the chosen instance.
4. Pick a **Post sort order** from the 17 valid tokens. `Hot` (default) blends recency and engagement; `TopWeek` returns the highest-scoring posts of the last 7 days; `New` returns chronological order.
5. Adjust **Max posts** (default 100, max 5,000).
6. Toggle **Include comments** if you want comment rows alongside post rows. When enabled, set **Max comments per post** (default 50, max 500).
7. Leave **Use Apify Proxy** off unless you are behind a restrictive ISP — Lemmy instances do not block datacenter IPs, so direct routing is faster and free.
8. Click **Start**. Results stream into the default dataset and can be exported as JSON, CSV, Excel, or XML via the **Export** button.

#### Single-community example

```json
{
  "instanceUrl": "https://lemmy.world",
  "communityName": "asklemmy",
  "sort": "TopWeek",
  "maxPosts": 200,
  "includeComments": false,
  "useProxy": false
}
````

#### Posts + comments example

```json
{
  "instanceUrl": "https://lemmy.ml",
  "communityName": "memes@lemmy.world",
  "sort": "Hot",
  "maxPosts": 50,
  "includeComments": true,
  "maxCommentsPerPost": 25,
  "useProxy": false
}
```

### 📥 Input

| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| `instanceUrl` | string | yes | — | Base URL of the Lemmy instance |
| `communityName` | string | yes | — | Community name (local or federated form) |
| `sort` | string (enum) | no | `Hot` | One of 17 valid Lemmy v0.19 sort tokens |
| `maxPosts` | integer | no | `100` | Max post rows emitted (1–5000) |
| `includeComments` | boolean | no | `false` | If true, also fetch comments per post |
| `maxCommentsPerPost` | integer | no | `50` | Max comment rows per post (1–500) |
| `useProxy` | boolean | no | `false` | Route through Apify Proxy (BUYPROXIES94952) |

The full list of valid `sort` tokens is: `Active`, `Hot`, `New`, `Old`, `Scaled`, `Controversial`, `MostComments`, `NewComments`, `TopHour`, `TopSixHour`, `TopTwelveHour`, `TopDay`, `TopWeek`, `TopMonth`, `TopYear`, `TopAll`. Bare `Top` is **not** valid on Lemmy v0.19 and is rejected by the input validator before any network call.

### 📤 Output

One row per post or per comment. Community + post metadata is denormalised onto every comment row so a flat CSV is self-contained.

```json
{
  "row_type": "post",
  "instance_url": "https://lemmy.world",
  "community_actor_id": "https://lemmy.world/c/asklemmy",
  "community_name": "asklemmy",
  "community_title": "Ask Lemmy",
  "community_description": "A Lemmy equivalent of Ask Reddit.",
  "community_subscribers": 39567,
  "community_posts_count": 8853,
  "community_local": true,
  "post_id": 46934299,
  "post_ap_id": "https://leminal.space/post/35446889",
  "post_url": "https://leminal.space/post/35446889",
  "post_title": "What's something that you feel genuinely sad about?",
  "post_body": null,
  "post_external_url": null,
  "post_score": 34,
  "post_upvotes": 38,
  "post_downvotes": 4,
  "post_comments_count": 18,
  "post_published": "2026-05-16T09:31:47.723504Z",
  "post_updated": null,
  "post_nsfw": false,
  "post_featured_community": false,
  "post_locked": false,
  "comment_id": null,
  "comment_ap_id": null,
  "comment_path": null,
  "comment_content": null,
  "comment_score": null,
  "comment_published": null,
  "comment_parent_id": null,
  "author_actor_id": "https://leminal.space/u/FosterMolasses",
  "author_name": "FosterMolasses",
  "author_display_name": null,
  "author_bot_account": false,
  "author_published": "2025-01-17T14:35:51.850105Z",
  "scraped_at": "2026-05-16T12:00:00.000Z"
}
```

Comment rows have the same shape, with `row_type="comment"` and the comment fields populated. The `comment_parent_id` field is derived from the penultimate segment of `comment.path` — `null` for top-level comments, otherwise the integer id of the parent comment — so callers can reconstruct the full thread tree without an extra API call.

#### Export formats

- **JSON** — full fidelity, all fields, newline-delimited
- **CSV** — flat, one row per post or comment, all columns including denormalised community + post metadata
- **Excel** — `.xlsx` via the Apify dataset converter
- **XML** — structured per-item

All formats are available via the Apify API: `GET /datasets/{id}/items?format=csv&clean=true`.

### 💰 Pricing

Pay-Per-Event (PPE) — you pay only for what you use:

| Event | Price (USD) | When |
|---|---|---|
| `actor-start` | $0.05 | Once per run, at boot |
| `result-row` | $0.002 | Per post row written to the dataset |
| `result-row-comment` | $0.001 | Per comment row written to the dataset |

#### Example costs

| Run | Cost |
|---|---|
| 100 posts (no comments) | $0.25 |
| 500 posts (no comments) | $1.05 |
| 1,000 posts (no comments) | $2.05 |
| 100 posts × 50 comments = 5,100 rows | $5.30 |
| 500 posts × 25 comments = 13,000 rows | $13.55 |

Comment rows are half the price of post rows because they are higher-volume and have lower per-row commercial value for most analytics use cases. Disable comment fetching when you only need post-level data — the Actor is significantly cheaper and faster.

### 🚧 Limitations

- **Public communities only.** Private or access-restricted communities require authentication and are out of scope.
- **One community per run.** This Actor scrapes one community per run; multi-community or instance-wide listings need separate runs (or a different Actor).
- **No media download.** Image, video, and external link URLs are captured in the row, but the Actor does not download the media content itself.
- **No real-time streaming.** The Actor takes a snapshot at run time; for live updates schedule recurring runs via Apify Schedules.
- **7-day default storage retention** on the Apify FREE tier. Export your dataset immediately after the run or upgrade for longer retention.
- **Lemmy v0.19 only.** The Actor targets the v0.19 API surface and field paths. v0.20 (when released) may require updates; Pydantic `extra="ignore"` absorbs additive changes but breaking removes will require a new version.
- **Comment-tree depth is preserved via `comment_path`** but the Actor does not return comments in a pre-nested structure — callers reconstruct the tree from `comment_parent_id`.

### ❓ FAQ

**Do I need a Lemmy account?**

No. Lemmy's public `/api/v3/` REST API is unauthenticated by design — every endpoint this Actor calls is open to anyone without a login, signup, or API key.

**What is the federated community format?**

Lemmy communities can live on any instance but be subscribed to and read from any other instance via ActivityPub federation. The federated form is `community@instance.tld` — for example `memes@lemmy.world` refers to the `memes` community hosted on `lemmy.world`, accessible from any other Lemmy instance that has fetched it via federation. Local communities (on the instance you point this Actor at) use the bare local name like `asklemmy`.

**Why does `sort=Top` not work?**

Lemmy v0.19 removed the bare `Top` sort token and replaced it with compound tokens that embed a time range: `TopHour`, `TopSixHour`, `TopTwelveHour`, `TopDay`, `TopWeek`, `TopMonth`, `TopYear`, `TopAll`. Passing bare `Top` returns `{"error": "unknown"}` from the Lemmy API. This Actor rejects bare `Top` up-front during input validation — pick the compound token whose time range you want.

**Which Lemmy instance should I point this at?**

Any public Lemmy instance running v0.19. `lemmy.world` and `lemmy.ml` are the two largest general-purpose instances and good defaults. Topic-specific instances like `beehaw.org`, `sh.itjust.works`, or `programming.dev` are also fully supported. The instance URL you choose determines which "view" of the federated network this Actor scrapes from — different instances may have fetched different remote communities and different comment ranges, so re-running against a different instance can return slightly different remote-community data.

**How do I reconstruct the comment tree from the dataset?**

Each comment row carries `comment_id` and `comment_parent_id`. Group rows by `post_id`, then for each post: top-level comments have `comment_parent_id IS NULL`; replies have `comment_parent_id` pointing at the parent comment's `comment_id` within the same post. The `comment_path` field encodes the full ancestry (e.g. `0.12345.67890` means parent comment `12345`, this comment `67890`) for callers who need it.

**Is scraping public Lemmy data legal?**

Lemmy is AGPL-3.0 free and open-source software. Lemmy instances explicitly serve public community data through an unauthenticated REST API designed for federation. Always verify the specific instance's terms of service and your local jurisdiction's data-protection rules before using scraped data for commercial purposes.

### Related Actors

Part of the Devil Scrapes **Federated Social Suite**:

- [Bluesky Starter Pack Scraper](https://apify.com/DevilScrapes/bluesky-starter-pack) — export full member lists from any public Bluesky Starter Pack via the AT Protocol public API.
- [Bluesky Feed Posts Scraper](https://apify.com/DevilScrapes/bluesky-feed-posts) — export posts from any public Bluesky custom feed or algorithm feed, with denormalised feed metadata on every row.

All three Actors share consistent pricing ($0.002 per post row, $0.05 per run) and field-naming conventions (`<entity>_<field>` snake\_case) so cross-network federated-social analyses can join cleanly on `author_handle` / `author_name`.

### 💬 Your feedback

Found a bug, hit a rate limit, or need a new field on the output row? Open an issue on the Actor's Apify Store page or contact the Devil Scrapes team at [apify.com/DevilScrapes](https://apify.com/DevilScrapes). We ship updates within days of validated reports.

# Actor input Schema

## `instanceUrl` (type: `string`):

Base URL of the Lemmy instance to query, e.g. <code>https://lemmy.world</code> or <code>https://lemmy.ml</code>. Trailing slash is stripped.

## `communityName` (type: `string`):

Community to scrape. Local form (e.g. <code>asklemmy</code>) for communities on the chosen instance, or federated form (e.g. <code>memes@lemmy.world</code>) for remote communities.

## `sort` (type: `string`):

Sort token used by Lemmy <code>/post/list</code>. Bare <code>Top</code> is not supported on v0.19 — use a <code>TopHour</code>/<code>TopDay</code>/<code>TopWeek</code>/etc. token instead.

## `maxPosts` (type: `integer`):

Maximum number of post rows to emit. Pagination stops once this limit is reached.

## `includeComments` (type: `boolean`):

If enabled, the Actor also fetches and emits comment rows for each post (row\_type="comment").

## `maxCommentsPerPost` (type: `integer`):

Maximum comment rows emitted per post. Ignored when <code>includeComments</code> is disabled.

## `useProxy` (type: `boolean`):

Route requests through Apify Proxy (BUYPROXIES94952). Lemmy instances do not block datacenter IPs — leave disabled unless you are behind a restrictive ISP.

## Actor input object example

```json
{
  "instanceUrl": "https://lemmy.world",
  "communityName": "asklemmy",
  "sort": "Hot",
  "maxPosts": 100,
  "includeComments": false,
  "maxCommentsPerPost": 50,
  "useProxy": false
}
```

# Actor output Schema

## `datasetItems` (type: `string`):

All dataset items as JSON.

## `datasetItemsCsv` (type: `string`):

Same data exported to CSV.

## `datasetView` (type: `string`):

Open the run dataset in the Console.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "instanceUrl": "https://lemmy.world",
    "communityName": "asklemmy"
};

// Run the Actor and wait for it to finish
const run = await client.actor("devilscrapes/lemmy-community-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "instanceUrl": "https://lemmy.world",
    "communityName": "asklemmy",
}

# Run the Actor and wait for it to finish
run = client.actor("devilscrapes/lemmy-community-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "instanceUrl": "https://lemmy.world",
  "communityName": "asklemmy"
}' |
apify call devilscrapes/lemmy-community-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=devilscrapes/lemmy-community-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Lemmy Community Scraper",
        "description": "Scrape posts and comments from any public Lemmy community on any Lemmy instance — the federated Reddit alternative. We handle the pagination, retries, fingerprint rotation, and rate-limit pacing — you get typed dataset rows ready to export to CSV or JSON.",
        "version": "0.2",
        "x-build-id": "SRbAdHb0XTzm3Pi56"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/devilscrapes~lemmy-community-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-devilscrapes-lemmy-community-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/devilscrapes~lemmy-community-scraper/runs": {
            "post": {
                "operationId": "runs-sync-devilscrapes-lemmy-community-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/devilscrapes~lemmy-community-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-devilscrapes-lemmy-community-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "instanceUrl",
                    "communityName"
                ],
                "properties": {
                    "instanceUrl": {
                        "title": "Lemmy instance URL",
                        "type": "string",
                        "description": "Base URL of the Lemmy instance to query, e.g. <code>https://lemmy.world</code> or <code>https://lemmy.ml</code>. Trailing slash is stripped."
                    },
                    "communityName": {
                        "title": "Community name",
                        "minLength": 1,
                        "maxLength": 255,
                        "type": "string",
                        "description": "Community to scrape. Local form (e.g. <code>asklemmy</code>) for communities on the chosen instance, or federated form (e.g. <code>memes@lemmy.world</code>) for remote communities."
                    },
                    "sort": {
                        "title": "Post sort order",
                        "enum": [
                            "Active",
                            "Hot",
                            "New",
                            "Old",
                            "Scaled",
                            "Controversial",
                            "MostComments",
                            "NewComments",
                            "TopHour",
                            "TopSixHour",
                            "TopTwelveHour",
                            "TopDay",
                            "TopWeek",
                            "TopMonth",
                            "TopYear",
                            "TopAll"
                        ],
                        "type": "string",
                        "description": "Sort token used by Lemmy <code>/post/list</code>. Bare <code>Top</code> is not supported on v0.19 — use a <code>TopHour</code>/<code>TopDay</code>/<code>TopWeek</code>/etc. token instead.",
                        "default": "Hot"
                    },
                    "maxPosts": {
                        "title": "Max posts",
                        "minimum": 1,
                        "maximum": 5000,
                        "type": "integer",
                        "description": "Maximum number of post rows to emit. Pagination stops once this limit is reached.",
                        "default": 100
                    },
                    "includeComments": {
                        "title": "Include comments",
                        "type": "boolean",
                        "description": "If enabled, the Actor also fetches and emits comment rows for each post (row_type=\"comment\").",
                        "default": false
                    },
                    "maxCommentsPerPost": {
                        "title": "Max comments per post",
                        "minimum": 1,
                        "maximum": 500,
                        "type": "integer",
                        "description": "Maximum comment rows emitted per post. Ignored when <code>includeComments</code> is disabled.",
                        "default": 50
                    },
                    "useProxy": {
                        "title": "Use Apify Proxy",
                        "type": "boolean",
                        "description": "Route requests through Apify Proxy (BUYPROXIES94952). Lemmy instances do not block datacenter IPs — leave disabled unless you are behind a restrictive ISP.",
                        "default": false
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
