# Lemmy Posts Scraper (`b2b_lead_generation/lemmy-posts-scraper`) Actor

Collect public Lemmy posts from any instance by sort or community. Gather post titles, timestamps, creators, scores, and comment counts into clean datasets.

- **URL**: https://apify.com/b2b_lead_generation/lemmy-posts-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 Posts Scraper

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

Collect public posts from Lemmy communities and instances. Choose an instance, select a sorting method, optionally filter by community, and retrieve structured post information for research, monitoring, and analysis. Export results in JSON, CSV, Excel, or other supported Apify dataset formats.

### What It Does

This actor retrieves public post listings from Lemmy instances. It collects post titles, ActivityPub identifiers, publication dates, community names, creator information, scores, and comment counts.

The actor uses cursor-based pagination with `limit` and `page_cursor`, removes duplicate posts using their IDs, and stops when the configured `maxItems` limit is reached.

### Key Features

- Collect public posts from different Lemmy instances.
- Retrieve posts using multiple sorting options.
- Filter results by community name.
- Collect post metadata and engagement information.
- Automatically paginate through available results.
- Remove duplicate posts using post IDs.
- Configure request delays and timeout settings.
- Export results in multiple formats.

### Input Example

```json id="m8x4qp"
{
  "instance": "lemmy.world",
  "sort": "Hot",
  "maxItems": 50,
  "requestDelayMs": 1000
}
```

### Input Parameters

| Field | Type | Default | Description |
|---|---|---|---|
| `instance` | string | `lemmy.world` | Lemmy instance hostname without a scheme |
| `sort` | string | `Hot` | Sorting method, such as Hot, New, or TopDay |
| `communityName` | string | Empty | Optional community name filter |
| `maxItems` | integer | `100` | Maximum successful records per run; hard maximum is 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 an individual request in seconds |
| `proxyConfiguration` | object | Proxy off | Optional proxy configuration |

### Output Example

```json id="v6q2nt"
{
  "postId": 53019480,
  "name": "Chronic rule",
  "ap_id": "https://lemmy.world/post/53019480",
  "published": "2026-10-12T04:45:48.054379Z",
  "community": "onehundredninetysix",
  "creator": "ickplant",
  "score": 17,
  "comments": 1,
  "scrapedAt": "2026-10-12T05:30:00+00:00"
}
```

### Output Fields

| Field | Description |
|---|---|
| `postId` | Unique Lemmy post identifier |
| `name` | Post title |
| `ap_id` | ActivityPub identifier for the post |
| `published` | Post publication timestamp |
| `community` | Community where the post was published |
| `creator` | Username of the post creator |
| `score` | Post score |
| `comments` | Number of comments |
| `scrapedAt` | Timestamp when the record was collected |

The dataset overview highlights post ID, title, ActivityPub ID, publication date, community, creator, score, and comment count.

### Use Cases

- **Feed Monitoring:** Track Hot, New, or other sorted posts from a Lemmy instance.
- **Community Research:** Collect posts from specific communities for analysis.
- **Engagement Analysis:** Examine post scores and comment counts.
- **Content Research:** Explore publicly available discussions and trending topics.
- **Data Export:** Build structured Lemmy post datasets for spreadsheets and downstream tools.
- **Sort Comparisons:** Compare Hot, New, and TopDay results to explore different post collections.

### Limits and Responsible Collection

- Keep request frequency around one request per second.
- Increase `requestDelayMs` if the instance returns HTTP 429 responses.
- Respect individual instance policies and applicable rate limits.
- Consider copyright and privacy requirements before reusing user-generated content.

### Frequently Asked Questions

**What does this actor collect?**

It collects public Lemmy post metadata, including titles, post IDs, publication dates, communities, creators, scores, and comment counts.

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

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

**Can I filter posts by community?**

Yes. Provide a community name using `communityName` to collect posts from a specific community.

**Which sorting options are supported?**

The actor supports Lemmy sorting methods such as `Hot`, `New`, and `TopDay`.

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

The maximum is 1,000 successful records per run. Use `maxItems` to configure a smaller collection limit.

**How does pagination work?**

The actor retrieves posts in batches using `limit` and `page_cursor`, removes duplicate post IDs, and continues until the item limit is reached or no more results are available.

**What happens when a page request fails?**

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

**What export formats are supported?**

You can export results as JSON, CSV, Excel, and other formats supported by Apify datasets.

**Can I schedule recurring collections?**

Yes. Configure an Apify schedule to automatically collect updated Lemmy posts at your preferred interval.

### Trademark Notice

Lemmy and related names, logos, and trademarks belong to their respective owners. They are referenced only to identify the source of the collected post information. This actor is not affiliated with or endorsed by the Lemmy project or any individual Lemmy instance.

### Disclaimer

This actor is an independent data collection tool. Post availability, content, and engagement information depend on the selected Lemmy instance. Users are responsible for verifying collected information and complying with applicable laws, instance policies, privacy requirements, and content licensing conditions.

### Is Web Scraping Legal?

This actor collects publicly accessible post 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:** Public posts may contain usernames or other information that identifies individuals. Handle collected data responsibly and comply with applicable privacy laws, including GDPR or CCPA where relevant.
- **Copyright and Licensing:** Posts may contain copyrighted user-generated content. Avoid unauthorized reproduction or redistribution and respect applicable content licences.
- **Platform Terms and Rate Limits:** Collect responsibly, respect instance policies, and avoid excessive requests.
- **Disclaimer:** This information is general guidance, not legal advice. Consult a qualified legal professional if you are unsure about your intended use.

[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 sort mode such as Hot, New, TopDay, TopWeek, Active.

## `communityName` (type: `string`):

Optional community name filter (without instance suffix).

## `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": "Hot",
  "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": "Hot"
};

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

# Run the Actor and wait for it to finish
run = client.actor("b2b_lead_generation/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 '{
  "instance": "lemmy.world",
  "sort": "Hot"
}' |
apify call b2b_lead_generation/lemmy-posts-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-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/Zp5u8XlGVzkloVH7c/builds/vbT1DWilIu5UIA9TX/openapi.json
