How to Make a Twitter Bot: The Definitive Guide

Learn how to make creative Twitter bots.

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

So you want to make a friendly/useful/artistic Twitter bot and probably have a bunch of questions, like How often should my bot tweet? or Why am I getting this weird error message? and How do I even make a Twitter bot?

Hopefully this ambitiously titled guide will answer your questions — and you are always free to ask for more help in the Botmakers community.

Note on needing a phone number

One tricky part of making a bot for Twitter is that if you want your bot to be able to actually post on Twitter, rather than just read from it, you will need to add a phone number to your account.

There is a few ways to solve this:

What kind of a bot should I make?

Let’s first talk about the kinds of bots you absolutely should not make. Start by reviewing Twitter’s Rules and best practices and their Automation rules. There are also API rate limits, but we will get into that shortly.

The bottom line is this: don’t let your bot annoy people. Try to avoid interacting with people who don’t follow your bot or knowingly initiate the conversation either through a tweet with your bot’s handle, or a direct message.

There certainly are clever examples of bots who do interact with random Twitter users who didn’t explicitly opt-in, but this is a bit of a gray area and you should use your best judgement here.

Also, just because some information is public, it doesn’t mean it deserves exposure.

And it hopefully doesn’t even need to be said that you shouldn’t make bots that harass people, post spam, or do any other malicious activity. Remember, bots should always punch up, never punch down. And people don’t seem to care too much about “ebooks” accounts.

As for what your bot should do, well, here are a few tips:

For even more inspiration, check out these essays and articles.

Making a good bot is not always a straightforward process, with steps to go through. Sometimes the decisions you make affect each other, for example, you can start with an idea and then decide what language and hosting platform you’ll use.

But you can also first look at the various platforms you can use to host your bot and play with their strengths and limitations. More on that in an upcoming section.

How do I make a Twitter bot?

With most of the non-technical questions out of the way, it’s time to actually build your Twitter bot.

Botwiki has plenty of tutorials and there are many open-source Twitter bots and Twitter bot project templates on Glitch that you can use.

Just find one that’s close to your own bot idea and take it from there.

Do I need to set up a separate account for testing my bot?

This is up entirely up to you, but here’s how some people approach it.

Do I need to disclose if an account is a bot?

Yes, as per Twitter’s Developer Policy.

If you’re operating an API-based bot account you must clearly indicate what the account is and who is responsible for it.

How can I apply for the #GoodBots label?

You can’t quite yet, but hopefully soon! (Learn more here.)

How often should my Twitter bot tweet?

Alright, you might have a rough idea what your bot is going to be posting about now, great! How often should it post though?

As I mentioned earlier, Twitter has limits on how often you can call their API, so you should keep those in mind.

Other than that, it’s all about striking the right balance. If your bot tweets every time a certain event happens, it’s okay if your bot posts more frequently, as long as it stays under the API rate limit.

But also consider that some people don’t want their home timeline cluttered with just one account, so for bots that don’t work with real-time data, spacing the tweets out makes a lot of sense. As I said above, one good rule to follow is to make sure your bot doesn’t annoy people.

There are bots that post every hour, once or twice a day, or even just once throughout the whole year.

Here are some thoughts from a member of Botmakers:

Hard question. I look at it as a logarithmic-scale line starting at once a minute and ending somewhere around once a week or month.

There is a hard upper bound of 25 tweets per 15 minutes per account.

There are multiple approaches you can take to figured this out, and they’re mostly situational:

The easiest approach is to have your bot post as often as it can, like if you’re running @congressedits, you want to catch all edits.

If you have too much information for this and need to attenuate the flow, or if your corpus is fixed or precomputed, then it comes down to questions like, do I want to follow this bot myself? How often would I like to hear from it if so? Is there prior art that I am mimicking? If it’s a fixed corpus, how long should it run before it ends? How often would others like to hear from it? should it be annoying/how much so?

If you’re unsure, post every 30 or 60 minutes, tweak it later if you don’t like it.

— @air_hadoken

Do I need to attribute content tweeted by my bot?


Am I responsible for everything that my bot does online?

You bet.

