Ein Python CLI-Tool zur Analyse von Mastodon-Instanzen. Erstellt detaillierte Statistiken über Accounts, Aktivitäten und Vernetzung. Funktioniert am besten mit ADMIN-Token
- Instanz-Informationen: Name, Version, Nutzer-, Post- und Föderations-Statistiken
- Aktivitätsanalyse: Wöchentliche Statistiken über Logins, Posts und Registrierungen
- Account-Statistiken:
- Lokale vs. Remote Accounts
- Aktivitätsanalyse (30/90 Tage)
- Post-Verteilung pro Account
- Top 10 aktivste Poster
- Timeline-Analyse: Medien, Content Warnings, Replies, Boosts (optional)
- Export-Formate: Text und JSON
- Python 3.7 oder höher
- pip (Python Package Manager)
pip install requests# Repository klonen
git clone https://github.com/sozialwelten/MastodonInstanceAnalyzer.git
cd mastodon-instance-analyzer
# Script ausführbar machen (Linux/Mac)
chmod +x MastodonInstanceAnalyzer.pyGrundlegende Instanz-Informationen abrufen:
python MastodonInstanceAnalyzer.py https://ifwo.euFür detaillierte Account-Statistiken benötigen Sie einen Admin-Token:
python MastodonInstanceAnalyzer.py https://ihre-instanz.de --token IHR_ADMIN_TOKENWenn der Admin-Token nicht jedes Mal aufs neue eingegeben werden soll, in ~/.bashrc folgende Zeile hinzufügen:
export MASTODON_TOKEN_ADMIN="IHR_TOKEN"python MastodonInstanceAnalyzer.py https://ifwo.eu --token IHR_TOKEN --output report.txtpython MastodonInstanceAnalyzer.py https://ifwo.eu --token IHR_TOKEN --format json > report.jsonFür vollständige Account-Statistiken benötigen Sie einen Admin-Token mit entsprechenden Berechtigungen:
- In Ihrer Mastodon-Instanz einloggen
- Einstellungen → Entwicklung → Neue Anwendung
- Anwendungsname: z.B. "Instance Analyzer"
- Erforderliche Berechtigungen auswählen:
admin:read:accounts(für Account-Statistiken)read:statuses(optional, für Timeline-Analyse)
- Absenden klicken
- Token kopieren und sicher aufbewahren
======================================================================
MASTODON INSTANZ ANALYSE: https://ifwo.eu
======================================================================
📊 INSTANZ-INFORMATIONEN
----------------------------------------------------------------------
Name: Ihre Mastodon Instanz
Version: 4.5.0
Beschreibung: Eine freundliche Community...
Nutzer: 49
Posts: 20,690
Domains: 27,612
📈 AKTIVITÄT (12 WOCHEN)
----------------------------------------------------------------------
2025-KW44 (04.11.): 4 Logins, 2 Posts, 0 Registrierungen
2025-KW43 (28.10.): 15 Logins, 77 Posts, 0 Registrierungen
2025-KW42 (21.10.): 15 Logins, 86 Posts, 0 Registrierungen
👥 ACCOUNT-STATISTIKEN
----------------------------------------------------------------------
Gesamt: 49
Lokal: 49
Remote: 0
Aktiv (30 Tage): 13
Aktiv (90 Tage): 18
Inaktiv: 31
Mit Posts: 37
Ohne Posts: 12
📝 POSTS PRO ACCOUNT
----------------------------------------------------------------------
0 Posts: 12 Accounts
1-10 Posts: 8 Accounts
11-50 Posts: 9 Accounts
51-100 Posts: 6 Accounts
101-500 Posts: 9 Accounts
500+ Posts: 5 Accounts
🏆 TOP 10 POSTER
----------------------------------------------------------------------
1. @username1 1,234 Posts (zuletzt: 2025-11-05)
2. @username2 987 Posts (zuletzt: 2025-11-03)
...
- Nutzer: Gesamtzahl aller registrierten Accounts (lokal + remote)
- Posts: Gesamtzahl aller Posts auf der Instanz
- Domains: Anzahl föderierter Instanzen (zeigt Vernetzung im Fediverse)
- Logins: Anzahl der Anmeldungen in der jeweiligen Woche
- Posts: Neu erstellte Posts in der Woche
- Registrierungen: Neue Account-Registrierungen
- Lokal: Auf Ihrer Instanz registrierte Accounts
- Remote: Von anderen Instanzen bekannte Accounts
- Aktiv (30/90 Tage): Accounts mit mindestens einem Post im Zeitraum
- Inaktiv: Accounts ohne Posts im letzten Quartal
usage: MastodonInstanceAnalyzer.py [-h] [--token TOKEN] [--format {text,json}]
[--output OUTPUT] instance
positional arguments:
instance URL der Mastodon-Instanz (z.B. https://mastodon.social)
optional arguments:
-h, --help Zeigt diese Hilfe an
--token TOKEN, -t TOKEN
Access Token (optional, empfohlen für Admin-Features)
--format {text,json}, -f {text,json}
Output-Format (default: text)
--output OUTPUT, -o OUTPUT
Ausgabe-Datei (optional)
- Das Tool greift nur lesend auf die Mastodon-API zu
- Keine Daten werden an Dritte übermittelt
- Admin-Token werden nicht im Script gespeichert
- Empfehlung: Token nach Verwendung widerrufen oder mit minimalen Berechtigungen erstellen
GNU General Public License v3.0
Michael Karbacher