# Lemmy Posts & Community Scraper (`dabooti/lemmy-posts-scraper`) Actor

Export public Lemmy posts from any community or instance feed: title, body, link, score, upvotes, downvotes, comments, author, community and date. Keyword and date filters. No login or API key.

- **URL**: https://apify.com/dabooti/lemmy-posts-scraper.md
- **Developed by:** [Danial Maqbool](https://apify.com/dabooti) (community)
- **Categories:** Social media, Marketing, News
- **Features:** Limited permissions
- **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 and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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 Posts & Community Scraper

Export public Lemmy posts from any community or instance feed (lemmy.world, lemmy.ml, sh.itjust.works, programming.dev and the rest of the Lemmy fediverse). Get the title, body, link, link preview, score, upvotes, downvotes, comment count, author, community and dates as JSON, CSV or Excel.

It reads Lemmy's public API, the same one the Lemmy apps use. No login, API key or proxy needed.

### What you can use it for

- **Community monitoring**: follow what is posted in the communities that matter to your product, field or brand.
- **Keyword tracking**: read a whole instance feed and keep only the posts that mention your keywords.
- **Trend research**: export the top posts of the day, week or month with vote and comment counts.
- **Datasets**: build a corpus of public fediverse link-sharing and discussion posts for analysis or NLP.

### What data you get

| Field | Description |
|---|---|
| `id`, `apId`, `postUrl` | Post ID on the instance, its canonical ActivityPub ID and a link to it |
| `title`, `body` | Post title and text (Markdown) |
| `linkUrl`, `linkTitle`, `linkDescription`, `thumbnailUrl` | Shared link and its preview |
| `published`, `updated`, `newestCommentAt` | Dates (ISO 8601) |
| `score`, `upvotes`, `downvotes`, `comments` | Votes and comment count |
| `nsfw`, `locked`, `featured` | Post flags |
| `communityName`, `communityTitle`, `communityUrl` | Community, as `name@server` |
| `creatorName`, `creatorUrl`, `creatorIsBot` | Author's public username and profile |
| `language` | Lemmy language ID set on the post |
| `source`, `sourceValue`, `instance`, `scrapedAt` | Which community or feed the post came from |

### How to use it

1. Set the **Lemmy instance** (default `lemmy.world`).
2. Add **Communities** (`technology`, `technology@lemmy.world`, `!asklemmy@lemmy.ml` or a `/c/` URL) and/or pick an **Instance-wide feed** (`All` or `Local`).
3. Choose a **Sort** order and, if you like, **Keywords**, a **Posted on or after** date and the **Max posts** per source.
4. Click **Start** and export from the **Output** tab.

#### Example input

```json
{
  "instance": "lemmy.world",
  "communities": ["technology", "asklemmy@lemmy.ml"],
  "instanceFeeds": ["All"],
  "sort": "New",
  "keywords": ["linux", "open source"],
  "dateFrom": "2026-11-01",
  "maxPostsPerSource": 200
}
```

#### Example output

One record from a real run:

```json
{
  "source": "community",
  "sourceValue": "technology",
  "instance": "lemmy.world",
  "id": 54640536,
  "apId": "https://lemmy.world/post/54640536",
  "postUrl": "https://lemmy.world/post/54640536",
  "title": "White House national cyber director is leaving the administration after series of tech outages",
  "body": null,
  "linkUrl": "https://www.nbcnews.com/politics/white-house/national-cyber-director-sean-cairncross-leaving-kirsten-davies-replaci-rcna610329",
  "linkTitle": "White House national cyber director is leaving the administration after series of tech outages",
  "linkDescription": "Sean Cairncross is leaving after numerous tech outages rocked companies and government agencies over the past week. Pentagon official Kirsten Davies will replace him.",
  "thumbnailUrl": "https://lemmy.world/pictrs/image/e22a8ddf-9190-44bc-a918-783cf78551a8.jpeg",
  "published": "2026-11-20T14:19:19.890Z",
  "updated": null,
  "nsfw": false,
  "locked": false,
  "featured": false,
  "score": 14,
  "upvotes": 15,
  "downvotes": 1,
  "comments": 0,
  "newestCommentAt": "2026-11-20T14:19:19.890Z",
  "communityName": "technology@lemmy.world",
  "communityTitle": "Technology",
  "communityUrl": "https://lemmy.world/c/technology",
  "creatorName": "return2ozma",
  "creatorUrl": "https://lemmy.world/u/return2ozma",
  "creatorIsBot": false,
  "language": 37,
  "scrapedAt": "2026-11-20T15:23:13.768Z"
}
```

### Pricing

Pay per result: **$1.00 per 1,000 posts** ($0.001 per post). You only pay for posts saved to the dataset. Set "Max cost per run" to cap spending; the Actor stops cleanly when it is reached.

### Tips and limits

- Up to 2,000 posts per community or feed, 50 per API page, with a one-second pause between pages to stay polite to volunteer-run servers.
- A community hosted on another server (for example `python@programming.dev` read through lemmy.world) only shows the posts that instance has received by federation. For the full history, set **Lemmy instance** to the community's home server.
- Keyword filtering happens after download, so a narrow keyword on a big feed scans many posts to find a few matches. The run summary shows how many were scanned.
- The date filter stops paging early only with sort `New`.
- The Actor does not use Lemmy's search endpoint or log in, and it does not export comments, private messages, votes by user or any account data beyond the public username on each post.

### FAQ

**Does it need a Lemmy account?** No. It reads public data only.

**Can I scrape any Lemmy instance?** Any instance whose API is public, which is the default. Some instances block or rate-limit unknown clients; the run summary records any errors.

**Where is the run summary?** In the key-value store as `RUN_SUMMARY`, with per-source counts and errors.

### Legal note

The Actor collects only data that each Lemmy instance publishes openly through its API. Posts belong to their authors and each instance has its own rules. Use the data in line with those rules and with privacy laws such as the GDPR, especially if you store or republish usernames.

# Actor input Schema

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

Server whose API is used, for example lemmy.world, lemmy.ml, sh.itjust.works or programming.dev. Communities from other servers can be read through it with name@server.

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

Communities to export: technology, technology@lemmy.world, !technology@lemmy.world or a community URL such as https://lemmy.world/c/technology.

## `instanceFeeds` (type: `array`):

Optional. Also export the instance's whole feed: All (every community the instance knows) or Local (communities hosted on the instance).

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

Order in which posts are read.

## `keywords` (type: `array`):

Optional. Keep only posts whose title, body or link contains at least one of these words (case-insensitive).

## `dateFrom` (type: `string`):

Optional date, YYYY-MM-DD. With sort New, paging stops at older posts.

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

Also export posts marked NSFW.

## `maxPostsPerSource` (type: `integer`):

Up to 2,000.

## Actor input object example

```json
{
  "instance": "lemmy.world",
  "communities": [
    "technology"
  ],
  "instanceFeeds": [],
  "sort": "New",
  "keywords": [],
  "includeNsfw": false,
  "maxPostsPerSource": 50
}
```

# Actor output Schema

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

No description

## `resultsFull` (type: `string`):

No description

## `summary` (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 = {
    "communities": [
        "technology"
    ]
};

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

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

```

## MCP server setup

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