# Lemmy Communities Scraper (`b2b_lead_generation/lemmy-communities-scraper`) Actor

Collect Lemmy community directories with subscriber and post counts from any public instance. Export clean JSON, CSV, or Excel datasets instantly.

- **URL**: https://apify.com/b2b_lead_generation/lemmy-communities-scraper.md
- **Developed by:** [B2B Lead Generation](https://apify.com/b2b_lead_generation) (community)
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.99 / 1,000 results

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 Communities Scraper

![Lemmy Communities Scraper cover](https://images.bigibyte.com/cdn-cgi/image/width=1260,height=540,fit=cover,format=webp/apify-actors-covers/lemmy-communities-scraper-cover.png)

Collect community directory data from any public Lemmy instance. Choose a sorting method and listing scope, set a result limit, and export community IDs, names, subscriber counts, and post counts in JSON, CSV, or Excel.

### What It Does

This actor retrieves community listings from a Lemmy instance using its community list endpoint. It collects community identifiers, names, titles, actor URLs, subscriber counts, and post counts.

Results are paginated using `limit` and `page`, deduplicated by community ID, and collected until the configured item limit is reached.

### Input Example

```json
{
  "instance": "lemmy.world",
  "sort": "TopAll",
  "listingType": "All",
  "maxItems": 50,
  "requestDelayMs": 1000
}
```

### Input Parameters

| Field | Type | Default | Description |
|---|---|---|---|
| `instance` | string | `lemmy.world` | Lemmy instance hostname without a URL scheme. |
| `sort` | string | `TopAll` | Community sorting method, such as TopAll, Hot, New, or Active. |
| `listingType` | string | `All` | Community listing scope. Use `All` or `Local`. |
| `maxItems` | integer | `100` | Maximum successful rows per run. Hard limit: 1,000. |
| `requestDelayMs` | integer | `1000` | Delay between requests in milliseconds. |
| `userAgent` | string | `ActorResearch/1.0` | User-Agent header used for requests. |
| `timeoutSecs` | integer | `300` | Overall actor run timeout in seconds. |
| `requestTimeoutSecs` | integer | `30` | Timeout for each individual request in seconds. |
| `proxyConfiguration` | object | Proxy off | Optional proxy configuration. Proxy is disabled by default. |

### Output Example

```json
{
  "communityId": 2478,
  "name": "technology",
  "communityTitle": "Technology",
  "actor_id": "https://lemmy.world/c/technology",
  "subscribers": 88731,
  "posts": 22199,
  "scrapedAt": "2026-10-12T05:30:00+00:00"
}
```

### Output Fields

| Field | Description |
|---|---|
| `communityId` | Unique identifier of the community. |
| `name` | Community name. |
| `communityTitle` | Display title of the community. |
| `actor_id` | Community actor URL. |
| `subscribers` | Number of community subscribers. |
| `posts` | Number of posts in the community. |
| `scrapedAt` | Timestamp when the record was collected. |

### Use Cases

- **Community directories:** Build searchable directories of Lemmy communities with subscriber and post statistics.
- **Research and analysis:** Collect a limited sample of communities for data analysis.
- **Instance comparison:** Compare federated and local community listings using `All` and `Local` scopes.
- **Directory maintenance:** Schedule recurring runs to refresh community listing datasets.

### Frequently Asked Questions

**What data does this actor collect?**

It collects community IDs, names, titles, actor URLs, subscriber counts, post counts, source URLs, and collection timestamps.

**Can I collect communities from different Lemmy instances?**

Yes. Set `instance` to the hostname of the Lemmy instance you want to query, such as `lemmy.world`.

**What is the difference between `All` and `Local`?**

`All` retrieves the instance's federated community listing, while `Local` limits the listing to communities local to that instance.

**Which sorting methods are available?**

The `sort` parameter accepts Lemmy community listing sort options, including `TopAll`, `Hot`, `New`, and `Active`.

**How many communities can one run collect?**

The actor supports up to 1,000 successful output rows per run. Use `maxItems` to set a smaller collection limit.

**Does the actor support pagination?**

Yes. It uses the `limit` and `page` parameters to retrieve successive community listing pages and avoids duplicate records using community IDs.

**What happens if a request fails?**

The actor continues processing and stores an error row instead of stopping the entire run.

**Can I export the results?**

Yes. Export the dataset in JSON, CSV, Excel, and other formats supported by Apify.

**Can I schedule recurring runs?**

Yes. Configure an Apify schedule to refresh your community directory at your preferred interval.

### Trademark Notice

Lemmy is a trademark and project name belonging to its respective owners. This actor is an independent data collection tool and is not affiliated with, sponsored by, or endorsed by the Lemmy project or individual Lemmy instances.

### Disclaimer

This actor collects community listing information from publicly accessible Lemmy instances. Users are responsible for following applicable laws, instance policies, and data usage requirements when collecting or reusing the results.

### Is Web Scraping Legal?

This actor collects publicly accessible community directory information without bypassing login screens, paywalls, or technical security measures. How collected information can be used depends on applicable laws and the source instance's policies.

- **Personal Data:** Community names and actor URLs may identify individuals or groups. Handle potentially personal information responsibly and follow applicable privacy laws, including GDPR or CCPA where relevant.
- **Copyright and Licensing:** Community names and other descriptive content may be protected by copyright or subject to licensing terms. Check the applicable licence before reproducing or redistributing content.
- **Platform Terms and Rate Limits:** Respect each Lemmy instance's policies and rate limits. Use reasonable request delays.
- **Disclaimer:** This information is general guidance, not legal advice. Consult a qualified legal professional if you have questions about your intended use.

For more information, read [Is web scraping legal?](https://blog.apify.com/is-web-scraping-legal/).

# Actor input Schema

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

Lemmy instance host (no scheme), for example lemmy.world.

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

Lemmy community list sort, for example TopAll, Hot, New, or Active.

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

Federation scope. Use All or Local (maps to Lemmy type\_).

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

Stop after this many successful rows. Hard max is 1000.

## `requestDelayMs` (type: `integer`):

Milliseconds to wait between requests. Raise if you see 429.

## `userAgent` (type: `string`):

User-Agent header sent with each request.

## `timeoutSecs` (type: `integer`):

Overall run budget in seconds.

## `requestTimeoutSecs` (type: `integer`):

Per-request timeout in seconds.

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

Optional proxy. Leave off unless you need it.

## Actor input object example

```json
{
  "instance": "lemmy.world",
  "sort": "TopAll",
  "listingType": "All",
  "maxItems": 100,
  "requestDelayMs": 1000,
  "userAgent": "ActorResearch/1.0",
  "timeoutSecs": 300,
  "requestTimeoutSecs": 30,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `overview` (type: `string`):

Dataset rows in the overview table.

## `dataset` (type: `string`):

Full dataset for this run.

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

Dataset items as JSON.

# 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 = {
    "instance": "lemmy.world",
    "sort": "TopAll",
    "listingType": "All"
};

// Run the Actor and wait for it to finish
const run = await client.actor("b2b_lead_generation/lemmy-communities-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 = {
    "instance": "lemmy.world",
    "sort": "TopAll",
    "listingType": "All",
}

# Run the Actor and wait for it to finish
run = client.actor("b2b_lead_generation/lemmy-communities-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 '{
  "instance": "lemmy.world",
  "sort": "TopAll",
  "listingType": "All"
}' |
apify call b2b_lead_generation/lemmy-communities-scraper --silent --output-dataset

```

## MCP server setup

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