Description
An implementation of calls designed to collect and organize Mastodon data via its Application Program Interfaces (API), which can be found at the following URL: https://docs.joinmastodon.org/.
Use Cases
This package was used in Wähner et al. (2004) for collecting Mastodon data. Although not using this package, the data from the Mastodon API has been used in various social science publications on platform migration (e.g. La Cava et al. 2023) and online network formation (e.g. La Cava, et al. 2021).
Input Data
This method does not require any input data.
Output Data
The output from this software is a standard tibble of data collected from the Mastodon API.
Hardware Requirements
This package runs on any hardware that can run R.
Environment Setup
With R installed:
install.packages("rtoot")
How to Use
In general, one should first conduct the authentication to obtain an access token. This can be done with the provided function auth_setup(). For more information, please refer to the documentation on authentication. However, it is also possible to use some of functions with authentication. For example, it is possible to obtain the public timeline of a Mastodon instance, e.g. sciences.social.
library(rtoot)
get_timeline_public(instance = "sciences.social")
# A tibble: 20 × 29
id uri created_at content visibility sensitive spoiler_text
<chr> <chr> <dttm> <chr> <chr> <lgl> <chr>
1 11513508… http… 2025-09-02 14:05:37 "<p>Th… public FALSE ""
2 11513508… http… 2025-09-02 14:05:36 "<p>Vö… public FALSE ""
3 11513508… http… 2025-09-02 13:48:57 "<p>St… public FALSE ""
4 11513508… http… 2025-09-02 14:05:01 "<p>By… public FALSE ""
5 11513508… http… 2025-09-02 14:05:23 "<p>Fo… public FALSE ""
6 11513508… http… 2025-09-02 14:05:13 "<p>5 … public FALSE ""
7 11513508… http… 2025-09-02 14:05:07 "<p><a… public FALSE ""
8 11513508… http… 2025-09-02 14:05:05 "<p><a… public FALSE ""
9 11513508… http… 2025-09-02 13:45:30 "<p>In… public FALSE ""
10 11513508… http… 2025-09-02 14:05:23 "" public FALSE ""
11 11513508… http… 2025-09-02 14:04:36 "<p>Lu… public FALSE ""
12 11513508… http… 2025-09-02 13:12:30 "<p>Te… public FALSE ""
13 11513508… http… 2025-09-02 14:05:09 "<p>Th… public FALSE ""
14 11513508… http… 2025-09-02 14:05:02 "<p>Br… public FALSE ""
15 11513508… http… 2025-09-02 14:05:13 "<p>I … public FALSE ""
16 11513508… http… 2025-09-02 14:05:12 "<p>EP… public FALSE ""
17 11513508… http… 2025-09-02 14:05:06 "<p>Lu… public FALSE ""
18 11513508… http… 2025-09-02 14:05:03 "<p>Ve… public FALSE ""
19 11513508… http… 2025-09-02 14:05:01 "<p>Ei… public FALSE ""
20 11513508… http… 2025-09-02 14:05:08 "<p>To… public FALSE ""
# ℹ 22 more variables: reblogs_count <int>, favourites_count <int>,
# replies_count <int>, url <chr>, in_reply_to_id <chr>,
# in_reply_to_account_id <chr>, language <chr>, text <lgl>,
# application <I<list>>, poll <I<list>>, card <I<list>>, account <list>,
# reblog <I<list>>, media_attachments <I<list>>, mentions <I<list>>,
# tags <I<list>>, emojis <I<list>>, favourited <lgl>, reblogged <lgl>,
# muted <lgl>, bookmarked <lgl>, pinned <lgl>
Other functions, e.g. get_timeline_hashtag(), get_account_statuses() require authentication. Please refer to the “Introduction to rtoot” for a comprehensive introduction of the package.
Technical Details
See the official CRAN repository for further information about technical details.
References
- Schoch, D., & Chan, C. H. (2023). Software presentation: Rtoot: Collecting and analyzing Mastodon data. Mobile Media & Communication, 11(3), 575-578. https://doi.org/10.1177/20501579231176678
- Wähner, M., Deubel, A., Breuer, J., & Weller, K. “Don’t research us”—How Mastodon instance rules connect to research ethics. Publizistik 69, 357–380 (2024). https://doi.org/10.1007/s11616-024-00855-6
Contact Details
Maintainer: David Schoch david@schochastics.net Issue Tracker: https://github.com/gesistsa/rtoot/issues