Mastodon Scraper avatar

Mastodon Scraper

Pricing

Pay per usage

Go to Apify Store
Mastodon Scraper

Mastodon Scraper

Scrape posts from any Mastodon instance. Extract toots, profiles, trending posts, and search results. Export to JSON, CSV, Excel.

Pricing

Pay per usage

Rating

0.0

(0)

Developer

Glass Ventures

Glass Ventures

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

2 days ago

Last modified

Categories

Share

Scrape posts from any Mastodon instance. Extract toots, profiles, trending posts, and search results with full metadata.

What does Mastodon Scraper do?

Mastodon Scraper extracts posts (toots) from any Mastodon-compatible instance using the standard Mastodon REST API. It works with mastodon.social, fosstodon.org, hachyderm.io, and any other Mastodon or Mastodon-compatible server.

The actor can scrape posts from specific user profiles, search for posts by keyword, fetch the public timeline, or collect trending posts. All data is returned in a structured format with full metadata including engagement counts, media attachments, and hashtags.

Whether you're doing social media research, tracking conversations about specific topics across the fediverse, or analyzing engagement patterns, this actor provides the data you need without requiring any API keys or authentication.

Use Cases

  • Social media researchers -- Monitor conversations and trends across the fediverse
  • Data analysts -- Analyze engagement patterns, posting frequency, and content trends on Mastodon
  • Journalists -- Track public discourse and trending topics on decentralized social media
  • Developers -- Collect Mastodon data for building dashboards, bots, or analytics tools
  • Marketing teams -- Monitor brand mentions and sentiment across Mastodon instances

Features

  • Scrape posts from any Mastodon-compatible instance
  • Extract user profile posts by URL
  • Search for posts by keyword
  • Fetch public timeline and trending posts
  • Full pagination support for large datasets
  • Automatic deduplication of posts
  • Proxy support with automatic rotation
  • Handles pagination and large datasets automatically
  • Exports to JSON, CSV, Excel, or connect via API

How much will it cost?

ResultsEstimated Cost
100~$0.01
1,000~$0.05
10,000~$0.25
Cost ComponentPer 1,000 Results
Platform compute~$0.03
Proxy (datacenter)~$0.02
Total~$0.05

Mastodon has a public REST API, so scraping is very lightweight and cost-effective. No browser rendering is needed.

How to use

  1. Go to the Mastodon Scraper page on Apify Store
  2. Click "Start" or "Try for free"
  3. Enter Mastodon profile URLs (e.g., https://mastodon.social/@Mastodon) or search terms
  4. Optionally change the target instance (default: mastodon.social)
  5. Set the maximum number of items
  6. Click "Start" and wait for the results

Input parameters

ParameterTypeDescriptionDefault
startUrlsarrayMastodon profile URLs to scrape-
searchTermsarraySearch queries for finding posts-
instancestringDefault Mastodon instance for search/trendingmastodon.social
scrapePublicTimelinebooleanScrape the public timelinefalse
scrapeTrendingbooleanScrape trending postsfalse
maxItemsnumberMax posts to return100
maxConcurrencynumberParallel request limit10
proxyConfigobjectProxy settingsApify Proxy

Output

The actor produces a dataset with the following fields:

{
"url": "https://mastodon.social/@Mastodon/123456789",
"content": "Welcome to Mastodon! This is a decentralized social network.",
"author": "Mastodon",
"handle": "@Mastodon@mastodon.social",
"instance": "mastodon.social",
"favouritesCount": 42,
"reblogsCount": 15,
"repliesCount": 3,
"createdAt": "2024-01-15T10:30:00.000Z",
"mediaAttachments": ["https://media.mastodon.social/image.jpg"],
"tags": ["mastodon", "fediverse"],
"language": "en",
"scrapedAt": "2024-01-16T08:00:00.000Z"
}
FieldTypeDescription
urlstringPost URL
contentstringPost text content (HTML stripped)
authorstringDisplay name of the author
handlestringFull handle (e.g., @user@instance)
instancestringMastodon instance domain
favouritesCountnumberNumber of favourites/likes
reblogsCountnumberNumber of reblogs/boosts
repliesCountnumberNumber of replies
createdAtstringPost creation timestamp (ISO 8601)
mediaAttachmentsarrayMedia attachment URLs
tagsarrayHashtags used in the post
languagestringPost language code
scrapedAtstringScrape timestamp (ISO 8601)

Integrations

Connect Mastodon Scraper with other tools:

  • Apify API -- REST API for programmatic access
  • Webhooks -- get notified when a run finishes
  • Zapier / Make -- connect to 5,000+ apps
  • Google Sheets -- export directly to spreadsheets

API Example (Node.js)

import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: 'YOUR_TOKEN' });
const run = await client.actor('YOUR_USERNAME/mastodon-scraper').call({
startUrls: [{ url: 'https://mastodon.social/@Mastodon' }],
maxItems: 100,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();

API Example (Python)

from apify_client import ApifyClient
client = ApifyClient('YOUR_TOKEN')
run = client.actor('YOUR_USERNAME/mastodon-scraper').call(run_input={
'startUrls': [{'url': 'https://mastodon.social/@Mastodon'}],
'maxItems': 100,
})
items = client.dataset(run['defaultDatasetId']).list_items().items

API Example (cURL)

curl "https://api.apify.com/v2/acts/YOUR_USERNAME~mastodon-scraper/runs" \
-X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_TOKEN" \
-d '{"startUrls": [{"url": "https://mastodon.social/@Mastodon"}], "maxItems": 100}'

Tips and tricks

  • Start with a small maxItems (10-20) to test before running large scrapes
  • You can scrape any Mastodon-compatible instance, not just mastodon.social
  • Combine profile scraping with search terms to get comprehensive coverage
  • The public timeline and trending endpoints give you a quick snapshot of activity on any instance
  • No authentication or API keys are needed -- Mastodon's public API is open

FAQ

Q: Does this actor require login credentials? A: No. Mastodon has a public REST API that does not require authentication for reading public posts.

Q: How fast is the scraping? A: Very fast. Since it uses the REST API directly, it can scrape 500-1,000+ posts per minute depending on the instance.

Q: Can I scrape any Mastodon instance? A: Yes, any instance running Mastodon or a compatible server (Pleroma, Akkoma, etc.) that exposes the standard Mastodon API.

Q: What should I do if I get rate limited? A: Lower the maxConcurrency setting and enable proxy rotation. Most Mastodon instances have generous rate limits (300 requests per 5 minutes).

Q: Can I scrape private/followers-only posts? A: No. This actor only accesses publicly available posts through the public API.

Web scraping of publicly available data is generally legal based on precedents like the LinkedIn v. HiQ Labs case. This actor only accesses publicly available data through Mastodon's official public REST API. Mastodon instances explicitly provide these API endpoints for public access. Always review and respect individual instance rules and Terms of Service. For more information, see Apify's blog on web scraping legality.

Limitations

  • Only public posts are accessible (no private/followers-only content)
  • Search functionality depends on the instance having search enabled
  • Some smaller instances may have stricter rate limits
  • Trending posts endpoint may not be available on all instances

Changelog

  • v0.1 (2026-04-23) -- Initial release