Python Twitter Bot

Just created a twitter bot with python and tweepy (a python library to interact with twitter, which is following a defined set of users. This users are gathered from defined user’s followers. After a defined lease of days this followers are became unfollowed if they did not followed back during a new execution of the script.

This script also handles the max API calls per execution. –> normally the max limit is set to 300/15min.
All data will be stored and updated in a local CSV.

Basic steps:

1. Create an twitter application and describe the purpose and details. (

App Name: Choose a unique name
Description: Description of your application
Sign in with Twitter: Enabled
Callback URL:
App usage: Purpose and description of your application

2. Get the Keys and Tokens

Get the API keys from tab: “Keys and tokens” and store them in a different file

3. Explore basic functions and API docs

Tweepy docs:


Create a Tweet

Delete a Tweet



Structure of CSV:

Python script:

1 year ago

Leave a Reply

Your email address will not be published. Required fields are marked *