How to Scrape Mastodon Posts & Hashtags at Scale in 2026
Pull public Mastodon posts by hashtag, timeline or account: content, engagement stats, media URLs and account data. No API key, no login, any instance.
Scraping X or Reddit means fighting guest-token expiry, rate walls, and login gates. Mastodon is the opposite problem: the API is intentionally open — the developers built it for unauthenticated public access — but it’s decentralized across thousands of independent instances, each with its own hostname, and the raw statuses come back as HTML you have to strip. If you want a few thousand posts on a hashtag for trend analysis, or an account’s full public history, you still have to handle max_id cursor pagination and normalize the payload. This guide covers what Mastodon’s public API exposes, how the three scrape modes map onto it, and how to pull clean post records at scale.
What’s worth extracting
Each post (“status” in Mastodon terms) resolves to a flat record of 15 fields, grouped by what you’ll analyze:
- Post identity —
id(unique on the instance),url(direct link to the post), andinstance(the server it was scraped from). - Content —
content(post text, HTML stripped to plain text),createdAt(ISO 8601), andlanguage(two-letter code, e.g.en,de,fr). - Engagement —
favouritesCount,reblogsCount(boosts), andrepliesCount. - Author —
username(with instance domain if remote),displayName,followers(author’s follower count), andaccountUrl(profile link). - Attachments & tags —
tags(comma-separated hashtags used) andmediaUrls(comma-separated URLs of attached images/videos).
The followers field per post is worth noting: it lets you rank posts by author influence directly, without a separate account lookup for every author.
How the source actually works
The scraper connects directly to the open Mastodon REST API (v1/v2) exposed by any public instance — mastodon.social, fosstodon.org, infosec.exchange, hachyderm.io, or any ActivityPub server running Mastodon-compatible software (including Pleroma, Akkoma, and Hometown). You set an instance hostname and a mode, and the actor targets one of three public endpoints:
hashtag— the hashtag timeline (/api/v1/timelines/tag/{hashtag}).publicTimeline— the public/federated timeline (/api/v1/timelines/public).accountStatuses— an individual account’s statuses (/api/v1/accounts/{id}/statuses).
The most common run — collecting posts on a hashtag from the highest-volume instance — looks like this:
{
"mode": "hashtag",
"hashtag": "technology",
"instance": "mastodon.social",
"maxResults": 500
}
The hashtag value goes in without the leading #. To monitor a community rather than a topic, switch to the public timeline of a niche instance:
{
"mode": "publicTimeline",
"instance": "fosstodon.org",
"maxResults": 300
}
And to pull one account’s public history, use accountStatuses with the username (no @ prefix, no instance suffix):
{
"mode": "accountStatuses",
"account": "Gargron",
"instance": "mastodon.social",
"maxResults": 200
}
Under the hood, pagination uses the max_id cursor parameter — the actor walks backward through the timeline until it reaches your maxResults. It also strips each post’s HTML to plain text, enriches it with account-level data (username, display name, follower count), and collects media URLs and hashtags into flat comma-separated fields.
That HTML-stripping is more than cosmetic. Mastodon serves content as HTML — paragraphs, links, and mention markup all wrapped in tags — so a raw pull leaves you with markup you’d have to clean before any text analysis, embedding, or sentiment pass. Getting plain text back means the content field drops straight into an LLM pipeline or a spreadsheet without a preprocessing step. Runtime scales with the batch size: a 200-post hashtag run typically finishes in under a minute, and a 1,000-post run in roughly 2–4 minutes depending on how fast the target instance responds.
▶ Open the Mastodon Scraper on Apify — one run turns a hashtag, timeline, or account into hundreds or thousands of clean post rows with engagement stats, media URLs and author data. No key, no login, any instance. Export to CSV, JSON or Excel.
The access reality
Mastodon’s public API is open by design, so the friction is decentralization and pagination depth, not anti-bot walls:
- Completely keyless. The public timeline and hashtag endpoints require no authentication token, no account, no OAuth. You only need an Apify account to run the actor.
- You pick the instance. There’s no single “Mastodon” — data is spread across thousands of servers.
mastodon.socialhas the highest post volume; topic-focused instances (infosec.exchange,fosstodon.org) give more concentrated, on-topic results. Set theinstancefield per run. - Up to 10,000 posts per run. The API paginates hashtag and timeline results in batches of ~40, and the actor walks the
max_idcursor automatically up to yourmaxResults(capped at 10,000). Very active hashtags can yield thousands in minutes. - Public surfaces only. The actor reads only public endpoints. Followers-only posts, private accounts, and direct messages are never returned — by design, not limitation.
- Proxy is rarely needed. Most instances allow direct access, so
proxyConfigurationdefaults to disabled. On large runs that hit an instance’s rate limit, enabling Apify proxy helps.
Example output
One hashtag-mode record:
{
"id": "113820745678901234",
"url": "https://mastodon.social/@researcher/113820745678901234",
"content": "New paper on federated social networks and decentralization patterns. The #technology landscape is shifting.",
"createdAt": "2026-07-06T09:15:44.000Z",
"language": "en",
"favouritesCount": 82,
"reblogsCount": 31,
"repliesCount": 14,
"username": "[email protected]",
"displayName": "Dr. Alex Research",
"followers": 4210,
"accountUrl": "https://mastodon.social/@researcher",
"tags": "technology, research, fediverse",
"mediaUrls": "",
"instance": "mastodon.social"
}
Typical use cases
- Trend tracking — pull thousands of posts on a topic or event hashtag (
#ai,#opendata) in minutes for trend analysis or LLM dataset building. - Community monitoring — scrape the public timeline of a specific instance to understand that community’s interests, activity volume, and content mix.
- Account analysis — pull all posts from a public account (journalist, researcher, developer) to study posting patterns, reach, and engagement history.
- Social listening — export Mastodon content to Google Sheets or CSV for listening reports without manual copy-paste.
- Federated aggregation — scrape the same hashtag across multiple instances and merge the results into a single federated feed.
- Sentiment & brand monitoring — watch what communities say about a product, project, or public figure across instances.
Because every post row carries the author’s followers count, you can also build lightweight influence maps without a second pass: pull accountStatuses for a set of accounts active on a topic, rank by reach and engagement, and see who actually drives a conversation on the Fediverse rather than just participating in it.
Build it yourself vs. use the actor
Mastodon’s API is open and documented, so a first fetch against one instance is easy. The maintenance is in the details: max_id cursor pagination, stripping HTML from every post to plain text, joining account-level data onto each status, flattening media and tags into comma-separated fields, and handling per-instance rate limits on large runs. And because it’s decentralized, you’d rebuild that against whatever instance each job needs. It’s a small client you’d own.
The actor is that client, packaged, with instance-switching built in via a single field. Pricing is pay-per-result — a small fraction of a cent per post plus a negligible start fee. For a 500-post hashtag pull that’s a rounding-error cost, and the HTML stripping and cursor pagination are solved.
Common pitfalls
Specific gotchas with Mastodon data:
- Empty fields are normal.
languagecan be null if not detected;mediaUrlsis empty for text-only posts;tagsis empty if the post used no hashtags. These come back as empty strings, not errors. - Instance format is strict. The
instancefield takes a bare hostname —mastodon.social, nothttps://mastodon.social. A wrong format or an offline instance returns nothing. - Hashtag phrasing varies by instance. A broad tag like
techcan return fewer posts thantechnologyon some instances. Test both if a tag comes back thin. - One hashtag per run. There’s no multi-hashtag input — run the actor multiple times with different hashtags, or trigger parallel runs via the Apify API, then merge datasets.
- Instance choice shapes the data. The same hashtag on
mastodon.socialvsinfosec.exchangesurfaces different communities. Pick the instance to match the audience you’re studying, and run cross-instance comparisons deliberately. - Respect privacy law and instance rules. You’re reading public data, but instances have their own terms and GDPR/CCPA still apply. This is for research and listening — not surveillance, doxxing, or building tools that violate community standards.
Wrapping up
Mastodon is one of the few social platforms that genuinely wants to be read programmatically — but its decentralization and HTML payloads still mean per-instance handling and cursor pagination. If you need a one-off pull, the API is open and worth scripting. If you need refreshed Fediverse data on a schedule — tracking a hashtag over time, monitoring a community, comparing instances — let the actor own the instance-switching, HTML stripping, and max_id pagination and hand you clean rows.
▶ Run the Mastodon Scraper on Apify — reads any public Mastodon instance’s REST API directly across hashtags, timelines and accounts: post content, engagement stats, media URLs and author data, up to 10,000 posts per run. No API key, no login. Start on Apify’s free monthly credit.
Related guides
How to Extract Social Profiles from Domains in Bulk (2026)
Find Twitter/X, LinkedIn, Instagram, YouTube, and 15 more social profiles across thousands of domains — one row per profile with handle and source, no API key.
How to Scrape IMDb Movies, TV Ratings & Reviews in 2026
Search IMDb by genre, year, rating and votes, then pull title details, cast, episodes and user reviews via IMDb's own GraphQL — no API key, no browser.
How to Scrape MyAnimeList Anime & Manga Ratings 2026
Pull MyAnimeList anime and manga data — ratings, rankings, seasonal charts, characters and recommendations — via the free Jikan API. No key, no OAuth needed.