# Mastodon & Lemmy Scraper: Posts, Threads, Trends & Servers (`powernaner/mastodon-lemmy-scraper`) Actor

Scrape Mastodon and Lemmy (fediverse) with no login: hashtag and account posts, threads, who liked or boosted, trending posts, hashtags and links, Lemmy communities, posts, full comment trees, search, server activity, rules, domain blocks and the Lemmy moderation log.

- **URL**: https://apify.com/powernaner/mastodon-lemmy-scraper.md
- **Developed by:** [Renan Teles](https://apify.com/powernaner) (community)
- **Categories:** Social media, News, Developer tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.30 / 1,000 post or comment 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

## Mastodon & Lemmy Scraper: Posts, Threads, Trends & Servers

Scrape Mastodon and Lemmy, the two biggest parts of the fediverse, as clean JSON, CSV or Excel. Get posts by hashtag or account, full threads, **who liked or boosted a post**, trending posts, hashtags and news links, Lemmy communities with **every comment**, search, **server statistics, rules and blocklists**, and the **Lemmy moderation log**. It uses the official public APIs of each server. No login, no API key, no proxy.

### What you get

#### Mastodon

- **Hashtag posts** from one or many servers, merged and deduplicated (the same post seen on two servers is returned once).
- **Account profile and posts**: bio, verified links, followers, featured hashtags, with or without replies and boosts.
- **Full threads**: give a post URL and get the post, its parents and all replies.
- **Who liked and who boosted each post**: one row per account, paginated in full.
- **Edit history**: every previous version of an edited post.
- **Followers, following and recommended accounts** of an account.
- **Trending** posts, hashtags (with 7-day usage) and news links (with 7-day shares), per server.
- **People search** by keyword.

#### Lemmy

- **Communities**: subscribers, daily/weekly/monthly active users, moderators, and their posts sorted as you choose (Hot, New, Top of the day/week/month, Most comments and more).
- **Every comment of a post**, with depth, parent and path so you can rebuild the tree. No 300-comment cut.
- **Users**: profile, communities they moderate, posts and comments.
- **Full-text search** in posts, comments, communities or users.
- **Server feed**: everything a Lemmy server sees.
- **Public moderation log**: removed posts and comments, bans, locks, pins and purges, with target, community, reason and date.

#### Servers (Mastodon, Lemmy and any fediverse server with nodeinfo)

- **Server record**: software and version, users, monthly and 6-month active users, posts, sign-up policy, rules, admins, contact, and on Mastodon **12 weeks of posts, logins and sign-ups**.
- **Blocked servers** (Mastodon: with severity and reason).
- **Known servers (peers)** the server federates with.

#### Clean data

- One dataset, one row per item, with `recordType` telling what each row is (14 types). Rows of the same type always have the same columns.
- Common names on both networks (`text`, `createdAt`, `authorHandle`, `url`), so one spreadsheet works for both.
- Text as plain text (links expanded) **and** the original HTML.
- Full handles (`user@server`) and the global id of each post (`uri` / `apId`), the same on every server, so you can deduplicate and join sources.
- Dates in ISO 8601 UTC. `null` (never a fake `0`) when the server does not say.

### Example output (real, from cloud runs on 2026-11-19)

A Mastodon post, from an account (`mastodon_post`):

```json
{
  "recordType": "mastodon_post",
  "network": "mastodon",
  "server": "mastodon.social",
  "source": "account:@Mastodon@mastodon.social",
  "scrapedAt": "2026-11-19T18:58:24.983Z",
  "id": "117625790631441803",
  "uri": "https://mastodon.social/users/Mastodon/statuses/117625790631441803",
  "url": "https://mastodon.social/@Mastodon/117625790631441803",
  "text": "Update on #Plushtodon pre-orders: The plushies are going through German customs on the way to our warehouse, after which they’ll start getting shipped out. Unfortunately we could not meet the early November deadline that we promised due to delays outside our control. You will get an email once your order is dispatched. You can still pre-order if you haven’t yet!\n\nhttps://shop.joinmastodon.org/products/pre-order-mastodon-plushie-20cm-plushtodon",
  "contentHtml": "<p>Update on <a href=\"https://mastodon.social/tags/Plushtodon\" class=\"mention hashtag\" rel=\"tag\">#<span>Plushtodon</span></a> pre-orders: The plushies are going through German customs on the way to our warehouse, after which they’ll start getting shipped out. Unfortunately we could not meet the early November deadline that we promised due to delays outside our control. You will get an email once your order is dispatched. You can still pre-order if you haven’t yet!</p><p><a href=\"https://shop.joinmastodon.org/products/pre-order-mastodon-plushie-20cm-plushtodon\" target=\"_blank\" rel=\"nofollow noopener\" translate=\"no\"><span class=\"invisible\">https://</span><span class=\"ellipsis\">shop.joinmastodon.org/products</span><span class=\"invisible\">/pre-order-mastodon-plushie-20cm-plushtodon</span></a></p>",
  "spoilerText": null,
  "language": "en",
  "visibility": "public",
  "sensitive": false,
  "createdAt": "2026-11-16T11:05:27.567Z",
  "editedAt": null,
  "inReplyToId": null,
  "isReblog": false,
  "reblogOfUri": null,
  "reblogOfAuthorHandle": null,
  "quoteOfUri": null,
  "favourites": 131,
  "reblogs": 66,
  "replies": 4,
  "quotes": 0,
  "tags": ["plushtodon"],
  "mentions": [],
  "media": [],
  "cardUrl": "https://shop.joinmastodon.org/products/pre-order-mastodon-plushie-20cm-plushtodon",
  "cardTitle": "PRE-ORDER Mastodon plushie 20cm - Plushtodon",
  "cardProvider": null,
  "pollOptions": null,
  "pollVotes": null,
  "application": "Web",
  "authorHandle": "Mastodon@mastodon.social",
  "authorName": "Mastodon",
  "authorUrl": "https://mastodon.social/@Mastodon",
  "authorFollowers": 878843,
  "authorCreatedAt": "2016-11-23T00:00:00.000Z",
  "authorIsBot": false,
  "authorIndexable": true,
  "threadOfUri": null
}
```

A Lemmy post, from a community (`lemmy_post`):

```json
{
  "recordType": "lemmy_post",
  "network": "lemmy",
  "server": "lemmy.ml",
  "source": "community:!linux@lemmy.ml",
  "scrapedAt": "2026-11-19T18:58:24.983Z",
  "id": "55495134",
  "apId": "https://lemmy.ml/post/55495134",
  "url": "https://lemmy.ml/post/55495134",
  "title": "Locking down a fresh Linux server: What you actually need to do before bots find it",
  "text": "When you spin up a fresh public Linux instance, automated scanners start knocking on your doors within milliseconds. \n\nIt doesn't take much to get locked down properly, but missing a few basics can leave you exposed. \n\nI've put together a straightforward guide covering the essential hardening steps from UFW and SSH key-only auth to secure Docker bindings and automated maintenance.\n\n---\nOriginal content by The Unknown Universe, written by a human and not AI generated!",
  "link": "https://unknownuniverse.uk/privacy-security/server-hardening-guide/",
  "linkDomain": "unknownuniverse.uk",
  "thumbnail": "https://lemmy.ml/api/v3/image_proxy?url=https%3A%2F%2Funknownuniverse.uk%2Fwp-content%2Fuploads%2F2026%2F11%2Fserver-hardening.webp",
  "embedTitle": "Essential Server Hardening Guide",
  "embedDescription": "A practical, guide to hardening a public-facing Linux server against automated threats and bots.",
  "communityHandle": "linux@lemmy.ml",
  "communityTitle": "Linux",
  "authorHandle": "TheIPW@lemmy.ml",
  "authorName": "UnknownUniverse",
  "authorIsBot": false,
  "authorIsModerator": false,
  "authorIsAdmin": false,
  "score": 67,
  "upvotes": 68,
  "downvotes": 1,
  "comments": 8,
  "createdAt": "2026-11-19T13:56:04.292Z",
  "editedAt": null,
  "newestCommentAt": "2026-11-19T16:41:07.853Z",
  "nsfw": false,
  "locked": false,
  "featuredCommunity": false,
  "featuredLocal": false,
  "removed": false,
  "deleted": false,
  "languageId": 37
}
```

A server record (`server`, `activity` and `rules` shortened here to the first items):

```json
{
  "recordType": "server",
  "network": "mastodon",
  "server": "mastodon.social",
  "source": "server:mastodon.social",
  "scrapedAt": "2026-11-19T18:57:33.225Z",
  "software": "mastodon",
  "version": "5.0.0-beta.1+pr-41754-9d7b2c3",
  "title": "Mastodon.social",
  "description": "The original server of Mastodon, operated by Mastodon GmbH for the common good.\r\n\r\n",
  "registrationsOpen": true,
  "approvalRequired": false,
  "users": 3482995,
  "activeMonth": 266747,
  "activeHalfYear": 629341,
  "posts": 196028335,
  "languages": ["en"],
  "contactEmail": "staff@mastodon.social",
  "contactAccount": "Mastodon@mastodon.social",
  "rules": [
    "Sexually explicit or violent media must be marked as sensitive or with a content warning",
    "No racism, sexism, homophobia, transphobia, ableism, xenophobia, or casteism.",
    "No incitement of violence or promotion of violent ideologies"
  ],
  "admins": [],
  "activity": [
    { "week": "2026-11-19", "posts": 82481, "logins": 37354, "registrations": 816 },
    { "week": "2026-11-12", "posts": 1123516, "logins": 161916, "registrations": 11657 }
  ],
  "blockedCount": 414,
  "peersCount": null
}
```

A server it blocks (`server_block`):

```json
{
  "recordType": "server_block",
  "network": "mastodon",
  "server": "mastodon.social",
  "source": "blocks:mastodon.social",
  "scrapedAt": "2026-11-19T18:57:33.225Z",
  "blockedDomain": "ac.akirin.xyz",
  "severity": "silence",
  "reason": "Unmanaged spam",
  "digest": "5eb73fede7eaa19e7ad756c30783e858acffea6ff0afb574fde9c351922c62bb"
}
```

A trending news link (`mastodon_link`, `history` shortened to 2 of 7 days):

```json
{
  "recordType": "mastodon_link",
  "network": "mastodon",
  "server": "mastodon.social",
  "source": "trends:links@mastodon.social",
  "scrapedAt": "2026-11-19T19:01:37.343Z",
  "url": "https://www.theguardian.com/us-news/2026/nov/18/elon-musk-maga-trump",
  "title": "Elon Musk claims ‘I’m not Maga’ and says he regrets vast sums to back Republicans",
  "description": "Musk, Trump ally and frequent White House guest, says he feels ‘pretty foolish’ about record midterm spending",
  "language": "en",
  "type": "link",
  "providerName": "The Guardian",
  "authorName": "Lucy Campbell",
  "publishedAt": "2026-11-19T01:07:51.000Z",
  "image": "https://files.mastodon.social/cache/preview_cards/images/215/339/552/original/87ce6074542e6e89.jpg",
  "uses7d": 191,
  "accounts7d": 182,
  "history": [
    { "day": "2026-11-19", "uses": 191, "accounts": 182 },
    { "day": "2026-11-18", "uses": 0, "accounts": 0 }
  ]
}
```

A Lemmy moderation action (`lemmy_modlog`):

```json
{
  "recordType": "lemmy_modlog",
  "network": "lemmy",
  "server": "lemmy.ml",
  "source": "modlog@lemmy.ml",
  "scrapedAt": "2026-11-19T18:58:24.983Z",
  "action": "removed_posts",
  "actionId": "51738",
  "moderatorHandle": null,
  "targetType": "post",
  "targetId": "55497756",
  "targetLabel": "The Video Game Cycle",
  "communityHandle": "games@lemmy.world",
  "reason": "rule 4",
  "applied": true,
  "when": "2026-11-19T16:04:32.157Z",
  "expires": null
}
```

### Fields

Every row has `recordType`, `network` (`mastodon` or `lemmy`), `server` (where it was read), `source` (which input produced it) and `scrapedAt`. The Output tab groups them in views (posts, comments, people, engagement, trends, servers, moderation).

| `recordType` | One row per | Main fields |
|---|---|---|
| `mastodon_post` | Post | `text`, `contentHtml`, `createdAt`, `editedAt`, `favourites`, `reblogs`, `replies`, `quotes`, `tags`, `mentions`, `media`, `cardUrl`, `pollOptions`, `language`, `isReblog`, `authorHandle`, `authorFollowers`, `authorIndexable`, `uri`, `url`, `threadOfUri` |
| `mastodon_account` | Account | `handle`, `displayName`, `bio`, `fields` (with verification date), `followers`, `following`, `posts`, `createdAt`, `lastPostAt`, `isBot`, `indexable`, `featuredTags`, `relation` (profile, follower, following, endorsement, search, directory) |
| `mastodon_engagement` | Like or boost | `kind` (`favourite`/`reblog`), `postUri`, `accountHandle`, `accountName`, `accountFollowers`, `accountCreatedAt`, `accountIsBot` |
| `mastodon_post_edit` | Version of an edited post | `postUri`, `editIndex` (0 = original), `text`, `createdAt` |
| `mastodon_hashtag` | Hashtag | `name`, `uses7d`, `accounts7d`, `history` (per day) |
| `mastodon_link` | Trending link | `url`, `title`, `providerName`, `authorName`, `publishedAt`, `uses7d`, `accounts7d`, `history` |
| `lemmy_post` | Post | `title`, `text`, `link`, `linkDomain`, `score`, `upvotes`, `downvotes`, `comments`, `createdAt`, `communityHandle`, `authorHandle`, `nsfw`, `locked`, `removed`, `apId` |
| `lemmy_comment` | Comment | `text`, `postId`, `postTitle`, `parentId`, `depth`, `path`, `score`, `upvotes`, `downvotes`, `childCount`, `authorHandle`, `createdAt` |
| `lemmy_community` | Community | `handle`, `title`, `description`, `subscribers`, `activeDay`, `activeWeek`, `activeMonth`, `posts`, `comments`, `moderators`, `nsfw` |
| `lemmy_user` | User | `handle`, `displayName`, `posts`, `comments`, `createdAt`, `isAdmin`, `banned`, `moderates` |
| `lemmy_modlog` | Moderation action | `action`, `targetType`, `targetLabel`, `communityHandle`, `reason`, `when`, `expires` |
| `server` | Server | `software`, `version`, `users`, `activeMonth`, `posts`, `registrationsOpen`, `rules`, `admins`, `activity` (12 weeks, Mastodon), `blockedCount`, `peersCount` |
| `server_block` | Blocked server | `blockedDomain`, `severity`, `reason` |
| `server_peer` | Known server | `peerDomain` |

### How to use it

Every input is optional. Fill in only what you need; each filled list becomes a "source".

- **Posts with a hashtag on several servers**: put the hashtag in *Hashtags* and the servers in *Mastodon servers* (for example `mastodon.social`, `fosstodon.org`, `hachyderm.io`).
- **Everything about an account**: put `@user@server` or the profile URL in *Accounts*. Turn on *Who liked and boosted each post* to get the engagers.
- **A full discussion**: put the post URL in *Post URLs* (Mastodon) or *Post URLs (with every comment)* (Lemmy).
- **A Lemmy community**: put `!name@server` or the community URL in *Communities*. Turn on *Include comments of each post* for the comments.
- **Compare servers**: put domains in *Server data*. You get one row per server plus its blocklist.
- **Control cost**: *Max results per source* caps each source; *Posted since* stops at a date so old items are never fetched.

### Use cases

- **Brand, product and topic monitoring** on Mastodon and Lemmy: hashtags, searches and communities, scheduled daily.
- **Open-source and developer community research**: much of the fediverse is technical; track projects, releases and discussions.
- **Media and link tracking**: which news links trend on Mastodon, and who is sharing them.
- **Engagement analysis**: who liked and boosted a post, and how a thread unfolds.
- **Fediverse and trust & safety research**: server growth, rules, sign-up policies, which servers block which, and what moderators remove on Lemmy.
- **Discussion analysis**: full Lemmy comment trees with depth and votes, for sentiment or topic analysis.

### Pricing

Pay per result: **$0.30 per 1,000 results, of any type.** You only pay for rows delivered to your dataset. Failed sources, duplicates and skipped items (accounts that asked not to be indexed, NSFW when you skip it, posts older than *Posted since*) are never charged, and there is no start fee.

| Result | Row types | Price per result | Per 1,000 |
|---|---|---|---|
| Post or comment | `mastodon_post`, `mastodon_post_edit`, `mastodon_hashtag`, `mastodon_link`, `lemmy_post`, `lemmy_comment`, `lemmy_modlog` | $0.0003 | **$0.30** |
| Profile | `mastodon_account`, `mastodon_engagement`, `lemmy_community`, `lemmy_user` | $0.0003 | **$0.30** |
| Server data | `server`, `server_block`, `server_peer` | $0.0003 | **$0.30** |

**Examples:**

- 100 posts of one hashtag: 100 × $0.0003 = **$0.03**.
- One Lemmy post with all of its 300 comments: 301 × $0.0003 = **$0.0903**.
- One account with *Max results per source* = 20 and *who liked or boosted* on: at most 20 rows (profile and posts) + 20 posts × (20 likes + 20 boosts) = 820 rows × $0.0003 = **$0.246**. Lower the limit to keep it smaller.

Platform usage is small: a cloud run with 79 results took 24.6 seconds with 512 MB (measured on 2026-11-19). Most of that time is the polite pace of one request per second per server.

If you set a **maximum cost per run**, the Actor stops when it is reached. The platform treats that limit as a stop signal, so the last charge can go over it by at most the price of one result.

### Respecting the fediverse

- **"Do not index" requests are respected by default.** Mastodon accounts that explicitly ask search engines not to index them (`noindex`) are skipped, with their posts, boosts and likes. You can turn this off with *Respect 'do not index' requests*. Accounts that only opted out of full-text search are kept, and flagged in `indexable` / `authorIndexable`.
- **Polite speed**: at most one request per second per server, following the rate-limit headers each server sends.
- **No contact harvesting**: the Actor does not extract emails or phone numbers from bios.

### Limitations (honest)

- **Each Mastodon server sees only part of the network.** A hashtag on `mastodon.social` returns the posts that reached that server. Add more servers for wider coverage; duplicates are removed automatically.
- **"Who shared this link" only works for links that are trending on that server right now.** This is a Mastodon API limit. For any other link the server answers "not found" and the source is reported in the run summary.
- **Mastodon people search returns at most 40 accounts per server and search** without login.
- **The public timeline is closed on big servers** (mastodon.social and others) for logged-out visitors. It is best effort: when closed, the source is marked unavailable and the run continues.
- **Some admins hide their blocklist.** Then `blockedCount` is `null` and there are no `server_block` rows for that server.
- **Lemmy search is slow by design**: servers allow only a few searches per minute, and the Actor waits as the server asks.
- **Lemmy moderator names are hidden** by Lemmy in the public moderation log (`moderatorHandle` is usually `null`).
- **Lemmy API v3.** All big Lemmy servers run it today. When they move to Lemmy 1.0 (`/api/v4`), the Actor will need an update.
- **Only Mastodon and Lemmy are supported** for posts and communities. Other fediverse software (Misskey, Pleroma, PeerTube, Mbin, PieFed...) has its own API. *Server data* works with any server that publishes nodeinfo.
- **Media is returned as URLs**, not downloaded.
- **Content that needs login** (private posts, followers-only posts, quotes list, Lemmy votes by user) is not available.

### FAQ

**Do I need a Mastodon or Lemmy account, an API key or a proxy?**
No. Everything comes from public, logged-out APIs.

**How fresh is the data?**
Live. Each run reads the current state of each server.

**Why do I get fewer posts than expected?**
The server you chose may not have received all posts with that hashtag, some accounts asked not to be indexed, or *Max results per source* was reached. The `RUN_SUMMARY` record (in the run's key-value store) tells you how many items each source delivered, which sources failed or need login, and how many items were skipped as "do not index" or NSFW.

**How do I join the same post seen on different servers?**
Use `uri` (Mastodon) or `apId` (Lemmy). They are the same on every server. The local `id` is different on each server.

**Can I scrape a small server, not just the big ones?**
Yes. Any Mastodon or Lemmy server works; put its domain in *Mastodon servers* or *Lemmy servers*.

**Is this affiliated with the Mastodon or Lemmy projects, or with any server?**
No. This is an independent tool that reads publicly available data through the servers' public APIs.

# Actor input Schema

## `hashtags` (type: `array`):

Posts with these hashtags, newest first, from every server in 'Mastodon servers'. The same post seen on several servers is returned once (matched by its global id). With or without #.

## `mastodonServers` (type: `array`):

Mastodon is federated: each server only sees the posts that reached it. Hashtags, trends, link search and account search run on every server listed here (up to 20). Accounts and post URLs always go to their own server. Default: mastodon.social.

## `mastodonAccounts` (type: `array`):

Profile (with featured hashtags) and posts. @user@server, user@server or a profile URL. A bare username uses the first server above.

## `mastodonPostUrls` (type: `array`):

The post plus its whole thread (parents and replies). Each thread row has threadOfUri set to the post you asked for.

## `sharedLinks` (type: `array`):

Posts that shared a URL. Limitation of the Mastodon API: it only answers for links that are trending on that server right now; for any other link the server returns nothing (noted in the run summary).

## `mastodonTrends` (type: `array`):

What is trending right now on each Mastodon server: posts, hashtags (with 7-day usage) and links (news articles with 7-day shares).

## `mastodonPublicTimeline` (type: `string`):

Best effort: big servers (mastodon.social and others) close it to logged-out visitors; then the source is marked unavailable in the run summary and the run goes on.

## `accountSearch` (type: `array`):

Accounts matching these words, on each Mastodon server above. Without login Mastodon returns at most 40 accounts per server and search.

## `includeReplies` (type: `boolean`):

Account posts: also return the replies the account wrote.

## `includeBoosts` (type: `boolean`):

Account posts: also return posts the account boosted (isReblog = true; text and counters are the original post's).

## `includeEngagers` (type: `boolean`):

For every Mastodon post returned, also return one row per account that liked or boosted it (up to 'Max results per source' of each). Adds at least 2 requests per post.

## `includeEditHistory` (type: `boolean`):

For every edited Mastodon post, return each previous version (one extra request per edited post).

## `includeFollowers` (type: `boolean`):

For each account above, also return its followers, the accounts it follows and the accounts it recommends, up to 'Max results per source' each. Some accounts hide these lists.

## `lemmyCommunities` (type: `array`):

Community details (subscribers, activity, moderators) and its posts. !name@server, name@server or a community URL. A bare name uses the first Lemmy server below.

## `lemmyServers` (type: `array`):

Servers for the feed, search and moderation log (up to 20). Default: lemmy.world.

## `lemmyPostUrls` (type: `array`):

The post plus ALL its comments, with depth, parent and path to rebuild the tree. Comments are paginated in full (no 300-comment cut).

## `lemmyUsers` (type: `array`):

Profile, communities they moderate, and their posts and comments. name@server or a profile URL.

## `lemmySearch` (type: `array`):

Full-text search on each Lemmy server above. Lemmy servers allow only a few searches per minute, so large searches are slow (the Actor waits as the server asks).

## `lemmySearchType` (type: `string`):

What the Lemmy search returns.

## `lemmyFeed` (type: `boolean`):

All posts the Lemmy server sees, in the order below.

## `lemmySort` (type: `string`):

Order of the feed and of community posts. New is chronological, so 'Posted since' can stop early.

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

For posts from the feed, communities and search, also return all their comments (up to 'Max results per source' per post).

## `serverInfo` (type: `array`):

One row per server: software and version, sign-up policy, users, rules, admins and, on Mastodon, 12 weeks of posts, logins and sign-ups. Works with any fediverse software (detected via nodeinfo); content is collected only from Mastodon and Lemmy.

## `includeBlocklists` (type: `boolean`):

With 'Server data': one row per server it blocks (Mastodon: with severity and reason). Some admins do not publish the list; then blockedCount is null.

## `includePeers` (type: `boolean`):

With 'Server data': one row per server it federates with. Can be over 100,000 rows; capped by 'Max results per source'.

## `includeModlog` (type: `boolean`):

Public moderation log of each Lemmy server above: removals, bans, locks, pins and purges, with moderator, target, reason and date.

## `maxItemsPerSource` (type: `integer`):

Limit for EACH source (each hashtag on each server, each account, each community, each search...). Keeps cost predictable. Extras of a post (likes, boosts, edits, Lemmy comments) have the same limit, separately.

## `since` (type: `string`):

Skip posts, comments and moderation actions older than this day (UTC). Newest-first sources stop paginating there, so you do not pay for old items.

## `skipNsfw` (type: `boolean`):

Skip Mastodon posts marked sensitive and Lemmy posts marked NSFW (or in NSFW communities).

## `respectNoIndex` (type: `boolean`):

On by default: skips Mastodon accounts (and their posts, boosts, likes and follower rows) that explicitly asked search engines not to index them (noindex). Mastodon only reveals this for accounts of the server queried. Accounts that just opted out of Mastodon's own full-text search (indexable = false) are kept, with that flag in the authorIndexable / indexable column so you can filter. Skipped items are counted in the run summary and never charged.

## `healthCheck` (type: `boolean`):

For the scheduled daily health check. Ignores every other field, checks a fixed list of stable Mastodon and Lemmy hashtags, accounts, trends, communities, users, modlogs and servers, writes nothing to the dataset (no charge), and FAILS the run if a whole source stops responding. The status message names the broken source.

## `healthCheckSimulateFailure` (type: `boolean`):

Test only: with health check mode, swaps the test accounts and users for nonexistent ones so those sources really fail. Used to prove the failure alert works.

## Actor input object example

```json
{
  "hashtags": [
    "opensource"
  ],
  "mastodonServers": [
    "mastodon.social"
  ],
  "mastodonPublicTimeline": "none",
  "includeReplies": true,
  "includeBoosts": false,
  "includeEngagers": false,
  "includeEditHistory": false,
  "includeFollowers": false,
  "lemmyCommunities": [
    "!linux@lemmy.ml"
  ],
  "lemmyServers": [
    "lemmy.world"
  ],
  "lemmySearchType": "Posts",
  "lemmyFeed": false,
  "lemmySort": "Hot",
  "includeComments": false,
  "serverInfo": [
    "mastodon.social"
  ],
  "includeBlocklists": true,
  "includePeers": false,
  "includeModlog": false,
  "maxItemsPerSource": 10,
  "skipNsfw": false,
  "respectNoIndex": true,
  "healthCheck": false,
  "healthCheckSimulateFailure": false
}
```

# Actor output Schema

## `results` (type: `string`):

No description

## `runSummary` (type: `string`):

Counts per source and record type, items skipped (do-not-index, NSFW, date), what failed and why, and rate-limit waits.

# 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 = {
    "hashtags": [
        "opensource"
    ],
    "mastodonServers": [
        "mastodon.social"
    ],
    "lemmyCommunities": [
        "!linux@lemmy.ml"
    ],
    "lemmyServers": [
        "lemmy.world"
    ],
    "serverInfo": [
        "mastodon.social"
    ],
    "maxItemsPerSource": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("powernaner/mastodon-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 = {
    "hashtags": ["opensource"],
    "mastodonServers": ["mastodon.social"],
    "lemmyCommunities": ["!linux@lemmy.ml"],
    "lemmyServers": ["lemmy.world"],
    "serverInfo": ["mastodon.social"],
    "maxItemsPerSource": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("powernaner/mastodon-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 '{
  "hashtags": [
    "opensource"
  ],
  "mastodonServers": [
    "mastodon.social"
  ],
  "lemmyCommunities": [
    "!linux@lemmy.ml"
  ],
  "lemmyServers": [
    "lemmy.world"
  ],
  "serverInfo": [
    "mastodon.social"
  ],
  "maxItemsPerSource": 10
}' |
apify call powernaner/mastodon-lemmy-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,powernaner/mastodon-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/ImXD3CDmOm4k10RfW/builds/5Mmix4NjJZYuejyMw/openapi.json
