How to Create Retweet and Favorite Twitter Bot

Published in: Twitter Bots

This tutorial explains how you can easily make a Twitter bot that will automatically favorite and/or retweet tweets that contain particular keywords or #hashtags. You need not know any programming and your Twitter bot will be up and running in few minutes.

You may be wondering why would anyone write a Twitter bot that mindlessly favorites or retweets tweets? Yes, bots can be used for spamming but if used properly, they can also help grow your Twitter network.

For instance, when people share a link from your website on Twitter, you can favorite that tweet and it will give an hint to the original poster that you are the author of that article. A brand may retweet tweets that contain positive mentions of their product. The list goes on.

Twitter Retweet Bot

The first thing you need to do is define a search phrase and any matching tweets will be retweeted or favorited by the bot. Add as many search conditions as possible to keep spam tweets away from your list. Some examples:

1. Tweets containing links to your website, but no retweets included min_retweets:5 OR min_faves:5 -RT

2. Tweets that include particular hashtag, but exclude tweets with links #WhatAnAwesomeHashtag -RT -filter:links

3. Find all tweets sent from a particular location contain a conference hashtag #hashtag near:“New York, NY” within:15mi

OK, next we need to build our Twitter bot app. Twitter has strict rules around bots that automate tweeting and therefore it is recommended that you create a separate Twitter account to test your bots.

Retweet and Favorite Tweets

  1. Go to and create a new application. Fill-in the mandatory fields (name, description, URL) and click Create. Next go to Keys and Access Tokens and click the Create my Access Token button. Twitter will generate the Consumer Keys & Access tokens that we will need in the next step.
  2. Open the Twitter Bots app and add the keys from the previous stop. Next go to the bots page and enter the search phrase.
  3. Choose the action as either Retweet or Favorite from the dropdown and click the Create button to run your Twitter bot.

That’s it. The bot will run in the background, every hour, and favorite / retweet matching tweets. If you wish to stop the bot later, go to the same page and hit the Stop button. The full source of the Twitter retweet bot is available on under the “do whatever you like” license.

Also see: Write Twitter Bots

📮  Subscribe to our Email Newsletter for Google tips and tutorials!
Published in: Twitter Bots

Looking for something? Find here!

Meet the Author

Web Geek, Google Developer Expert
Amit Agarwal

Amit Agarwal is a Google Developer Expert in Google Workspace and Google Apps Script. He holds an engineering degree in Computer Science (I.I.T.) and is the first professional blogger in India. He is the developer of Mail Merge for Gmail and Document Studio. Read more on Lifehacker and YourStory

Get in touch

Google Add-ons

Do more with your Gmail and GSuite account

We build bespoke solutions that use the capabilities and the features of Google Workspace for automating business processes and driving work productivity.

  1. Mail Merge with Attachments
    Send personalized email to your Google Contact with a Google Sheet and Gmail
  2. Save Emails and Attachments
    Download email messages and file attachments from Gmail to your Google Drive
  3. Google Forms Email Notifications
    Send email notifications to multiple people when a new Google Form is submitted
  4. Document Studio
    Create beautiful pixel perfect documents merging data from Google Sheets and Google Forms
  5. Creator Studio for Google Slides
    Turn your Google Slides presentations into animated GIFs and videos for uploading to YouTube