# Lemmy Community Discovery, Posts & Comments (`transparent_meteorite/lemmy-communities-posts-scraper`) Actor

Scrape Lemmy community posts, comments, community directories and search from the official public Lemmy API. Scores, authors, dates and links. No login.

- **URL**: https://apify.com/transparent_meteorite/lemmy-communities-posts-scraper.md
- **Developed by:** [Detroit Web Agent - Open Data](https://apify.com/transparent_meteorite) (community)
- **Categories:** Social media, Open source, Marketing
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.17 / 1,000 record returneds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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 Community Discovery, Posts & Comments

Use this to scrape Lemmy, the open Reddit-style fediverse network: community posts sorted Hot, New or Top, the full comment tree of any post, a searchable directory of communities, keyword search across posts, and a user's posts. It reads the official public Lemmy HTTP API of any instance you name (lemmy.world by default). No login, no cookies, no API key, no proxy.

Every post row carries 36 fields (title, body, link and link domain, score, upvotes, downvotes, comment count, author, community, published and edited time, adult-content flag, language, thumbnail, pinned and locked state, instance). Every comment row carries 28 fields including depth, parent comment and reply count. Every community row carries 24 fields including subscribers, posts, comments and daily, weekly and monthly active users.

### Run in 30 seconds

1. Open the **Input** tab. The prefilled values (mode **Community posts**, community `technology`, instance `lemmy.world`, 25 results) are a ready-to-run test.
2. Click **Start**. A first dataset is normally ready in under 15 seconds.
3. Open the **Posts** table in the Output tab, or download the dataset as JSON, CSV, Excel or HTML.
4. Change **What to scrape** to switch to comments, community search, keyword search or a user's posts.

### What it does

Lemmy is a federated, open-source link aggregator. Every instance exposes a public, read-only HTTP API that returns the same data you see on the site. This Actor wraps that interface into one pay-per-result tool with five modes:

| Mode | Input | Returns |
|---|---|---|
| **Community posts** | Community names, name@instance or URLs | Posts sorted Hot, New, Active, Top (hour to all time), Most Comments, Controversial |
| **Comments of a post** | Post URLs | The whole comment tree with depth, parent and score |
| **Search posts** | Keywords, optional community filter | Matching posts across the instance's federated content |
| **Community directory** | A search query, or nothing for the biggest communities | Communities with subscribers, activity and description |
| **User posts** | Usernames | The posts a user has submitted |

Remote communities work too: ask lemmy.world for `fedigardening@lemmy.ml` or paste a full `https://lemmy.ml/c/...` URL and the Actor reads it from the right place. If an instance has moved to the newer API path, the Actor detects that and switches automatically.

### What you get

| | |
|---|---|
| Price per 1,000 results (Free plan) | $0.279 |
| Start fee | $0.00005 per run |
| Plan discounts | Bronze $0.258, Silver $0.219, Gold and above $0.168 |
| Modes | posts, comments, communities, search, users |
| Adult-flagged rows | skipped by default and never charged |
| Login or API key needed | no |

### Input

- **What to scrape**: the mode.
- **Lemmy instance**: lemmy.world, lemmy.ml, sh.itjust.works, programming.dev, lemm.ee or any other public instance.
- **Communities**: `technology`, `technology@lemmy.world` or `https://lemmy.world/c/technology`.
- **Post URLs**: `https://lemmy.world/post/53755117`, or a numeric ID on the chosen instance.
- **Search terms**: one search per term; **Limit search to a community** narrows it.
- **Community search query**: for the directory; leave empty to list the biggest communities.
- **Users**: `username` or `username@instance`.
- **Sort**, **Comment sort**, **Directory sort**: ordering for each mode.
- **Max results**: total rows across all targets, shared evenly.
- **Include adult-flagged content**: off by default.

### Example input

```json
{
  "mode": "communityPosts",
  "communities": ["technology", "selfhosted@lemmy.world"],
  "instance": "lemmy.world",
  "sort": "TopWeek",
  "maxItems": 100
}
```

### Output sample

```json
{
  "recordType": "post",
  "id": 53755117,
  "url": "https://lemmy.world/post/53755117",
  "title": "Bluesky blocks links to leaked DHS employee data as government seeks takedowns",
  "externalUrl": "https://techcrunch.com/2026/10/29/bluesky-blocks-links-to-leaked-dhs-employee-data-as-government-seeks-takedowns/",
  "externalDomain": "techcrunch.com",
  "score": 61,
  "upvotes": 64,
  "downvotes": 3,
  "commentCount": 12,
  "authorName": "example_user",
  "communityName": "technology",
  "published": "2026-10-29T23:37:47.151851Z",
  "adultFlagged": false,
  "language": "en",
  "instance": "lemmy.world"
}
```

Values above are illustrative. Fields that do not apply to a row (for example subscribers on a post) are `null`, so every row has the same shape and exports cleanly to CSV.

### Use cases

- **Community and brand monitoring**: track mentions of a product, a competitor or a topic across Lemmy and the wider fediverse.
- **Trend research**: pull Top Day, Top Week or Most Comments for communities in your niche and see what the audience engages with.
- **Sentiment and discussion analysis**: export full comment trees with scores and depth for NLP work.
- **Community discovery**: find the largest and most active communities on a topic, with subscribers and active-user counts, before you post or advertise.
- **Datasets**: build research corpora from open, federated discussion.

### Tips for good results

- Use **Max results** as your budget: you are charged per row returned, and the run stops cleanly when your maximum cost per run is reached.
- Sort Top Day returns only what was posted in the last 24 hours, so small communities can return fewer rows than you asked for.
- Search is run by the instance you pick, so results depend on what that instance has federated.
- Comments of a post returns the tree flattened; use `depth` and `parentCommentId` to rebuild it.

### Field reference

Posts: `id, apId, url, title, body, externalUrl, externalDomain, thumbnailUrl, embedTitle, embedDescription, score, upvotes, downvotes, commentCount, authorName, authorDisplayName, authorActorId, authorIsBot, communityName, communityTitle, communityActorId, published, updated, newestCommentTime, adultFlagged, language, locked, featuredCommunity, featuredLocal, removed, deleted, instance, query, source, scrapedAt`.
Comments add `postId, parentCommentId, depth, replyCount`. Communities add `subscribers, subscribersLocal, postCount, usersActiveDay, usersActiveWeek, usersActiveMonth, usersActiveHalfYear, bannerUrl`.

### Pricing and cost control

Pay per event: one **record-returned** event for each post, comment or community row delivered, plus a tiny platform start event of $0.00005 per run. Free plan $0.279 per 1,000 rows, Bronze $0.258, Silver $0.219, Gold and above $0.168. Adult-flagged rows, duplicates and empty runs are never charged. Set **Maximum cost per run** in the run options for a hard ceiling.

### Integrations and scheduling

Schedule runs on the Apify platform for daily or hourly monitoring, call the Actor from the API, or connect to Make, Zapier, n8n, Google Sheets, webhooks and the Apify MCP server. Every run's dataset can be downloaded as JSON, CSV, Excel, XML or HTML.

API example (returns the rows directly):

```bash
curl -X POST "https://api.apify.com/v2/acts/transparent_meteorite~lemmy-communities-posts-scraper/run-sync-get-dataset-items?token=YOUR_APIFY_TOKEN"   -H "Content-Type: application/json"   -d '{"mode":"communityPosts","instance":"lemmy.world","communities":["technology"],"maxItems":25}'
```

### Field reference

Posts: `id, apId, url, title, body, externalUrl, externalDomain, thumbnailUrl, embedTitle, embedDescription, score, upvotes, downvotes, commentCount, authorName, authorDisplayName, authorActorId, authorIsBot, communityName, communityTitle, communityActorId, published, updated, newestCommentTime, adultFlagged, language, locked, featuredCommunity, featuredLocal, removed, deleted, instance, query, source, scrapedAt`.
Comments add `postId, parentCommentId, depth, replyCount`. Communities add `subscribers, subscribersLocal, postCount, usersActiveDay, usersActiveWeek, usersActiveMonth, usersActiveHalfYear, bannerUrl`.

### Pricing and cost control

Pay per event: one **record-returned** event for each post, comment or community row delivered, plus a tiny platform start event of $0.00005 per run. Free plan $0.279 per 1,000 rows, Bronze $0.258, Silver $0.219, Gold and above $0.168. Adult-flagged rows, duplicates and empty runs are never charged. Set **Maximum cost per run** in the run options for a hard ceiling.

### Integrations and scheduling

Schedule runs on the Apify platform for daily or hourly monitoring, call the Actor from the API, or connect to Make, Zapier, n8n, Google Sheets, webhooks and the Apify MCP server. Every run's dataset can be downloaded as JSON, CSV, Excel, XML or HTML.

### Limits

- Reads only what each instance serves publicly; private, removed and login-only content is not available.
- Large comment trees are capped by Max results; an oversize request ends cleanly with a not-checked note instead of timing out.
- Instances may rate limit; the Actor backs off and keeps what it already delivered.
- Data freshness equals the instance: this is a live read, not an archive.

### Fair use and data

The Actor reads only public data that Lemmy instances serve to anyone without authentication, through their documented HTTP API, at a polite rate with automatic back-off on rate limits. It does not log in, bypass access controls or collect private messages. Posts and comments are public content written by their authors; check each community's rules and applicable privacy law (such as GDPR) before storing personal data or republishing it. adult-flagged content is excluded unless you switch it on.

### FAQ

**Do I need a Lemmy account or API key?** No. Only public, unauthenticated read endpoints are used.

**Which instances work?** Any public Lemmy instance that serves the standard API. Enter its domain in Lemmy instance.

**Can I scrape a community hosted on another server?** Yes. Use `name@home.instance` or paste the community URL.

**Why did I get fewer rows than Max results?** The community, search or time window simply had fewer matching rows, or adult-flagged rows were filtered out.

**Are removed and deleted posts included?** The instance normally hides them; the `removed` and `deleted` fields tell you if one slips through.

**What happens if an instance is down or rate limits me?** The Actor retries with back-off, then ends the run cleanly with a status message and keeps what it already delivered.

**Is there a free trial?** New Apify accounts include free monthly credit, enough for thousands of rows at this price.

### Related Actors

- [Mastodon Posts & Hashtags Scraper](https://apify.com/transparent_meteorite/mastodon-posts-hashtags-scraper): the same kind of public fediverse data from Mastodon.
- [Bluesky Posts & Profiles Scraper](https://apify.com/transparent_meteorite/bluesky-posts-profiles-scraper): public Bluesky posts and profiles.
- [Hacker News Search Scraper](https://apify.com/transparent_meteorite/hacker-news-search-scraper): tech discussion search to pair with Lemmy tech communities.

### Support

Found a bug or need a field? Open an issue on the Issues tab with the run URL and we will reply there.

### Changelog

- 0.1: first release. Community posts, post comments, community directory, post search and user posts.

# Actor input Schema

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

Community posts uses Communities. Comments uses Post URLs. Search posts uses Search terms. Community directory uses Search query (or Communities for exact details). User posts uses Users.

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

The Lemmy server to read from, e.g. lemmy.world, lemmy.ml, sh.itjust.works, programming.dev. URLs and name@instance entries override it per item.

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

Community names, name@instance, or full URLs like https://lemmy.world/c/technology. Used by Community posts and Community directory (exact details).

## `postUrls` (type: `array`):

Lemmy post URLs such as https://lemmy.world/post/53755117 (or a numeric post ID on the chosen instance). Used by Comments of a post.

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

Keywords or phrases, one search each. Used by Search posts.

## `communityFilter` (type: `string`):

Optional: restrict Search posts to one community, e.g. technology.

## `query` (type: `string`):

Keyword to find communities by name or description, e.g. linux. Leave empty to list the instance communities. Used by Community directory.

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

Usernames such as someone or someone@lemmy.world. Used by User posts.

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

Total rows to return across all communities, posts, terms or users (shared evenly). You are charged per row returned.

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

Applies to Community posts, Search posts and User posts.

## `commentSort` (type: `string`):

Applies to Comments of a post.

## `directorySort` (type: `string`):

Applies to Community directory. TopAll puts the biggest communities first.

## `includeNsfw` (type: `boolean`):

Off by default: posts, comments and communities flagged adult are skipped and never charged. Turn on only if you need them.

## Actor input object example

```json
{
  "mode": "communityPosts",
  "instance": "lemmy.world",
  "communities": [
    "technology"
  ],
  "maxItems": 25,
  "sort": "Hot",
  "commentSort": "Hot",
  "directorySort": "TopAll",
  "includeNsfw": false
}
```

# Actor output Schema

## `posts` (type: `string`):

No description

## `comments` (type: `string`):

No description

## `communities` (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 = {
    "mode": "communityPosts",
    "instance": "lemmy.world",
    "communities": [
        "technology"
    ],
    "maxItems": 25
};

// Run the Actor and wait for it to finish
const run = await client.actor("transparent_meteorite/lemmy-communities-posts-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 = {
    "mode": "communityPosts",
    "instance": "lemmy.world",
    "communities": ["technology"],
    "maxItems": 25,
}

# Run the Actor and wait for it to finish
run = client.actor("transparent_meteorite/lemmy-communities-posts-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 '{
  "mode": "communityPosts",
  "instance": "lemmy.world",
  "communities": [
    "technology"
  ],
  "maxItems": 25
}' |
apify call transparent_meteorite/lemmy-communities-posts-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,transparent_meteorite/lemmy-communities-posts-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/QMXdgxKtassahjJJy/builds/v8OU24h5keh0R0njN/openapi.json
