Skip to content

Import from Mastodon

  1. Create an access token in Mastodon preferences.
  2. Set MASTODON_TOKEN and MASTODON_INSTANCE in your environment.
  3. Run otso import mastodon --since 2024-01-01.

Download your account archive, unzip, and run:

Terminal window
otso import mastodon --archive ~/Downloads/mastodon-export

otso import mastodon is idempotent, so you can run it regularly to keep your site and local archive up to date. Execute it on demand or deploy it to a cron or serverless worker to poll Mastodon on a schedule and sync the results back to your local environment.

Use otso run to deploy the import on a timer, for example every 15 minutes on Vercel:

Terminal window
otso run --every 15m --on vercel import mastodon --include likes,replies
  • Toots → note
  • Replies → reply with inReplyTo URL.
  • Boosts → repost
  • Favorites → like

Media attachments are downloaded and referenced as media entries.