# Lemmy Scraper: Posts, Comments, Communities & Users (`winterlock/lemmy-scraper`) Actor

Scrape posts, comments, communities, search results and user profiles from any Lemmy instance in the fediverse, through the instance's own official API. No login or API key.

- **URL**: https://apify.com/winterlock/lemmy-scraper.md
- **Developed by:** [Alex Burton](https://apify.com/winterlock) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 posts

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/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

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

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Lemmy Scraper: Posts, Comments, Communities & Users

Collect data from **any Lemmy instance in the fediverse** through that server's own official API. No login, no API key, no HTML parsing.

| Mode | What you get |
|---|---|
| **Posts** | Title, body, link, score, up/down votes, comment count, community, author and timestamps |
| **Comments** | Comment text with its thread depth, score, author, community and parent post |
| **Communities** | The instance's community directory with subscriber counts and weekly/monthly active users |
| **Search** | Posts, comments, communities and users matching a query |
| **Users** | Profile, bio, post and comment counts, join date |

### Why use this one

- **Any instance, not just one.** The server is an input, so the same Actor reads lemmy.world, lemmy.ml, beehaw.org, sh.itjust.works or your own private server. Most Lemmy tools are hard-wired to a single host.
- **Official API.** Lemmy publishes and documents these endpoints; nothing here depends on the look of the web front end.
- **Federated or local.** Choose whether to include content federated in from other servers or only what this instance hosts.
- **Clear failure messages.** Lemmy instances run different versions. If a server doesn't answer the `/api/v3` path, the log says so and names the instance, instead of returning an empty dataset with no explanation.
- **Flat output.** Posts, comments, communities and users come back as plain rows ready for a spreadsheet or a database.

### How to use it

1. Choose **What to scrape**.
2. Set the **Lemmy instance** (defaults to `lemmy.world`).
3. Optionally narrow to **Communities**, or fill in **Search terms** or **Users**.
4. Pick a **Sort order** and a cap, then click **Start**.

Communities are accepted in any of these forms:

```
technology
!technology@lemmy.world
https://lemmy.world/c/technology
```

#### Example input: hot posts in one community

```json
{
  "mode": "posts",
  "instance": "lemmy.world",
  "communities": ["technology"],
  "sort": "Hot",
  "maxItemsPerTarget": 100
}
```

#### Example input: one post's whole discussion

```json
{
  "mode": "comments",
  "instance": "lemmy.world",
  "postId": "https://lemmy.world/post/53225445",
  "sort": "Old",
  "maxItemsPerTarget": 500
}
```

#### Example input: biggest communities on an instance

```json
{
  "mode": "communities",
  "instance": "lemmy.ml",
  "sort": "TopAll",
  "maxItemsPerTarget": 200
}
```

### Output

Every row has a `type` field: `post`, `comment`, `community` or `user`. The dataset ships with a table view for each.

**Post**

```json
{
  "type": "post",
  "id": 53225445,
  "title": "A new release is out",
  "url": "https://example.com/release",
  "score": 39,
  "upvotes": 40,
  "downvotes": 1,
  "commentCount": 6,
  "communityName": "technology",
  "creatorName": "someone",
  "publishedAt": "2026-10-16T22:31:13Z",
  "nsfw": false,
  "postUrl": "https://lemmy.world/post/53225445",
  "instance": "https://lemmy.world"
}
```

**Community**

```json
{
  "type": "community",
  "rank": 1,
  "name": "technology",
  "title": "Technology",
  "subscribers": 88826,
  "postCount": 22232,
  "commentCount": 968547,
  "usersActiveMonth": 14686,
  "url": "https://lemmy.world/c/technology"
}
```

### Pricing

Pay only for results:

| Result | Price |
|---|---|
| Post or comment | $1.00 per 1,000 |
| Community | $3.00 per 1,000 |
| User profile | $3.00 per 1,000 |

Set a maximum spend per run in the run options and the Actor stops cleanly when it's reached.

### Limits to know about

- **Instances run different Lemmy versions.** This Actor targets `/api/v3`, which the great majority of servers still serve. A server that has moved on will answer 404; the log then names the instance so you know to switch servers rather than wonder why the run was empty.
- **Volunteer-run servers rate-limit hard.** The default of 2 parallel requests is deliberate. Raising it is the fastest way to get temporarily blocked, and lemmy.world in particular returns HTTP 429 quickly.
- **Field coverage varies by version and by instance.** Optional fields such as a user's display name, avatar or banner are omitted entirely by some servers; those come back as `null` rather than breaking the run.
- **Only public, logged-out data.** Subscribed listings need an account, so that listing type returns nothing without one.
- **Comment depth** is derived from Lemmy's `path` field. On instances that don't populate it, `depth` is `null`.
- Votes are the instance's own tallies and can differ between servers for the same federated post.

### FAQ

**Do I need a Lemmy account?** No. Everything here is public, logged-out data.

**Can I scrape more than one instance in a run?** Not in a single run — set the instance per run. Create one Apify task per instance and schedule them separately.

**Why did my run return nothing?** Check the log. Either the instance didn't answer the `/api/v3` path, the community name was wrong, or a rate limit was hit. The message says which.

**Can I monitor a community?** Yes. Use Posts with sort `New`, set a schedule in Apify Console, and connect the dataset to Slack, Google Sheets, Zapier or Make.

**Is this allowed?** Lemmy's API is open by design and these are the same endpoints its own apps use. Keep the concurrency low out of courtesy to volunteer-run servers. Output contains public usernames and post text, so handle it in line with any privacy law that applies to you.

### Feedback

Found a bug or need a field that's missing? Open an issue on the Actor's **Issues** tab.

# Actor input Schema

## `mode` (type: `string`):

Posts, comments, the community directory, a search, or user profiles.

## `instance` (type: `string`):

Which server to read. Either lemmy.world or https://lemmy.world works. Try lemmy.ml, beehaw.org, sh.itjust.works or your own server.

## `communities` (type: `array`):

Limit to specific communities. Use technology, !technology@lemmy.world, or a community link. Leave empty to read the whole instance.

## `searchTerms` (type: `array`):

For Search. One query per line.

## `users` (type: `array`):

For Users. Use a username, user@instance, or a user link.

## `postId` (type: `string`):

For Comments. A post number like 53225445 or a link like https://lemmy.world/post/53225445 reads that one post's whole discussion instead of a community feed. A link is read from its own instance, because post numbers differ from server to server.

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

Hot and Active are the live feeds. The Top options cover a fixed window.

## `listingType` (type: `string`):

All includes federated content from other instances. Local is only what this server hosts.

## `searchType` (type: `string`):

Which kind of result a search returns.

## `maxItemsPerTarget` (type: `integer`):

Lemmy pages 50 at a time.

## `maxItems` (type: `integer`):

Stop the run after saving this many items. Leave empty for no limit.

## `maxConcurrency` (type: `integer`):

Lemmy instances are volunteer-run and rate-limit quickly. Keep this low to stay a good citizen.

## `proxyConfiguration` (type: `object`):

Not needed for most runs.

## Actor input object example

```json
{
  "mode": "posts",
  "instance": "lemmy.world",
  "searchTerms": [
    "linux"
  ],
  "sort": "Hot",
  "listingType": "All",
  "searchType": "Posts",
  "maxItemsPerTarget": 50,
  "maxConcurrency": 2,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `results` (type: `string`):

No description

# 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 = {
    "searchTerms": [
        "linux"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("winterlock/lemmy-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 = { "searchTerms": ["linux"] }

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

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

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

```

## CLI example

```bash
echo '{
  "searchTerms": [
    "linux"
  ]
}' |
apify call winterlock/lemmy-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,winterlock/lemmy-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/SweHW93k5Bz7tqmS9/builds/QU1gy6eFBz5WjmbRu/openapi.json
