# Mastodon Scraper — Profiles, Posts, Hashtags & Followers (`jeffev/mastodon-scraper`) Actor

Scrape Mastodon and the fediverse without login: profiles from any instance (followers, posts, bio, verified links, emails), a profile's posts, posts by hashtag, followers and following lists, and people search.

- **URL**: https://apify.com/jeffev/mastodon-scraper.md
- **Developed by:** [Jefferson Valandro](https://apify.com/jeffev) (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.21 / 1,000 posts

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 Scraper — profiles, posts, hashtags & followers

Scrape **Mastodon and the fediverse** without login or API keys. Get **profiles from any instance** (followers, following, posts count, bio, **verified links**, emails in the bio, last post date), a profile's **posts** (with favourites, boosts, replies, hashtags, links and media), **posts by hashtag**, **followers and following** lists, and **people search**.

Use it for **social listening, community research, influencer discovery in tech and science niches, and audience mapping** on decentralized social networks.

### Why this one

- **Any instance**: mastodon.social, fosstodon.org, mstdn.social, hachyderm.io... just paste the profile URL or handle.
- **Verified links**: the links Mastodon verified on the profile (personal sites, GitHub...), plus emails found in the bio.
- **Hashtag monitoring**: thousands of posts per hashtag, newest first, with boosts and replies filters.
- **Audience lists**: followers and following of any public profile.

### Input

```json
{
  "profiles": ["https://mastodon.social/@Gargron", "@fosstodon@fosstodon.org"],
  "postsPerProfile": 50,
  "hashtags": ["python", "opensource"],
  "maxPostsPerHashtag": 500,
  "instance": "mastodon.social",
  "network": "followers",
  "maxNetworkPerProfile": 1000,
  "peopleSearch": ["data journalist"]
}
```

### Output (field `type`)

| type | Main fields |
|---|---|
| `profile` | `handle`, `username`, `displayName`, `url`, `bio`, `followers`, `following`, `posts`, `links`, `verifiedLinks`, `emails`, `createdAt`, `lastPostAt`, `bot`, `avatar` |
| `post` | `url`, `createdAt`, `text`, `language`, `authorHandle`, `favourites`, `boosts`, `replies`, `isBoost`, `isReply`, `hashtags`, `links`, `media`, `profile` / `hashtag` |
| `user` | `handle`, `displayName`, `url`, `bio`, `followers`, `posts`, `relation` |

### Example output

One real item from a test run (long texts and lists shortened):

```json
{
  "type": "profile",
  "username": "Gargron",
  "handle": "@Gargron@mastodon.social",
  "displayName": "Eugen Rochko",
  "url": "https://mastodon.social/@Gargron",
  "bio": "Executive Strategy & Product Advisor, Founder of @Mastodon. Film photography, prog metal, Dota 2. Likes all things analog. Luddite.",
  "emails": [],
  "followers": 383139,
  "following": 753,
  "posts": 82534,
  "createdAt": "2016-03-16T00:00:00.000Z",
  "lastPostAt": "2026-10-13",
  "bot": false,
  "avatar": "https://files.mastodon.social/accounts/avatars/000/000/001/original/6b2384b33799a0dd.png",
  "links": [
    {
      "name": "GitHub",
      "value": "https://github.com/Gargron",
      "verified": true
    },
    {
      "name": "Portfolio",
      "value": "https://eugenrochko.com",
      "verified": true
    }
  ],
  "verifiedLinks": [
    "https://github.com/Gargron",
    "https://eugenrochko.com"
  ],
  "locked": false,
  "group": false,
  "discoverable": true,
  "header": "https://files.mastodon.social/accounts/headers/000/000/001/original/d13e4417706a5fec.jpg"
}
```

### Notes

- Without login, Mastodon allows up to 40 accounts per people search, and text search of posts isn't available; use hashtags for content.
- Hashtag timelines show the posts known to the chosen instance; large instances like mastodon.social see most of the network.

### How much does it cost?

You pay only for results delivered, at a fixed price per item. **Apify platform usage is included** in that price, so there are no compute costs on top. Errors and items that couldn't be found are free.

| What you get | Price | Example |
|---|---|---|
| Profile | $0.001 each | 1,000 profiles = $1.00 |
| Post | $0.0003 each | 1,000 posts = $0.30 |
| User | $0.0002 each | 1,000 users = $0.20 |

The Apify **Free plan includes $5 of monthly credit**, enough for about **5,000 profiles** per month at no cost. You can also set a maximum spend per run.

On paid Apify plans it gets cheaper automatically: **10% off on Starter, 20% on Scale and 30% on Business**.

### Feedback

Found a bug, a site change, or need an extra field? Open an issue in the **Issues** tab: every issue is read and answered. If this actor saved you time, a **review** helps other people find it.

# Actor input Schema

## `profiles` (type: `array`):

Profile URLs (https://instance/@user) or handles (@user@instance). Works with any Mastodon instance.

## `postsPerProfile` (type: `integer`):

How many recent posts to return per profile (0 = none).

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

Hashtags to collect posts from (with or without #), as seen from the instance below.

## `maxPostsPerHashtag` (type: `integer`):

How many posts to collect per hashtag (newest first).

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

Mastodon server used for hashtag timelines and people search (e.g. mastodon.social, fosstodon.org, mstdn.social).

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

Skip posts that are replies.

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

Skip boosts (reposts of other people's posts).

## `network` (type: `string`):

Also list who follows each profile and/or whom it follows (unless the profile hides it).

## `maxNetworkPerProfile` (type: `integer`):

Limit for each list per profile.

## `peopleSearch` (type: `array`):

Find accounts by keyword on the instance (up to 40 per keyword without login).

## `maxPeoplePerSearch` (type: `integer`):

How many accounts to return per keyword (max 40).

## Actor input object example

```json
{
  "profiles": [
    "https://mastodon.social/@Gargron",
    "@fosstodon@fosstodon.org"
  ],
  "postsPerProfile": 20,
  "maxPostsPerHashtag": 100,
  "instance": "mastodon.social",
  "excludeReplies": false,
  "excludeBoosts": false,
  "network": "none",
  "maxNetworkPerProfile": 100,
  "maxPeoplePerSearch": 40
}
```

# Actor output Schema

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

Profiles, posts and users (field 'type').

# 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 = {
    "profiles": [
        "https://mastodon.social/@Gargron",
        "@fosstodon@fosstodon.org"
    ],
    "postsPerProfile": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("jeffev/mastodon-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 = {
    "profiles": [
        "https://mastodon.social/@Gargron",
        "@fosstodon@fosstodon.org",
    ],
    "postsPerProfile": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("jeffev/mastodon-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 '{
  "profiles": [
    "https://mastodon.social/@Gargron",
    "@fosstodon@fosstodon.org"
  ],
  "postsPerProfile": 20
}' |
apify call jeffev/mastodon-scraper --silent --output-dataset

```

## MCP server setup

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