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

Scrape Lemmy (the Reddit alternative) across any instance: community posts, search results, full comment threads and user histories. Score, up/down votes, comments, links, community stats. Fast official API, no login.

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

## Pricing

from $0.50 / 1,000 items

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

Scrape **Lemmy**, the federated Reddit alternative, through its official API: posts from any community on any instance, keyword search, full comment threads and user histories, plus community statistics.

No login, no API key and no browser: the Actor reads the data directly, which makes it **fast and cheap**. Proxies are included in the price.

### What can you use it for?

- **Social listening**: track mentions of your brand or topic across the fediverse.
- **Community research**: compare activity, subscribers and top posts.
- **Content curation**: collect the best links of a niche.
- **AI & NLP datasets**: gather discussions and comments.

### Features

| | |
|---|---|
| Inputs | Communities on any instance, keyword search, post URLs, users |
| Per post | Title, body, link, Lemmy and original URLs, community, author, score, up/down votes, comment count, date, NSFW, locked, pinned, embed title/description, thumbnail |
| Per comment | Text, author, score, votes, reply count, depth, parent ID, post title, URL |
| Community row | Subscribers, posts, comments, daily/weekly/monthly active users |
| Filters | Sort (Hot, New, Top day... Top all time), only newer than a date, max items |

### How to use

1. Fill in the input (the form explains every field).
2. Click **Start**.
3. Download the results as JSON, CSV or Excel, or use them through the API, webhooks, Zapier, Make or n8n.

### Input example

```json
{
    "communities": [
        "technology",
        "linux@lemmy.ml"
    ],
    "sort": "TopWeek",
    "maxPostsPerSource": 200,
    "includeComments": true
}
```

### Output example

```json
{
    "type": "post",
    "id": 53758090,
    "title": "FTC demands Walmart, Target, Uber and others hand over data on personalized pricing",
    "body": "cross-posted from: https://piefed.world/c/tech/p/1499714/ftc-demands-walmart-target-uber-and-others-hand-over-data-on-personalized-pricing\n\n",
    "url": "https://www.ftc.gov/news-events/news/press-releases/2026/10/ftc-launches-personalized-pricing-compensation-inquiry",
    "postUrl": "https://lemmy.world/post/53758090",
    "originalUrl": "https://piefed.world/c/technology/p/1500689/ftc-demands-walmart-target-uber-and-others-hand-over-data-on-personalized-pricing",
    "community": "technology@lemmy.world",
    "communityTitle": "Technology",
    "author": "beep@piefed.world",
    "authorDisplayName": "beep",
    "score": 14,
    "upvotes": 14,
    "downvotes": 0,
    "comments": 0,
    "published": "2026-10-30T01:31:55.835774Z",
    "updated": null,
    "nsfw": false,
    "locked": false,
    "featured": false,
    "embedTitle": "FTC Launches Personalized Pricing and Compensation Inquiry",
    "embedDescription": "The Federal Trade Commission today ordered nine major airlines, ride-sharing companies and food-delivery firms to provide detailed information that will allo...",
    "thumbnail": "https://www.ftc.gov/themes/custom/ftc_uswds/img/ftc_social_share_default_en.jpg",
    "instance": "lemmy.world",
    "source": "community: technology@lemmy.world",
    "status": "ok"
}
```

Inputs that cannot be scraped (wrong URL, not found, blocked) get a free row with `status` and `error`, so you always know what happened. A run summary is saved to the key-value store as `SUMMARY`.

### Pricing

You pay **per item** saved. Proxies and compute are included. Set a maximum cost per run and the Actor stops cleanly when it is reached.

### FAQ

**Which instances work?**
Any Lemmy server: lemmy.world, lemmy.ml, sh.itjust.works, programming.dev, beehaw.org and others. Write the community as name@instance.

**Do I need an account?**
No.

**Why are proxies off by default?**
The Lemmy API is open, so runs are faster and cheaper without them.

**Can I call it from code or an AI agent?**
Yes, via the Apify API, the official JS/Python clients, or Apify's MCP server.

# Actor input Schema

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

Names, name@instance or URLs, one per line: technology, linux@lemmy.ml, https://lemmy.world/c/memes.

## `searchQueries` (type: `array`):

Keywords to search posts for on the instance below.

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

Lemmy post URLs. Saves the post and its comments.

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

Usernames, name@instance or profile URLs. Saves their posts and comments.

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

Default Lemmy server for plain names and searches.

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

Order of community and search posts.

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

Per community, search or user. 0 = no limit.

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

Also save the comments of every post found.

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

0 = all.

## `onlyNewerThan` (type: `string`):

Optional date, e.g. 2026-10-01.

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

Not needed: the Lemmy API is open. Turn on only if an instance blocks you.

## Actor input object example

```json
{
  "communities": [
    "technology"
  ],
  "instance": "lemmy.world",
  "sort": "New",
  "maxPostsPerSource": 100,
  "includeComments": false,
  "maxCommentsPerPost": 100,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `results` (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"
    ],
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

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

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

```

## MCP server setup

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