How to Make a Mastodon Bot: The Definitive Guide

Learn how to make creative Mastodon bots with Botwiki.

Before you start making bots, consider reading these essays and articles. Also worth browsing: resources for cleaning up your bot's language.

Welcome to the second in the series of Botwiki Definitive Guides. If you’d like to contribute to this guide, or have any questions, stop by the Botmakers community, or, if you prefer, reach out to me on Mastodon or via email.

What kind of a bot should I make?

As I mentioned in my previous guide, your main goal should be making a bot that doesn’t annoy people. Avoid interacting with random strangers, don’t harass anyone, don’t punch down.

Be creative, be nice, entertain, or educate, there are very few limits to what your bot can do. Feel free to browse Botwiki for inspiration, or join the Botmakers community to join in with someone looking for help.

How do I make a Mastodon bot? Where should I host it?

Botwiki is full of tutorials and resources, and also covers some of the more popular hosting services for botmakers.

For an easy start, check out Cheap Bots, Toot Sweet!, or the fediverse-bot and tracery-mastodon-bot projects on Glitch.

How often should my bot post?

There is no right answer to this question and really just depends on what kind of a bot you’re making. You can always ask your followers to let you know what they prefer, or, as one botmaker decided to do, you can even make more than one version of your bot. Also check out the definitive Twitter bot guide for some thoughts on this.

Keep in mind that the mastodon.social has a rate limit of 300 requests per 5 minute window for GET requests and 100 for POST requests. Other instances could adjust these numbers.

Yes, but the type of content you can search for can be limited. For example, on mastodon.social instance you can only search local accounts and hashtags, but you can’t search the individual toots.

Do I need to attribute content posted by my bot?

Absolutely!

How do I get the RSS feed of my bot?

To get the RSS feed of your bot’s output, add .rss to your bot’s URL, so for example:

https://botsin.space/@pollockdotexe

will become

https://botsin.space/@pollockdotexe.rss

Use the same email (sort of) for multiple accounts

One neat trick you can use when registering for a new account is adding +SOMETHING to your email address, for example, stefan+mynewbot@botwiki.org. This will let you use the same email address for multiple accounts — and this works for many other websites.

Can I make a bot that posts polls?

Yes! Check out the poll options you can pass to the Mastodon API, and the /polls endpoint which lets you retrieve information and vote on a poll.

Attributions and thanks

Stefan

Creator of Botwiki and Botmakers, Botwiki editor, and Botmakers community manager.

Enjoyed the tutorial?

Consider supporting Botwiki!

Latest from the blog

Poll: Sharing your bot's source code
Poll: Sharing your bot's source code

Sharing is caring, and many botmakers do care.

Subscribe to our weekly digest
Subscribe to our weekly digest

Stay on top of the latest content with our weekly digest!

New Twitter list: bots that help you keep track of the day of the week
New Twitter list: bots that help you keep track of the day of the week

Featuring fan favorites @thursaconcept and @CraigWeekend.

Visit the blog

.