Instagram bot. It works without instagram api, need only login and password. Write on python.
Clone or download
Latest commit c50a3dd Jan 19, 2019


Instabot is a toolkit written in Python for building Instagram bots using the undocumented private API.

Please do not clone this repo and publish it as your own. Fork the repo if you wish to publish any changes.

Donate Chat on Telegram


  • Python v3.6 or greater
  • pip v18 or greater
  • Install requirements.txt (requests, fake-useragent, instaloader)

Getting started

  • git clone && cd or download zip.

  • Head into your virtual environment and use pip or pip3 depending on your installation:

pip3 install -r requirements.txt
  • For a quick & dirty test run, use

Depending on your operating system and python installation, you might need to use py, python, or python3.

  • To set extra parameters and more sophisticated configurations, copy and edit and run.


Parameter Type Description Default value
login str Your instagram username
password str Your instagram password
start_at_h int Start program at the hour 0
start_at_m int Start program at the min 0
end_at_h int End program at the hour 23
end_at_m int End program at the min 59
database_name str change the name of database file to use multiple account "follows_db.db"
session_file str change the name of session file so to avoid having to login every time "username.session"
like_per_day int Number of photos to like per day (over 1000 may cause throttling) 1000
media_max_like int Maximum number of likes on photos to like (set to 0 to disable) 0
media_min_like int Minimum number of likes on photos to like (set to 0 to disable) 0
follow_per_day int Users to follow per day 0
follow_time int Seconds to wait before unfollowing 5 * 60 * 60
follow_time_enabled bool Whether to wait seconds set in follow_time before unfollowing True
unfollow_per_day int Users to unfollow per day 0
unfollow_recent_feed bool If enabled, will populate database with users from recent feed and unfollow if they meet the conditions. Disable if you only want the bot to unfollow people it has previously followed. True
comments_per_day int Comments to post per day 0
comment_list [[str]] List of word lists for comment generation [['this', 'your'], ['photo', 'picture', 'pic', 'shot'], ['is', 'looks', 'is really'], ['great', 'super', 'good'], ['.', '...', '!', '!!']]
tag_list [str] Tags to use for finding posts by hasthag or location(l:locationid from e.g. ['cat', 'car', 'dog', 'l:212999109']
tag_blacklist [str] Tags to ignore when liking posts []
user_blacklist {str: str} Users whose posts to ignore {}
max_like_for_one_tag int How many media of a given tag to like at once (out of 21) 5
unfollow_break_min int Minimum seconds to break between unfollows 15
unfollow_break_max int Maximum seconds to break between unfollows 30
log_mod int Logging target (0 log to console, 1 log to file, 2 no log.) 0
proxy str Access instagram through a proxy. (host:port or user:password@host:port)


Method Description
get_media_id_by_tag(tag) Add photos with a given tag to like queue
like_all_exist_media(num) Like some number of media in queue
auto_mod() Automatically loop through tags and like photos
unlike(id) Unlike media, given its ID.
comment(id, comment) Write a comment on the media with a given ID.
follow(id) Follow the user with the given ID.
unfollow(id) Unfollow the user with the given ID.
logout() Log out of Instagram.

Usage examples

Basic bot implementation:

bot = InstaBot('login', 'password')

Standard use with custom tags:

bot = InstaBot('login', 'password', tag_list=['with', 'your', 'tag'])

Standard use with change default settings (you should know what you do!):

bot = InstaBot('login', 'password',
               tag_list=['like', 'follow', 'f4f'],

Get media by one tag 'python' and like 4 of them:

bot = InstaBot('login', 'password')

Video Tutorials

The following video tutorials demo setting up and running the bot: