# Mastodon & Lemmy Scraper: Fediverse Posts, Profiles, Comments (`spriggs-data/fediverse-scraper`) Actor

Scrape Mastodon and Lemmy with no login or API key: hashtag posts across many servers, account posts, profiles, followers, trending posts & hashtags, replies, Lemmy keyword search, community posts, comments and communities. Bio email/website extraction. JSON, CSV, Excel.

- **URL**: https://apify.com/spriggs-data/fediverse-scraper.md
- **Developed by:** [Thomas Spriggs](https://apify.com/spriggs-data) (community)
- **Categories:** Social media, Lead generation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.30 / 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

## Mastodon & Lemmy Scraper: Fediverse Posts, Profiles, Followers & Comments (No Login)

**Scrape Mastodon and Lemmy in one Actor, with no account, cookies or API key.** Get **Mastodon hashtag posts across many servers at once**, **account posts**, **profiles**, **followers and following lists**, **people search**, **trending posts and hashtags** and **replies**, plus **Lemmy keyword search** (posts, comments or communities), **community posts**, **full comment threads** and **community lists**. Export to JSON, CSV, Excel or Google Sheets, or push to Make, Zapier, n8n, your AI agent or an API.

It reads the official public REST API that every Mastodon and Lemmy server publishes, so it's fast, stable and cheap: no headless browser, no proxies, about **$0.50 per 1,000 results**.

### What can this Fediverse scraper do?

| Network | Mode | Input | You get |
|---|---|---|---|
| Mastodon | Hashtag posts | `tattoo`, `#opensource` + a list of servers | Posts with text, author, favourites, boosts, replies, hashtags, links, images/video, language, timestamps. Duplicates across servers are removed |
| Mastodon | Account posts | `@user@server` or profile URL | An account's posts (filters: no replies, no boosts, media only, date range) |
| Mastodon | Profiles | `@user@server` or profile URL | Bio, profile fields, followers, following, post count, join date, last post, bot/group flags, optional emails and websites |
| Mastodon | Followers / Following | `@user@server` | Follower and following lists as full profiles |
| Mastodon | Search accounts | keywords (`tattoo artist`) | Matching people from each server you list (up to 40 per server; Mastodon's logged-out limit) |
| Mastodon | Trending posts | servers | The server's trending posts right now |
| Mastodon | Trending hashtags | servers | Trending tags with 7-day use and account counts |
| Mastodon | Replies to a post | post URL | The reply thread under a post |
| Lemmy | Keyword search | keywords + Lemmy servers | Posts, comments or communities matching the words (full-text) |
| Lemmy | Community posts | `!technology@lemmy.world` or `/c/` URL | Posts with title, body, link, score, up/down votes, comment count |
| Lemmy | Post comments | `https://lemmy.world/post/123` | The whole comment tree, with depth and parent comment ID |
| Lemmy | Communities | keywords, or nothing for the top list | Community name, description, subscribers, posts, comments, active users per day/week/month |

**Built-in extras**

- **Many servers in one run:** Mastodon is federated, so each server only shows the posts it knows about. List `mastodon.social`, `fosstodon.org`, `hachyderm.io`, `mstdn.social` (or any others) and the Actor merges them and removes duplicates by the post's ActivityPub URI.
- **Lead mode** (`extractContacts`): pulls **emails and websites from bios and profile links**. Useful for creator outreach and B2B prospecting.
- **Date, language and reply filters:** `since`/`until`, `language` (e.g. `en`), `excludeReplies`, `excludeBoosts`, `onlyMedia`. Newest-first streams stop as soon as they pass your `since` date, so you don't pay for old posts.
- **Polite and respectful by default:** at most about one request per second per server, it reads each server's `x-ratelimit-*` headers and slows down before hitting the limit, retries on 429/5xx, skips NSFW and sensitive-media posts (`skipNsfw`), and skips Mastodon accounts that opted out of search indexing (`respectNoIndex`). Skipped items don't count toward your limits, so asking for 100 posts gets you 100 kept posts when that many exist.
- **One bad input doesn't kill the run:** a missing account or an offline server is logged in the run summary and the rest carries on.
- **Predictable cost:** `maxItems` and Apify's "max cost per run" are both respected exactly.

### Why scrape Mastodon and Lemmy?

Mastodon has hundreds of thousands of monthly active users across thousands of servers (mastodon.social alone reports about 270,000), and Lemmy is the biggest federated Reddit alternative. Both are public, open-protocol networks where developers, researchers, journalists, artists and privacy-minded users talk in the open.

- **Social listening and brand monitoring:** track hashtags, products and competitors across the open social web, together with our [Bluesky Scraper](https://apify.com/spriggs-data/bluesky-scraper).
- **Reddit-style research on Lemmy:** full-text search of posts and comments, whole comment threads and community stats.
- **Lead generation and influencer discovery:** search people by niche, export followers of a competitor, and pull emails and websites from bios.
- **Trend tracking:** daily snapshots of trending posts and hashtags per server.
- **Academic research, NLP and LLM datasets:** collect posts and comments by topic, date range and language.
- **AI agents and RAG pipelines:** clean, flat JSON that's ready for LLMs.

### How to use it

1. Click **Try for free**.
2. Pick a **mode** (e.g. *Mastodon: posts with a #hashtag*).
3. Enter hashtags, accounts, search terms, communities or URLs (one per line), and the servers to read from.
4. Set **Max items** and click **Start**.
5. Download your data as JSON, CSV, Excel or HTML, or connect it via API or integrations.

#### Example: one hashtag across four Mastodon servers, English only, last week

```json
{
  "mode": "hashtagPosts",
  "hashtags": ["opensource"],
  "instances": ["mastodon.social", "fosstodon.org", "hachyderm.io", "mstdn.social"],
  "language": "en",
  "since": "2026-10-16",
  "maxItemsPerInput": 500
}
```

#### Example: Lemmy full-text search across two servers

```json
{
  "mode": "lemmySearch",
  "searchTerms": ["home depot", "lowes"],
  "lemmyInstances": ["lemmy.world", "lemmy.ml"],
  "lemmySearchType": "Comments",
  "lemmySort": "New",
  "maxItemsPerInput": 200
}
```

#### Example: people search with emails and websites

```json
{
  "mode": "searchAccounts",
  "searchTerms": ["tattoo artist", "illustrator"],
  "instances": ["mastodon.social", "mastodon.art", "mstdn.social"],
  "extractContacts": true
}
```

#### Example: every comment on a Lemmy post

```json
{ "mode": "lemmyPostComments", "urls": ["https://lemmy.world/post/53446449"], "maxItemsPerInput": 1000 }
```

### Output example (Mastodon hashtag post, real record)

```json
{
  "type": "mastodonPost",
  "platform": "mastodon",
  "url": "https://mastodon.social/@poliintl/117489993412846364",
  "instance": "mastodon.social",
  "authorAcct": "poliintl@mastodon.social",
  "authorName": "Poli International",
  "text": "Photoresponsive tattoo ink fades in sunlight and reappears under UV light. Long term safety data is currently missing. #tattoo ...",
  "language": "en",
  "createdAt": "2026-10-23T11:30:26.443Z",
  "repliesCount": 0,
  "boostsCount": 0,
  "favouritesCount": 0,
  "hashtags": ["tattoo"],
  "links": ["https://poliinternational.com/blog/the-tattoo-that-turns-off-in-sunlight-and-back-on-under-uv/"],
  "linkTitle": "The Tattoo That Turns Off in Sunlight—and Back On Under UV",
  "media": [],
  "isReply": false,
  "sourceInput": "#tattoo"
}
```

Lemmy posts have `title`, `body`, `linkUrl`, `community`, `author`, `score`, `upvotes`, `downvotes` and `commentsCount`. Lemmy comments have `text`, `depth`, `parentCommentId` and `postTitle`. Profiles have `acct`, `bio`, `fields`, `followersCount`, `followingCount`, `postsCount` and optional `emails`/`websites`. Every record has `platform`, `type`, `url`, `sourceInput` and `scrapedAt`. A `RUN_SUMMARY` record in the key-value store lists item counts, skipped items, API requests and any input errors.

### Pricing

Pay per result: **$0.0005 per result ($0.50 per 1,000)** on the Free plan, cheaper on paid Apify plans (down to $0.30 per 1,000), plus a tiny per-run start fee. You only pay for results saved to the dataset. Apify's free monthly credit covers thousands of results.

### Limits and honest notes

- **Mastodon has no logged-out full-text post search.** Servers only allow keyword search of posts for signed-in users, so this Actor finds posts by **hashtag**, **account**, **trends** and **replies**. (Lemmy full-text search works without login.)
- Each Mastodon server returns the hashtag posts it has seen. Big servers (mastodon.social) see the most; add niche servers for niche topics.
- Mastodon people search returns up to 40 accounts per term per server when logged out. Add more servers to get more.
- Accounts that hide their follower lists, private posts and direct messages are never returned.
- Lemmy `since` stops early only with `lemmySort: New`; with other sorts it filters as it goes.
- The Actor only reads public data and never posts, follows, votes or messages anyone. Please respect each server's rules and the people in your data (GDPR/CCPA apply to personal data you store).

### FAQ

**Do I need a Mastodon or Lemmy account?** No. Every mode works without login or API keys.

**Which servers are supported?** Any Mastodon-API server (Mastodon, and most Glitch/Hometown forks) and any Lemmy server (0.19+). Some other software (Pixelfed, Misskey) is not supported yet.

**Can I schedule it?** Yes. Use Apify Schedules (e.g. a daily hashtag or trending run) and send results to Google Sheets, Slack, a webhook or your database.

**Can AI agents use it?** Yes. Inputs and outputs are simple JSON, and it works through Apify's API and MCP server.

### Related Spriggs Data actors

- **[Bluesky Scraper: Posts, Profiles, Followers & Likers](https://apify.com/spriggs-data/bluesky-scraper)**: the other half of the open social web. Deep keyword search, followers, likers, reposters, replies, starter packs and custom feeds, with bio email extraction. No login.
- **[US Building Permits API: Construction, Roofing & Solar Leads](https://apify.com/spriggs-data/us-building-permits)**: newly issued building permits from 39 official US city and county portals, with roofing, solar, HVAC and new-construction lead filters.
- **[US Contractor License Lookup: CA, FL, TX, NY, WA, OR, CT, CO](https://apify.com/spriggs-data/us-contractor-license-lookup)**: verify contractor licenses and build trade-contractor lead lists from 13 official state and city license databases.

*Keywords: Mastodon scraper, Lemmy scraper, Fediverse scraper, Mastodon API, Mastodon hashtag scraper, Mastodon followers export, Lemmy comments scraper, Lemmy API, ActivityPub scraper, Reddit alternative data, open social web data.*

# Actor input Schema

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

Mastodon modes use 'Hashtags', 'Accounts', 'Search terms' or 'URLs' plus 'Mastodon servers'. Lemmy modes use 'Search terms', 'Communities' or 'URLs' plus 'Lemmy servers'.

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

Without or with #, e.g. tattoo, opensource. Used by 'posts with a #hashtag'.

## `instances` (type: `array`):

Servers to read from, e.g. mastodon.social, fosstodon.org, hachyderm.io, mstdn.social. Each server shows the hashtag posts it knows about; adding more servers finds more posts (duplicates are removed). Also used for account search and trends.

## `accounts` (type: `array`):

@user@server, user@server or a profile URL like https://mastodon.social/@Gargron. Used by account posts, profiles, followers and following.

## `searchTerms` (type: `array`):

Mastodon: people search (names, bios). Lemmy: full-text search of posts, comments or communities. (Logged-out Mastodon has no full-text post search; use hashtags.)

## `urls` (type: `array`):

Mastodon post URL (https://server/@user/123...) for 'replies'; Lemmy post URL (https://lemmy.world/post/123) for 'comments'.

## `lemmyInstances` (type: `array`):

e.g. lemmy.world, lemmy.ml, sh.itjust.works, lemm.ee. Search runs on each server (duplicates removed).

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

!technology@lemmy.world, technology@lemmy.world or https://lemmy.world/c/technology.

## `maxItemsPerInput` (type: `integer`):

Upper limit for each hashtag / account / search term / community / URL (per server for trends).

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

Hard cap for the whole run (keeps cost predictable). 0 = no cap.

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

Only posts/comments created on or after this date.

## `until` (type: `string`):

Only posts/comments created before this date.

## `language` (type: `string`):

ISO code like en, de, ja. Keeps only Mastodon posts in that language.

## `excludeReplies` (type: `boolean`):

Skip posts that are replies.

## `excludeBoosts` (type: `boolean`):

Skip boosts (reposts) in account posts.

## `onlyMedia` (type: `boolean`):

Hashtag and account posts with images/video only.

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

Order for Lemmy search and community posts. 'New' lets the date filter stop early.

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

For 'Lemmy: keyword search'.

## `lemmyCommunity` (type: `string`):

Optional, e.g. technology@lemmy.world.

## `extractContacts` (type: `boolean`):

Adds emails\[] and websites\[] to Mastodon profiles (from the bio and profile links).

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

Skip Lemmy posts/communities marked NSFW and Mastodon posts whose media is marked sensitive.

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

Skip Mastodon accounts that opted out of search-engine indexing (noindex).

## Actor input object example

```json
{
  "mode": "hashtagPosts",
  "hashtags": [
    "tattoo"
  ],
  "instances": [
    "mastodon.social"
  ],
  "lemmyInstances": [
    "lemmy.world"
  ],
  "maxItemsPerInput": 100,
  "maxItems": 1000,
  "excludeReplies": false,
  "excludeBoosts": false,
  "onlyMedia": false,
  "lemmySort": "New",
  "lemmySearchType": "Posts",
  "extractContacts": false,
  "skipNsfw": true,
  "respectNoIndex": true
}
```

# Actor output Schema

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

No description

## `summary` (type: `string`):

No description

# 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": [
        "tattoo"
    ],
    "instances": [
        "mastodon.social"
    ],
    "lemmyInstances": [
        "lemmy.world"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("spriggs-data/fediverse-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": ["tattoo"],
    "instances": ["mastodon.social"],
    "lemmyInstances": ["lemmy.world"],
}

# Run the Actor and wait for it to finish
run = client.actor("spriggs-data/fediverse-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": [
    "tattoo"
  ],
  "instances": [
    "mastodon.social"
  ],
  "lemmyInstances": [
    "lemmy.world"
  ]
}' |
apify call spriggs-data/fediverse-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,spriggs-data/fediverse-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/wwPBHi0dzniF46Phf/builds/hpeeYZaB7h3NasZbb/openapi.json