Can I make a bot that tracks keywords or hashtags?

From Twitter’s Automation rules:

Automated Retweets: Provided you comply with all other rules, you may Retweet or Quote Tweet in an automated manner for entertainment, informational, or novelty purposes. Automated Retweets often lead to negative user experiences, and bulk, aggressive, or spammy Retweeting is a violation of the Twitter Rules.

As explained above, there are some gray areas when it comes to automating certain actions on Twitter, including automated retweets.

One way around getting your retweet bot suspended is to make your bot private. This way you can follow the topics you’re interested in without bothering anyone since notifications from private accounts don’t show up to people your bot is not following.

The biggest drawback here is that it will be harder for others to discover your bot, and as of February 2017, there is no way to approve follower requests for a protected account via the Twitter API, so you will have to handle follower requests manually.

Can I make a bot that posts Twitter polls?

Not yet, but soon! Yes, with v2 of the Twitter API!

Check out this collection of poll-posting bots for inspiration.

Where should I host my bot?

There is a number of platforms you can use depending on how much you’re willing to spend (no worries, free options exist) and how comfortable you are dealing with web servers.

Also, when coming up with ideas for a new bot, it might actually be helpful to start here. For example, Cheap Bots, Done Quick! is a site that lets you make bots using Tracery and hosts them for free. It doesn’t require advanced programming skills, but is flexible enough so that you can get really creative.

Glitch gives you more freedom while taking care of most of the technical challenges for you (and comes with some cool libraries pre-installed). Note that for scheduled bots it requires a paid subscription.

For a comprehensive list of available hosting platforms, see the Hosting platforms page on Botwiki.

How can I use the same developer account for all my bots?

Check out the Tools section on the Resources for Twitterbots page. There’s also a few helpful tutorials:

Why is my bot not working?

Twitter will send you an error message that should help you understand why your bot stopped working.

For example, if you’re using the Twit library, here’s how you can see the error message:'statuses/update', { status: 'hello world!' }, function(err, data, response) {
  if (err){

It’s possible that your bot tweets or reads the data from Twitter too often, then you just need to adjust the frequency. It’s also possible that your bot was suspended, in which case you will also get an email notification and instructions on what to do next.

If you’re not getting any error messages from Twitter, and the bot doesn’t seem to be suspended, the problem might be with your code. It’s perfectly fine to ask for help, in fact, that’s why the Botmakers community exists. Glitch even has an “ask for help” feature built right into it.

How do I make my bot accessible to everyone?

Check out this handy guide on this topic!

My bot doesn’t have enough followers

Share your bot with @botwikidotorg and the Botmakers community! Try adding relevant hashtags to your bot’s tweets every now and then.

But at the end of the day, learn to enjoy the process and do it for the fun. Getting a ton of followers shouldn’t be the goal and it’s often about luck!

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, This will let you use the same email address for multiple accounts — and this works for many websites, not just Twitter.

Stop the Twitter email spam

Twitter doesn’t really differentiate between “regular” user accounts and bots. Bots are really just automated user accounts — in fact, you could easily add some automation to your own account while you’re still using it as a human.

One of the problems with this setup is that Twitter will happily send emails and other notifications to your bot as if it was a real person, unless you specifically opt-out.

Wrap up

I hope this guide will help you deal with some of the biggest questions and challenges of making friendly Twitter bots. Be sure to join us in the Botmakers community. We are artists, journalists, educators, tinkerers, bot enthusiasts, seasoned developers, and always happy to help a fellow botmaker out 🙂

If you’d like to leave me feedback and suggestions for this guide, feel free to send me an email!

And you can see more of my tutorials here.

Special thanks


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

Enjoyed the tutorial?

Consider supporting Botwiki!

Latest from the blog

Poll: Multi-network bots and followers
Poll: Multi-network bots and followers

Does Twitter get your bot the most followers?

Poll: Bots and public data
Poll: Bots and public data

Would you take $5,000 to shut down your bot?

Twitter officially released v2 of their API
Twitter officially released v2 of their API

Manage tweets and lists, tweet to Super Followers, and yes, you can post polls now!

Visit the blog