# Mastodon Scraper — Hashtag Posts, Accounts & Trending Toots (`intelscrape/mastodon-scraper`) Actor

Mastodon Scraper: export public Mastodon posts (toots) by hashtag, account or trending list from any instance, with text, boosts, favourites, replies, links, media and author followers, plus 7-day hashtag usage stats. Fediverse social listening. No login. No API key.

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

## Pricing

Pay per event

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 Scraper — Hashtag Posts, Accounts & Trending Toots

![Mastodon Scraper — Hashtag Posts, Accounts & Trending Toots](https://api.apify.com/v2/key-value-stores/hRabN9WfDGrT4nSvV/records/mastodon-scraper-banner.png)

🇨🇳 **Mastodon 爬虫**：从任意实例按话题标签、账号或热门列表导出公开 Mastodon 帖子（toot），包括正文、转发、收藏、回复、链接、媒体和作者粉丝数，并附带 7 天话题标签使用统计。去中心化社交聆听，无需登录，无需 API 密钥。

🇸🇬 **Pengikis Mastodon**: eksport hantaran Mastodon awam mengikut tanda pagar, akaun atau senarai sohor kini daripada mana-mana instans, dengan teks, boost, kegemaran, balasan, pautan, media dan pengikut pengarang. Tiada log masuk.

#### 🤖 NEW: Connect This To Your AI!

Use this actor from Claude, ChatGPT, Cursor or any MCP client through the **[IntelScrape MCP Server](https://apify.com/intelscrape/skip--trace)**, or call it directly over the Apify API.

#### 🏆 Featured Bots by IntelScrape

- [Skip Trace Pro](https://apify.com/intelscrape/skip-trace-pro)
- [TruePeopleSearch Scraper](https://apify.com/intelscrape/truepeoplesearch-scraper)
- [TikTok Email Scraper](https://apify.com/intelscrape/tiktok-scraper)
- [Amazon Product Reviews Scraper](https://apify.com/intelscrape/amazon-product-review-scraper)
- [Website Contact Scraper](https://apify.com/intelscrape/contact-info-scraper)
- [Skip Trace MCP Server](https://apify.com/intelscrape/skip--trace)

⚡ Works with n8n, Make, Zapier, Google Sheets and the Apify API.

![price](https://img.shields.io/badge/price-%240.50%20per%201K%20posts-blue) ![billing](https://img.shields.io/badge/billing-pay%20per%20post-green) ![login](https://img.shields.io/badge/login-not%20required-brightgreen) ![network](https://img.shields.io/badge/network-fediverse-orange)

**Public Mastodon posts by hashtag, account or trending with engagement and author stats, plus hashtag usage trends.**

> **Honest coverage & billing:** Visibility depends on the chosen instance's federation. You pay only for results actually delivered, and a built-in cost guard stops the run at your max-charge limit.

🌍 Built for teams in the **US, China and Singapore**, and anyone who needs this data in a spreadsheet or pipeline.

⭐ Found it useful? Please leave a review; it helps others find it.

⚖️ **Lawful business use only.** Collect public data only, and comply with the source site's terms, copyright and data-protection laws (GDPR, CCPA, China PIPL, Singapore PDPA).

*Examples below are illustrative; names and values may be fictional or out of date.*

### What is Mastodon Scraper?

Developers, journalists, researchers and open-source communities moved a lot of their public conversation to Mastodon and the wider fediverse, and most social listening tools still ignore it. **Mastodon Scraper** reads the public API of any instance to export posts by hashtag, by account or from the trending list, with engagement counts, links, media and author stats, plus a seven-day usage history for each hashtag so you can see whether a topic is growing.

### What does it do?

- **Hashtag mode**: newest public posts for each hashtag as seen by the chosen instance
- **Account mode**: posts of any @user@instance, with or without replies
- **Trending mode**: the instance's trending posts right now
- **Post data**: text (clean), spoiler, language, replies, boosts, favourites, engagement total, hashtags, mentions, link card, media with alt text, boosted-by
- **Author data**: handle, name, followers, following, post count, bot flag, account age, bio
- **Hashtag stats (on by default)**: daily uses and accounts for the last 7 days with a rising/falling hint
- **Any instance**: mastodon.social, fosstodon.org, infosec.exchange and others

### Why choose us over cheaper scrapers?

- **Honest output**: limits are documented, missing data is labeled, never invented
- **Clean, consistent schema** ready for Excel, Sheets, BI tools or an LLM
- **No account risk**: no logins, no cookies, no API keys
- **Pay per result** with a built-in cost guard; no subscription, failed items are never charged
- **Fast and light**: no residential proxy, so runs finish in seconds and stay cheap
- **Maintained by IntelScrape** and fixed fast when the source changes

### Who is it for?

- **Brand and product mentions** in tech and open-source communities
- **Social listening** beyond X and Reddit
- **Journalism and research** on fediverse discourse
- **Developer relations**: track your project hashtag
- **Trend spotting** with daily hashtag usage
- **Datasets** for NLP research on public posts
- **Competitive intelligence**: follow competitor and founder accounts
- **Event tracking**: conference hashtags during and after the event

### How to use it

#### In Apify Console (no code)

1. Click **Try for free** / **Start**. The form is prefilled with a working example.
2. Change the inputs (see examples below).
3. Click **Start**, then export the results as **JSON, CSV, Excel, XML or HTML**, or open them in Google Sheets.
4. Optional: **Schedule** the actor to run hourly, daily or weekly.

#### Via API

```bash
curl -X POST "https://api.apify.com/v2/acts/intelscrape~mastodon-scraper/run-sync-get-dataset-items?token=YOUR_APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"mode": "hashtag", "hashtags": ["ai", "opensource"], "maxPostsPerTarget": 60}'
```

Or use the official [Apify JavaScript](https://docs.apify.com/api/client/js/) and [Python](https://docs.apify.com/api/client/python/) clients:

```python
from apify_client import ApifyClient
client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("intelscrape/mastodon-scraper").call(run_input={"mode": "hashtag", "hashtags": ["ai", "opensource"], "maxPostsPerTarget": 60})
for item in client.dataset(run["default_dataset_id"]).iterate_items():
    print(item)
```

#### With AI agents (MCP)

Add Apify's MCP server (`https://mcp.apify.com`) or the [IntelScrape MCP Server](https://apify.com/intelscrape/skip--trace) to Claude Desktop, Cursor, ChatGPT or any MCP client, then ask in plain language, e.g. *"Run intelscrape/mastodon-scraper with the default input and summarise the results."*

### Input examples

**Two hashtags with stats (default)**

```json
{
  "mode": "hashtag",
  "hashtags": ["ai", "opensource"],
  "maxPostsPerTarget": 60
}
```

**An account**

```json
{
  "mode": "account",
  "accounts": ["@Gargron@mastodon.social"],
  "maxPostsPerTarget": 200
}
```

**Trending on fosstodon**

```json
{
  "mode": "trending",
  "instance": "fosstodon.org"
}
```

### Output fields

| Field | Description |
|---|---|
| `id / url / target / createdAt / language` | Post identity |
| `text / spoiler / sensitive / isReply / boostedBy` | Content |
| `replies / boosts / favourites / engagement` | Engagement |
| `hashtags / mentions / linkCard / media` | Entities |
| `author.handle / name / followers / following / posts / bot / createdAt / bio` | Author |
| `type = hashtag-stats rows` | dailyHistory, uses7d, accounts7d, avgUsesPerDay, trend |

#### Sample output

```json
{
  "createdAt": "2026-10-22T01:34:53.919Z",
  "text": "New open-source model release ...",
  "boosts": 12,
  "favourites": 30,
  "replies": 4,
  "hashtags": ["ai", "opensource"],
  "author": { "handle": "@someone@mastodon.social", "followers": 2140 },
  "url": "https://mastodon.social/@someone/117481989335669528"
}
```

### Pricing (pay per event)

| Event | When it is charged | Price |
|---|---|---|
| **Actor start** | once per run | $0.005 |
| **Post** | per post row | $0.0005 |
| **Hashtag stats** | per hashtag usage row (on by default; turn off to skip) | $0.002 |

#### Cost examples

| Run | Cost |
|---|---|
| Default run: 120 posts + 2 stats rows | $0.069 |
| 10 hashtags × 500 posts | $2.545 |
| Daily trending export | $0.015 |

Platform usage is included in these prices. Set **Max charge per run** in the run options to cap spend; the actor stops cleanly when the limit is reached and keeps everything collected so far.

### Tips for best results

- Large instances (mastodon.social) federate the most posts; niche instances give niche views.
- Use language to cut noise for global hashtags.
- Schedule hashtag mode hourly with a small max for near-real-time monitoring.
- Hashtag stats are cheap trend signals even with a small post limit.

### FAQ

#### Does it see every post in the fediverse?

No. Each instance only sees posts that federated to it. Query several instances for wider coverage.

#### Can I search full text?

Full-text search of posts needs a login on most instances; hashtags and accounts do not.

#### Are private posts included?

No, only public posts.

#### Is it legal?

It uses the public API. Respect instance rules and user privacy when publishing results.

#### Do I need an account?

No.

#### How do I cover several instances?

Run the actor once per instance (or schedule several tasks with different instance values) and merge datasets; de-duplicate on url, because the same post can federate to many servers.

#### What do boosts and favourites mean?

A boost is a re-share to the booster's followers, like a repost; a favourite is a like. Both are counted as the instance last saw them, so counts on the origin server can be slightly higher.

#### Why is a hashtag empty?

No public posts with that tag reached the chosen instance recently.

### Honest limits

- Visibility depends on the chosen instance's federation.
- Full-text keyword search is not available without login.
- Some instances rate-limit; the actor retries politely.
- Edited posts show their latest version only.

### Related IntelScrape bots

- [Brand Mentions Monitor](https://apify.com/intelscrape/brand-mentions-monitor): mentions from news, HN & Bluesky
- [Bluesky Posts Scraper](https://apify.com/intelscrape/bluesky-posts-scraper): posts & profiles from Bluesky
- [Hacker News Scraper](https://apify.com/intelscrape/hacker-news-scraper): stories & comments by keyword
- [Reddit Posts Scraper](https://apify.com/intelscrape/reddit-posts-scraper): posts & comments by keyword
- [Google News Scraper](https://apify.com/intelscrape/google-news-scraper): headlines & summaries
- [Skip Trace MCP Server](https://apify.com/intelscrape/skip--trace): IntelScrape tools for AI agents

### Legal

This actor collects publicly available data only. You are responsible for using the results lawfully and in line with the source's terms and applicable privacy laws (GDPR, CCPA, PIPL, PDPA). Process personal data only with a legitimate purpose. IntelScrape is not affiliated with, endorsed by or sponsored by the data source; all trademarks belong to their owners.

# Actor input Schema

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

What to export.

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

Without # (hashtag mode).

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

@user@instance handles (account mode).

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

Server to query, e.g. mastodon.social, fosstodon.org, mstdn.social, infosec.exchange. Large instances see the most federated posts.

## `maxPostsPerTarget` (type: `integer`):

Newest first.

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

Keep reply posts.

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

ISO code, e.g. en, de, ja.

## `hashtagStats` (type: `boolean`):

Add a 7-day usage history row per hashtag (posts and accounts per day). Charged per hashtag.

## `proxyConfiguration` (type: `object`):

Not needed normally. The actor switches to Apify Proxy automatically if the source starts rate-limiting.

## Actor input object example

```json
{
  "mode": "hashtag",
  "hashtags": [
    "ai",
    "opensource"
  ],
  "accounts": [
    "@Gargron@mastodon.social"
  ],
  "instance": "mastodon.social",
  "maxPostsPerTarget": 60,
  "includeReplies": false,
  "language": "",
  "hashtagStats": true,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `results` (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": [
        "ai",
        "opensource"
    ],
    "accounts": [
        "@Gargron@mastodon.social"
    ],
    "hashtagStats": true
};

// Run the Actor and wait for it to finish
const run = await client.actor("intelscrape/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 = {
    "hashtags": [
        "ai",
        "opensource",
    ],
    "accounts": ["@Gargron@mastodon.social"],
    "hashtagStats": True,
}

# Run the Actor and wait for it to finish
run = client.actor("intelscrape/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 '{
  "hashtags": [
    "ai",
    "opensource"
  ],
  "accounts": [
    "@Gargron@mastodon.social"
  ],
  "hashtagStats": true
}' |
apify call intelscrape/mastodon-scraper --silent --output-dataset

```

## MCP server setup

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