# Lemmy Search Scraper (`b2b_lead_generation/lemmy-search-scraper`) Actor

Search and extract posts, comments, communities, and users across any Lemmy instance. Point to an instance, set your keyword and result type, and quickly export clean data into JSON, CSV, or Excel for seamless topic monitoring and research.

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

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

Search public Lemmy content across posts, comments, communities, and users. Choose a Lemmy instance, enter a search query, select the result type, and collect structured results in JSON, CSV, or Excel.

### What It Does

This actor uses the Lemmy search endpoint to retrieve matching content from a selected instance. Depending on the result type, it collects available item details such as names, ActivityPub IDs, publication dates, community names, creators, scores, and comment counts.

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

### Input Example

```json
{
  "instance": "lemmy.world",
  "q": "linux",
  "type_": "Posts",
  "maxItems": 50,
  "requestDelayMs": 1000
}
```

### Input Parameters

| Field | Type | Default | Description |
|---|---|---|---|
| `instance` | string | `lemmy.world` | Lemmy instance hostname without a URL scheme. |
| `q` | string | `linux` | Search query text. |
| `type_` | string | `Posts` | Result type: `Posts`, `Comments`, `Communities`, or `Users`. |
| `maxItems` | integer | `100` | Maximum successful output 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
{
  "itemId": 53017588,
  "name": "Of course",
  "ap_id": "https://sh.itjust.works/post/68171620",
  "published": "2026-10-12T03:27:56.534130Z",
  "community": "programmer_humor",
  "creator": "GolfFoxtrotLima",
  "score": 105,
  "comments": 9,
  "resultKind": "Posts",
  "scrapedAt": "2026-10-12T05:30:00+00:00"
}
```

### Output Fields

| Field | Description |
|---|---|
| `itemId` | Identifier of the returned entity. The original Lemmy `id` field is stored as `itemId` to maintain dataset schema compatibility. |
| `name` | Name or title of the returned item. |
| `ap_id` | ActivityPub identifier or URL associated with the item. |
| `published` | Publication timestamp, when available. |
| `community` | Associated community name, when available. |
| `creator` | Creator's username, when available. |
| `score` | Item score, when available. |
| `comments` | Number of comments, when available. |
| `resultKind` | Type of search result, such as `Posts`. |
| `scrapedAt` | Timestamp when the record was collected. |

The available fields may vary depending on the selected result type.

### Use Cases

- **Topic monitoring:** Find public Lemmy content matching keywords such as `linux`.
- **Research and analysis:** Collect a limited sample of search results for further analysis.
- **Content discovery:** Build datasets of matching post links and metadata.
- **Community discovery:** Search for communities or users related to a particular topic.

### Limits and Fair Use

Lemmy instances may rate-limit frequent requests. Increase `requestDelayMs` if you encounter HTTP 429 responses.

Search results may contain user-generated content and personal information. Respect instance policies, applicable privacy laws, and copyright requirements when collecting or reusing results.

### Frequently Asked Questions

**What types of Lemmy content can I search?**

You can search posts, comments, communities, and users by selecting the appropriate `type_` value.

**Can I search different Lemmy instances?**

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

**Does the actor support keyword searches?**

Yes. Enter your search phrase in the `q` parameter. The selected Lemmy instance determines which matching results are returned.

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

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

**Does the actor support pagination?**

Yes. It uses the `limit` and `page` parameters to retrieve successive result pages and deduplicates records by entity ID.

**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 search results?**

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

**Can I schedule recurring searches?**

Yes. Configure an Apify schedule to run the actor at your preferred interval and refresh your search dataset.

### 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 search results from publicly accessible Lemmy instances. Users are responsible for complying with applicable laws, instance policies, and data usage requirements when collecting or reusing results.

### Is Web Scraping Legal?

This actor collects publicly accessible search 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:** Search results may include usernames, public profile identifiers, and user-generated content. Handle potentially personal information responsibly and follow applicable privacy laws, including GDPR or CCPA where relevant.
- **Copyright and Licensing:** Post titles, comments, and other user-generated content may be protected by copyright. Check applicable licences and avoid unauthorized reproduction or redistribution.
- **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.

## `q` (type: `string`):

Search text passed as q to the Lemmy search API.

## `type_` (type: `string`):

Which Lemmy search result bucket to collect (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",
  "q": "linux",
  "type_": "Posts",
  "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",
    "q": "linux"
};

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

# Run the Actor and wait for it to finish
run = client.actor("b2b_lead_generation/lemmy-search-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",
  "q": "linux"
}' |
apify call b2b_lead_generation/lemmy-search-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-search-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/f8TDwzMalpwQ3rUYZ/builds/Xogw3ISvcohCvyOgD/openapi.json
