Codeconia -Learn Programming

How to create Instagram Bot with InstaPy

Hello everyone,

Today we are going to learning how we can make an Instagram bot with InstaPy. InstaPy is a python package, and we can use this to automate our Instagram account,

It will like posts , comment, follow people, unfollow people, and lots more

In this tutorial, we are trying to test some of its abilities,  Sounds good ah ?  let’s get into it.

Requirements 

  1. Firefox Browser  (link)
  2. Python  (install  stable version)  (link)
  3. a Code Editor (link)

 

Create a folder and open PowerShell in it and run the command

Install InstaPy (in the PowerShell or cmd):

pip install instapy

If you get an error with the previous command:

py -3 -m pip install instapy

Create a file called instabot.py (u can name it whatever you want) in the folder

# imports
from instapy import InstaPy
from instapy import smart_run

# login credentials
insta_username = 'your username'  # <- enter username here
insta_password = 'yourpassword'  # <- enter password here

# get an InstaPy session!
# set headless_browser=True to run InstaPy in the background
session = InstaPy(username=insta_username,
                  password=insta_password,
                  headless_browser=False)

with smart_run(session):
    """ Activity flow """
    # general settings
    session.set_relationship_bounds(enabled=True,
                                    delimit_by_numbers=True,
                                    max_followers=1000,
                                    min_followers=45,
                                    min_following=77)
    #find 10 profiles with these tags  
    session.like_by_tags(["programming", "#code"], amount=10)

    #follow them all 
    session.set_do_follow(True, percentage=100)

Run the script: open the same powershell then run

py instabot.py

then it will launch a firefox browser and it will automatically find matching profiles and like images and follow people

to know more watch the video

 

 

 

 

 

 

 

Ajith Jojo

Add comment

Follow us

Don't be shy, get in touch. We love meeting interesting people and making new friends.

Most popular