# Lemmy Scraper (`gogumaa/lemmy-scraper`) Actor

Lemmy posts by community or feed, comments per post, full-text search and community directory on any instance (lemmy.world, lemmy.ml, programming.dev …). Public JSON API, no login, no browser.

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

## Pricing

$2.00 / 1,000 item scrapeds

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

**Lemmy scraper for posts, comments, search and communities on any instance, with no login and no API key.** Pull posts from any Lemmy community or the instance feed, comments of a post, full-text search (posts, comments, communities, users) and the community directory on `lemmy.world`, `lemmy.ml`, `programming.dev`, `sh.itjust.works` and others. It uses each instance's public JSON API, so runs are fast and you pay per result.

### What you can do with it

- **Reddit-alternative monitoring** — schedule `posts` mode for communities like `technology`, `privacy`, `selfhosted`; feed new threads into Slack, a sheet, or an LLM summarizer.
- **Brand / keyword tracking** — `search` mode finds posts or comments that mention your product, with score and comment counts.
- **Community discovery** — `communities` mode lists communities by subscribers and monthly active users, for outreach or market sizing.
- **Discussion datasets** — `comments` mode pulls the comment tree text of given posts (best-scored first).
- **Automated feeds** — Schedule it on Apify and pipe results to Google Sheets, Slack, n8n or Make via the Apify integration.
- **Cross-instance comparison** — run the same `search` or `communities` query against several instances to see where a topic is most active.

### Output example

Mode `posts` / search `Posts` (`type: "post"`):

```json
{
  "instance": "lemmy.world",
  "type": "post",
  "id": 53847679,
  "title": "Firm that lets you rent out your idle Mac for AI inference workloads warns of plummeting token costs …",
  "url": "https://www.tomshardware.com/tech-industry/…",
  "body": null,
  "ap_id": "https://lemmy.world/post/53847679",
  "community": "technology@lemmy.world",
  "community_title": "Technology",
  "author": "eicker",
  "author_instance": "lemmy.world",
  "score": 87,
  "upvotes": 90,
  "downvotes": 3,
  "comments_count": 23,
  "published": "2026-11-01T09:15:48.137107Z",
  "updated": null,
  "nsfw": false,
  "thumbnail": "https://lemmy.world/pictrs/image/cc25223b-….png",
  "locked": false,
  "featured": false
}
```

Mode `comments` / search `Comments` (`type: "comment"`): same fields; `title` is the parent post title, `body` the comment text, `comments_count` the number of replies, plus `post_id`.

Mode `communities` / search `Communities` (`type: "community"`):

```json
{ "instance": "lemmy.world", "type": "community", "name": "technology@lemmy.world", "title": "Technology", "description": "This is a most excellent place for technology news …", "subscribers": 89338, "posts": 22511, "comments": 981435, "users_active_month": 15247, "actor_id": "https://lemmy.world/c/technology", "nsfw": false, "published": "2023-06-11T02:16:17.173483Z" }
```

Search `Users` (`type: "user"`): `name`, `actor_id`, `post_count`, `comment_count`, `bot`, `published`.

### Input

| Field | Description |
|---|---|
| `instance` | Server domain. Default `lemmy.world`. |
| `mode` | `posts` (default), `search`, `communities`, `comments` |
| `communities` | Mode `posts`. Names like `technology` or `technology@lemmy.world`. Empty = the instance's All feed. |
| `sort` | `Hot` (default), `New`, `TopDay`, `TopWeek`, `TopMonth`, `TopAll`, `Active`. For `communities` mode `Hot` means `TopAll`. |
| `query`, `searchType` | Mode `search`. `Posts` (default), `Comments`, `Communities`, `Users`. |
| `postIds` | Mode `comments`. Numeric post ids on the chosen instance (`id` of a post row). |
| `maxItems` | Stop after N rows total. Default 100. |

### Pricing

Pay per item: one event per dataset row (post, comment, community or user). Nothing is charged for rows that are never produced.

### Notes

- Remote communities are only available if the chosen instance already federates with them; use `name@other.instance` and check the row count.
- Instances rate-limit anonymous clients; 50 rows per request.
- Unknown community → no rows. Comments need the post id from the same instance.

### FAQ

#### Do I need an API key or account?

No. It only calls public, anonymous endpoints of the instance you choose. Instances rate-limit anonymous clients, and the actor fetches 50 rows per request to stay efficient.

#### How much does it cost?

$0.002 per result and nothing else: with pay-per-event pricing you are not billed for Apify compute. 100 results cost $0.20, and the Apify free plan's $5 monthly credit covers about 2,500 results. Rows that are never produced are never charged.

#### How do I get the data into Google Sheets or my app?

Export the run's dataset as CSV, JSON or Excel from the Apify Console, read it from the dataset API endpoint, or connect it to Google Sheets, Slack, n8n, Make or Zapier with Apify integrations.

#### Is it legal to scrape Lemmy?

It only reads public data via the platform's public API and respects rate limits. You are responsible for complying with Lemmy's terms and applicable law.

#### Why do I get no rows for a community?

The chosen instance only knows remote communities it already federates with. Use `name@other.instance`, or set `instance` to the community's home server. Comments also need a post id from the same instance.

### Related Actors

- [Mastodon Scraper](https://apify.com/gogumaa/mastodon-scraper)
- [Hacker News Scraper](https://apify.com/gogumaa/hacker-news-scraper)
- [Dev.to Articles Scraper](https://apify.com/gogumaa/devto-articles-scraper)

# Actor input Schema

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

Lemmy server domain, e.g. lemmy.world, lemmy.ml, programming.dev, sh.itjust.works.

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

posts = feed or communities. search = full-text search. communities = community directory. comments = comments of given posts.

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

Mode=posts. Names like technology or technology@lemmy.world. Empty = the instance's All feed.

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

Mode=posts and communities (communities accept Hot, New, TopDay, TopWeek, TopMonth, TopAll, Active).

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

Mode=search.

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

Mode=search.

## `postIds` (type: `array`):

Mode=comments. Numeric post ids on the chosen instance (the id field of a post row).

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

Stop after this many rows (total across all communities / posts).

## Actor input object example

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

# Actor output Schema

## `items` (type: `string`):

One record per post / comment / community / user: title, url, body, community, author, score, comment counts; or community subscriber and activity stats.

# 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("gogumaa/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"] }

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

```

## MCP server setup

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