How to instagram bot
How to Make an Instagram Bot With Python and InstaPy – Real Python
What do SocialCaptain, Kicksta, Instavast, and many other companies have in common? They all help you reach a greater audience, gain more followers, and get more likes on Instagram while you hardly lift a finger. They do it all through automation, and people pay them a good deal of money for it. But you can do the same thing—for free—using InstaPy!
In this tutorial, you’ll learn how to build a bot with Python and InstaPy, a library by Tim Großmann which automates your Instagram activities so that you gain more followers and likes with minimal manual input. Along the way, you’ll learn about browser automation with Selenium and the Page Object Pattern, which together serve as the basis for InstaPy.
In this tutorial, you’ll learn:
- How Instagram bots work
- How to automate a browser with Selenium
- How to use the Page Object Pattern for better readability and testability
- How to build an Instagram bot with InstaPy
You’ll begin by learning how Instagram bots work before you build one.
Important: Make sure you check Instagram’s Terms of Use before implementing any kind of automation or scraping techniques.
Free Bonus: 5 Thoughts On Python Mastery, a free course for Python developers that shows you the roadmap and the mindset you’ll need to take your Python skills to the next level.
How Instagram Bots Work
How can an automation script gain you more followers and likes? Before answering this question, think about how an actual person gains more followers and likes.
They do it by being consistently active on the platform. They post often, follow other people, and like and leave comments on other people’s posts. Bots work exactly the same way: They follow, like, and comment on a consistent basis according to the criteria you set.
The better the criteria you set, the better your results will be. You want to make sure you’re targeting the right groups because the people your bot interacts with on Instagram will be more likely to interact with your content.
For example, if you’re selling women’s clothing on Instagram, then you can instruct your bot to like, comment on, and follow mostly women or profiles whose posts include hashtags such as #beauty
, #fashion
, or #clothes
. This makes it more likely that your target audience will notice your profile, follow you back, and start interacting with your posts.
How does it work on the technical side, though? You can’t use the Instagram Developer API since it is fairly limited for this purpose. Enter browser automation. It works in the following way:
- You serve it your credentials.
- You set the criteria for who to follow, what comments to leave, and which type of posts to like.
- Your bot opens a browser, types in
https://instagram.com
on the address bar, logs in with your credentials, and starts doing the things you instructed it to do.
Next, you’ll build the initial version of your Instagram bot, which will automatically log in to your profile. Note that you won’t use InstaPy just yet.
Remove ads
How to Automate a Browser
For this version of your Instagram bot, you’ll be using Selenium, which is the tool that InstaPy uses under the hood.
First, install Selenium. During installation, make sure you also install the Firefox WebDriver since the latest version of InstaPy dropped support for Chrome. This also means that you need the Firefox browser installed on your computer.
Now, create a Python file and write the following code in it:
1from time import sleep 2from selenium import webdriver 3 4browser = webdriver.Firefox() 5 6browser.get('https://www.instagram.com/') 7 8sleep(5) 9 10browser.close()
Run the code and you’ll see that a Firefox browser opens and directs you to the Instagram login page. Here’s a line-by-line breakdown of the code:
- Lines 1 and 2 import
sleep
andwebdriver
. - Line 4 initializes the Firefox driver and sets it to
browser
. - Line 6 types
https://www.instagram.com/
on the address bar and hits Enter. - Line 8 waits for five seconds so you can see the result. Otherwise, it would close the browser instantly.
- Line 10 closes the browser.
This is the Selenium version of Hello, World
. Now you’re ready to add the code that logs in to your Instagram profile. But first, think about how you would log in to your profile manually. You would do the following:
- Go to
https://www.instagram.com/
. - Click the login link.
- Enter your credentials.
- Hit the login button.
The first step is already done by the code above. Now change it so that it clicks on the login link on the Instagram home page:
1from time import sleep 2from selenium import webdriver 3 4browser = webdriver. Firefox() 5browser.implicitly_wait(5) 6 7browser.get('https://www.instagram.com/') 8 9login_link = browser.find_element_by_xpath("//a[text()='Log in']") 10login_link.click() 11 12sleep(5) 13 14browser.close()
Note the highlighted lines:
- Line 5 sets five seconds of waiting time. If Selenium can’t find an element, then it waits for five seconds to allow everything to load and tries again.
- Line 9 finds the element
<a>
whose text is equal toLog in
. It does this using XPath, but there are a few other methods you could use. - Line 10 clicks on the found element
<a>
for the login link.
Run the script and you’ll see your script in action. It will open the browser, go to Instagram, and click on the login link to go to the login page.
On the login page, there are three important elements:
- The username input
- The password input
- The login button
Next, change the script so that it finds those elements, enters your credentials, and clicks on the login button:
1from time import sleep 2from selenium import webdriver 3 4browser = webdriver. Firefox() 5browser.implicitly_wait(5) 6 7browser.get('https://www.instagram.com/') 8 9login_link = browser.find_element_by_xpath("//a[text()='Log in']") 10login_link.click() 11 12sleep(2) 13 14username_input = browser.find_element_by_css_selector("input[name='username']") 15password_input = browser.find_element_by_css_selector("input[name='password']") 16 17username_input.send_keys("<your username>") 18password_input.send_keys("<your password>") 19 20login_button = browser.find_element_by_xpath("//button[@type='submit']") 21login_button.click() 22 23sleep(5) 24 25browser.close()
Here’s a breakdown of the changes:
- Line 12 sleeps for two seconds to allow the page to load.
- Lines 14 and 15 find username and password inputs by CSS. You could use any other method that you prefer.
- Lines 17 and 18 type your username and password in their respective inputs. Don’t forget to fill in
<your username>
and<your password>
! - Line 20 finds the login button by XPath.
- Line 21 clicks on the login button.
Run the script and you’ll be automatically logged in to to your Instagram profile.
You’re off to a good start with your Instagram bot. If you were to continue writing this script, then the rest would look very similar. You would find the posts that you like by scrolling down your feed, find the like button by CSS, click on it, find the comments section, leave a comment, and continue.
The good news is that all of those steps can be handled by InstaPy. But before you jump into using Instapy, there is one other thing that you should know about to better understand how InstaPy works: the Page Object Pattern.
Remove ads
How to Use the Page Object Pattern
Now that you’ve written the login code, how would you write a test for it? It would look something like the following:
def test_login_page(browser): browser. get('https://www.instagram.com/accounts/login/') username_input = browser.find_element_by_css_selector("input[name='username']") password_input = browser.find_element_by_css_selector("input[name='password']") username_input.send_keys("<your username>") password_input.send_keys("<your password>") login_button = browser.find_element_by_xpath("//button[@type='submit']") login_button.click() errors = browser.find_elements_by_css_selector('#error_message') assert len(errors) == 0
Can you see what’s wrong with this code? It doesn’t follow the DRY principle. That is, the code is duplicated in both the application and the test code.
Duplicating code is especially bad in this context because Selenium code is dependent on UI elements, and UI elements tend to change. When they do change, you want to update your code in one place. That’s where the Page Object Pattern comes in.
With this pattern, you create page object classes for the most important pages or fragments that provide interfaces that are straightforward to program to and that hide the underlying widgetry in the window. With this in mind, you can rewrite the code above and create a HomePage
class and a LoginPage
class:
from time import sleep class LoginPage: def __init__(self, browser): self.browser = browser def login(self, username, password): username_input = self.browser.find_element_by_css_selector("input[name='username']") password_input = self.browser.find_element_by_css_selector("input[name='password']") username_input.send_keys(username) password_input.send_keys(password) login_button = browser.find_element_by_xpath("//button[@type='submit']") login_button.click() sleep(5) class HomePage: def __init__(self, browser): self.browser = browser self.browser.get('https://www.instagram.com/') def go_to_login_page(self): self.browser.find_element_by_xpath("//a[text()='Log in']").click() sleep(2) return LoginPage(self.browser)
The code is the same except that the home page and the login page are represented as classes. The classes encapsulate the mechanics required to find and manipulate the data in the UI. That is, there are methods and accessors that allow the software to do anything a human can.
One other thing to note is that when you navigate to another page using a page object, it returns a page object for the new page. Note the returned value of go_to_log_in_page()
. If you had another class called FeedPage
, then login()
of the LoginPage
class would return an instance of that: return FeedPage()
.
Here’s how you can put the Page Object Pattern to use:
from selenium import webdriver browser = webdriver.Firefox() browser.implicitly_wait(5) home_page = HomePage(browser) login_page = home_page.go_to_login_page() login_page.login("<your username>", "<your password>") browser.close()
It looks much better, and the test above can now be rewritten to look like this:
def test_login_page(browser): home_page = HomePage(browser) login_page = home_page. go_to_login_page() login_page.login("<your username>", "<your password>") errors = browser.find_elements_by_css_selector('#error_message') assert len(errors) == 0
With these changes, you won’t have to touch your tests if something changes in the UI.
For more information on the Page Object Pattern, refer to the official documentation and to Martin Fowler’s article.
Now that you’re familiar with both Selenium and the Page Object Pattern, you’ll feel right at home with InstaPy. You’ll build a basic bot with it next.
Note: Both Selenium and the Page Object Pattern are widely used for other websites, not just for Instagram.
How to Build an Instagram Bot With InstaPy
In this section, you’ll use InstaPy to build an Instagram bot that will automatically like, follow, and comment on different posts. First, you’ll need to install InstaPy:
$ python3 -m pip install instapy
This will install instapy
in your system.
Note: The best practice is to use virtual environments for every project so that the dependencies are isolated.
Remove ads
Essential Features
Now you can rewrite the code above with InstaPy so that you can compare the two options. First, create another Python file and put the following code in it:
from instapy import InstaPy InstaPy(username="<your_username>", password="<your_password>").login()
Replace the username and password with yours, run the script, and voilà! With just one line of code, you achieved the same result.
Even though your results are the same, you can see that the behavior isn’t exactly the same. In addition to simply logging in to your profile, InstaPy does some other things, such as checking your internet connection and the status of the Instagram servers. This can be observed directly on the browser or in the logs:
INFO [2019-12-17 22:03:19] [username] -- Connection Checklist [1/3] (Internet Connection Status) INFO [2019-12-17 22:03:20] [username] - Internet Connection Status: ok INFO [2019-12-17 22:03:20] [username] - Current IP is "17. 283.46.379" and it's from "Germany/DE" INFO [2019-12-17 22:03:20] [username] -- Connection Checklist [2/3] (Instagram Server Status) INFO [2019-12-17 22:03:26] [username] - Instagram WebSite Status: Currently Up
Pretty good for one line of code, isn’t it? Now it’s time to make the script do more interesting things than just logging in.
For the purpose of this example, assume that your profile is all about cars, and that your bot is intended to interact with the profiles of people who are also interested in cars.
First, you can like some posts that are tagged #bmw
or #mercedes
using like_by_tags()
:
1from instapy import InstaPy 2 3session = InstaPy(username="<your_username>", password="<your_password>") 4session.login() 5session.like_by_tags(["bmw", "mercedes"], amount=5)
Here, you gave the method a list of tags to like and the number of posts to like for each given tag. In this case, you instructed it to like ten posts, five for each of the two tags. But take a look at what happens after you run the script:
INFO [2019-12-17 22:15:58] [username] Tag [1/2] INFO [2019-12-17 22:15:58] [username] --> b'bmw' INFO [2019-12-17 22:16:07] [username] desired amount: 14 | top posts [disabled]: 9 | possible posts: 43726739 INFO [2019-12-17 22:16:13] [username] Like# [1/14] INFO [2019-12-17 22:16:13] [username] https://www.instagram.com/p/B6MCcGcC3tU/ INFO [2019-12-17 22:16:15] [username] Image from: b'mattyproduction' INFO [2019-12-17 22:16:15] [username] Link: b'https://www.instagram.com/p/B6MCcGcC3tU/' INFO [2019-12-17 22:16:15] [username] Description: b'Mal etwas anderes \xf0\x9f\x91\x80\xe2\x98\xba\xef\xb8\x8f Bald ist das komplette Video auf YouTube zu finden (n\xc3\xa4here Infos werden folgen). Vielen Dank an @patrick_jwki @thehuthlife und @christic_ f\xc3\xbcr das bereitstellen der Autos \xf0\x9f\x94\xa5\xf0\x9f\x98\x8d#carporn#cars#tuning#bagged#bmw#m2#m2competition#focusrs#ford#mk3#e92#m3#panasonic#cinematic#gh5s#dji#roninm#adobe#videography#music#bimmer#fordperformance#night#shooting#' INFO [2019-12-17 22:16:15] [username] Location: b'K\xc3\xb6ln, Germany' INFO [2019-12-17 22:16:51] [username] --> Image Liked! INFO [2019-12-17 22:16:56] [username] --> Not commented INFO [2019-12-17 22:16:57] [username] --> Not following INFO [2019-12-17 22:16:58] [username] Like# [2/14] INFO [2019-12-17 22:16:58] [username] https://www. instagram.com/p/B6MDK1wJ-Kb/ INFO [2019-12-17 22:17:01] [username] Image from: b'davs0' INFO [2019-12-17 22:17:01] [username] Link: b'https://www.instagram.com/p/B6MDK1wJ-Kb/' INFO [2019-12-17 22:17:01] [username] Description: b'Someone said cloud? \xf0\x9f\xa4\x94\xf0\x9f\xa4\xad\xf0\x9f\x98\x88 \xe2\x80\xa2\n\xe2\x80\xa2\n\xe2\x80\xa2\n\xe2\x80\xa2\n#bmw #bmwrepost #bmwm4 #bmwm4gts #f82 #bmwmrepost #bmwmsport #bmwmperformance #bmwmpower #bmwm4cs #austinyellow #davs0 #mpower_official #bmw_world_ua #bimmerworld #bmwfans #bmwfamily #bimmers #bmwpost #ultimatedrivingmachine #bmwgang #m3f80 #m5f90 #m4f82 #bmwmafia #bmwcrew #bmwlifestyle' INFO [2019-12-17 22:17:34] [username] --> Image Liked! INFO [2019-12-17 22:17:37] [username] --> Not commented INFO [2019-12-17 22:17:38] [username] --> Not following
By default, InstaPy will like the first nine top posts in addition to your amount
value. In this case, that brings the total number of likes per tag to fourteen (nine top posts plus the five you specified in amount
).
Also note that InstaPy logs every action it takes. As you can see above, it mentions which post it liked as well as its link, description, location, and whether the bot commented on the post or followed the author.
You may have noticed that there are delays after almost every action. That’s by design. It prevents your profile from getting banned on Instagram.
Now, you probably don’t want your bot liking inappropriate posts. To prevent that from happening, you can use set_dont_like()
:
from instapy import InstaPy session = InstaPy(username="<your_username>", password="<your_password>") session.login() session.like_by_tags(["bmw", "mercedes"], amount=5) session.set_dont_like(["naked", "nsfw"])
With this change, posts that have the words naked
or nsfw
in their descriptions won’t be liked. You can flag any other words that you want your bot to avoid.
Next, you can tell the bot to not only like the posts but also to follow some of the authors of those posts. You can do that with set_do_follow()
:
from instapy import InstaPy session = InstaPy(username="<your_username>", password="<your_password>") session.login() session.like_by_tags(["bmw", "mercedes"], amount=5) session.set_dont_like(["naked", "nsfw"]) session.set_do_follow(True, percentage=50)
If you run the script now, then the bot will follow fifty percent of the users whose posts it liked. As usual, every action will be logged.
You can also leave some comments on the posts. There are two things that you need to do. First, enable commenting with set_do_comment()
:
from instapy import InstaPy session = InstaPy(username="<your_username>", password="<your_password>") session.login() session.like_by_tags(["bmw", "mercedes"], amount=5) session.set_dont_like(["naked", "nsfw"]) session.set_do_follow(True, percentage=50) session.set_do_comment(True, percentage=50)
Next, tell the bot what comments to leave with set_comments()
:
from instapy import InstaPy session = InstaPy(username="<your_username>", password="<your_password>") session. login() session.like_by_tags(["bmw", "mercedes"], amount=5) session.set_dont_like(["naked", "nsfw"]) session.set_do_follow(True, percentage=50) session.set_do_comment(True, percentage=50) session.set_comments(["Nice!", "Sweet!", "Beautiful :heart_eyes:"])
Run the script and the bot will leave one of those three comments on half the posts that it interacts with.
Now that you’re done with the basic settings, it’s a good idea to end the session with end()
:
from instapy import InstaPy session = InstaPy(username="<your_username>", password="<your_password>") session.login() session.like_by_tags(["bmw", "mercedes"], amount=5) session.set_dont_like(["naked", "nsfw"]) session.set_do_follow(True, percentage=50) session.set_do_comment(True, percentage=50) session.set_comments(["Nice!", "Sweet!", "Beautiful :heart_eyes:"]) session.end()
This will close the browser, save the logs, and prepare a report that you can see in the console output.
Remove ads
Additional Features in InstaPy
InstaPy is a sizable project that has a lot of thoroughly documented features. The good news is that if you’re feeling comfortable with the features you used above, then the rest should feel pretty similar. This section will outline some of the more useful features of InstaPy.
Quota Supervisor
You can’t scrape Instagram all day, every day. The service will quickly notice that you’re running a bot and will ban some of its actions. That’s why it’s a good idea to set quotas on some of your bot’s actions. Take the following for example:
session.set_quota_supervisor(enabled=True, peak_comments_daily=240, peak_comments_hourly=21)
The bot will keep commenting until it reaches its hourly and daily limits. It will resume commenting after the quota period has passed.
Headless Browser
This feature allows you to run your bot without the GUI of the browser. This is super useful if you want to deploy your bot to a server where you may not have or need the graphical interface. It’s also less CPU intensive, so it improves performance. You can use it like so:
session = InstaPy(username='test', password='test', headless_browser=True)
Note that you set this flag when you initialize the InstaPy
object.
Using AI to Analyze Posts
Earlier you saw how to ignore posts that contain inappropriate words in their descriptions. What if the description is good but the image itself is inappropriate? You can integrate your InstaPy bot with ClarifAI, which offers image and video recognition services:
session.set_use_clarifai(enabled=True, api_key='<your_api_key>') session.clarifai_check_img_for(['nsfw'])
Now your bot won’t like or comment on any image that ClarifAI considers NSFW. You get 5,000 free API-calls per month.
Relationship Bounds
It’s often a waste of time to interact with posts by people who have a lot of followers. In such cases, it’s a good idea to set some relationship bounds so that your bot doesn’t waste your precious computing resources:
session.set_relationship_bounds(enabled=True, max_followers=8500)
With this, your bot won’t interact with posts by users who have more than 8,500 followers.
For many more features and configurations in InstaPy, check out the documentation.
Conclusion
InstaPy allows you to automate your Instagram activities with minimal fuss and effort. It’s a very flexible tool with a lot of useful features.
In this tutorial, you learned:
- How Instagram bots work
- How to automate a browser with Selenium
- How to use the Page Object Pattern to make your code more maintainable and testable
- How to use InstaPy to build a basic Instagram bot
Read the InstaPy documentation and experiment with your bot a little bit. Soon you’ll start getting new followers and likes with a minimal amount of effort. I gained a few new followers myself while writing this tutorial. If you prefer video tutorials, there is also a Udemy course by the creator of InstaPy Tim Großmann.
You can also explore the possibilities of ChatterBot, Tweepy, Discord, and Alexa Skills to learn more about how you can make bots for different platforms using Python.
If there’s anything you’d like to ask or share, then please reach out in the comments below.
I Tried Instagram Automation (So You Don’t Have To): An Experiment
Has the elusive unicorn of Instagram automation ever tempted you?
We can’t blame you. Instagram automation software sites paint a pretty picture of your phone blowing up organically with likes and comments. Your social media scales effortlessly while you sit back and relax.
Brands like Nike, NASA, and whoever runs Obama’s social networks are begging you to consult.
And, oh, who’s that in your DMs? Taika Waititi and Doja Cat both asking for a follow back? Wow, this is everything you dreamed of, right?
Wrong.
I tried it out, and not only did Doja Cat not return any of my messages, but I also lost time, money, and a bit of dignity.
All is not lost; there are legitimately helpful Instagram automation tools. We’ll get to them at the end of this article. But first, here’s what happened when I tried Instagram automation.
What is Instagram automation?
What is NOT Instagram automation?
What happened when I tried Instagram automation
Lessons from Instagram automation
Legitimately helpful Instagram automation tools
Bonus: Download a free checklist that reveals the exact steps a fitness influencer used to grow from 0 to 600,000+ followers on Instagram with no budget and no expensive gear.
What is Instagram automation?To be clear, the kind of Instagram automation we’re discussing are bots that like posts, follow accounts, and comment on your behalf.
Ideally, you train your bots to sound and act like you. Then, those bots go out and find accounts they think you’ll like. They interact with them using parameters you’ve set beforehand in a hopefully natural way.
The idea is that by engaging with other accounts, those accounts will turn around and engage with you. This way, you’ll be building a following with real people by using a bot to do the work.
But, much like friends in real life, you can’t use a robot to foster relationships for you. Wall-E types excluded, of course. It’s impersonal, and people tend to know when a bot is pretending to be a person, and people hate it.
And when people on Instagram hate something, Instagram tends to hate it too and bans quickly follow. They want their real users to happily spend as much time as possible on the app, so they take black-hat social media tricks pretty seriously.
Instagram automation is one of those pesky black-hat techniques, like engagement pods, which we tried and, spoiler alert, they failed. It’s in line with buying Instagram followers. We tried that too, and it left us with an inflated follower count, zero engagement, and a long list of obviously fake followers.
What is NOT Instagram automation?Let me be crystal clear: There are excellent, legitimate Instagram automation tools and software out there. They do the groundwork for you, letting you focus on tactics that can authentically scale your social efforts, like creating content your followers want to see.
In the context of this article, we’re discussing Instagram automation practices that are black-hat tactics. The legitimate tools we know and love don’t fall under this umbrella. We’ve listed a few of our favorite tools and software at the end of this piece.
What happened when I tried Instagram automationNow that we’re on the same page with what “Instagram automation” means, we can get into the nitty-gritty.
I started off by doing what you probably did to get here — I Googled “Instagram automation. ” I landed on Plixi, one of the first advertised Instagram automation offerings on Google. It seemed like a good place to start.
Experiment 1
Step 1: Sign up
Sign up was quick and easy. I linked my Instagram account and put in my credit card information. I used an old account that only had 51 Followers, so the only way to go was up!
Plixi’s home page bragged about having a “patent-pending” model. Essentially, they’re crawling Instagram and using machine learning to find and interact with like-minded accounts, engaging with them, and encouraging followers.
Step 2: Growth Settings
After signing up, Plixi asked me to set my growth settings. The free (for 24 hours before you have to pay for a month at $49) version allows you to choose “slow” for your follower growth. Slow it is.
I added in “accounts like mine” so Plixi could target their followers, assumedly. This was a bit tough as the account I was using — Scholar Collars — was a silly fashion line I launched at the beginning of the pandemic.
What’s Scholar Collars, you ask? I created collared dickies for those last-minute oh-my-God-I’m-still-wearing-pajamas Zoom meetings.
You can keep one in your desk drawer, then slap it on under your t-shirt or sweater for an instant professional upgrade. On Zoom, you can only see your neck and shoulders, so the other meeting attendees think you’re in chic business casual wear.
View this post on Instagram
A post shared by Scholar Collars (@scholarcollars)
As you can see, it wasn’t exactly easy to find similar accounts, so I added @Zoom.
There were a few other options to set up my account for success, but they were all gated behind a Pro account.
Step 3: Start
I slapped the Start Growth button, and Plixi started finding me new followers. I had one within the first 2 minutes — a crypto app account.
Plixi also told me in my activity dashboard that they had “Reached 9 users based on @zoom” though it’s unclear what that actually means. They hadn’t reached out to nine users as far as I could tell.
Step 4: Watch my followers grow
After 24 hours, I had eight more followers, taking me from 51 to 59. The next day my follower count grew to 100. Over a week, my follower count grew to 245, which is pretty okay — it wasn’t as cheap and easy as other ways to buy followers. But, the accounts appeared legit, and the growth was slow enough that Instagram didn’t seem keen to flag my account.
But, I now had 245 followers and still only seven likes on one of my photos. And no activity from my own account. I had been under the impression that Plixi would also like and comment from my account. It did not.
The growth was fine and all, but what’s really the point? For $50, I had no engagement besides an increase in follower count. And because Plixi hadn’t interacted with other accounts, I couldn’t be sure where the followers were coming from, but it wasn’t from organic engagement.
So, Plixi was a letdown. But, like any good researcher, I tried a second experiment.
Experiment #2,
Step 1: Find an Instagram comment bot
After Plixi, I wanted to focus my efforts on automating engagement. Naturally, I Googled “Instagram comment bot and automatic Instagram likes”
I found one that automatically sends out DMs. Yikes. That seemed too personal somehow. And another that promised me it was a real person, which, if you’ve read our chatbot do’s and don’ts, you’ll know is a chatbot-don’t.
Instaswift seemed to be more what I was after — and they advertised a free Instagram-like-bot trial. Sold.
Step 2: Try the Instagram bot for free
The free Instagram bot turned out to be 10 to 15 free likes on your last three uploaded pictures. When I tried it, I was met with an error message. Off to a rocky start with Instaswift.
Source: Instaswift
Step 3: Pay for it
A week of Instaswift with 3-4 comments is $15, so despite the disappointment from the free trial, we’re still going ahead. Maybe they treat paying customers a little better.
Step 4: Post a photo
You have to post a new photo for it to start working, and the one I chose of my friend’s cat Gus got 110 likes and four comments. The surge in likes would have looked fake if I hadn’t done the follower campaign first. Now, it only looks fake if you look closely.
I opted to cancel my subscription as it automatically renews from week to week.
Now, I just had to find a bot to comment from my account.
Experiment 3
Step 1: Find a comment bot
For the third experiment, I tried PhantomBuster. It promised to post comments from my account automatically.
Plus, it had promised Instagram automation for free with a 14-day trial. Sold.
Step 2: Sign up and get started
PhantomBuster uses cookies to log in to your account to comment on your behalf. Once I had that sorted, it asked me for a spreadsheet with post URLs and comment examples.
Then, I sent Phantom Buster to ‘go’ and sat back.
Bonus: Download a free checklist that reveals the exact steps a fitness influencer used to grow from 0 to 600,000+ followers on Instagram with no budget and no expensive gear.
Get the free guide right now!
#1 Social Media Tool
Create. Schedule. Publish. Engage. Measure. Win.
Start free 30-day trial
Step 3: Check your results
The bot automatically commented on three posts. But, they were the three account URLs and comments I had added to the spreadsheet. It would have taken me less time to comment on the posts myself.
If this wasn’t a free trial, I would be upset that PhantomBuster billed me for doing something I could have done myself.
Lessons from Instagram automationInstagram automation is no secret path to instafame or even more engagement. It turned out to be a waste of time and money for me.
There’s no such thing as a legitimate, risk-free Instagram automation service
As Hootsuite writers Paige Cooper and Evan LePage each discovered when they ran this experiment, automating Instagram marketing and engagement ain’t it.
Paige Cooper tried three different sites: InstaRocket, Instamber, and Ektor.io. She described her experiment as “shockingly ineffective” after gaining and losing less than ten followers. Though, Paige did wind up with some comments — notably, “Why did u buy followers” and “U have small likes.”
Evan LePage used the now-defunct Instagress to get 250 followers in 3 days. He reported:
“I [automatically] commented “your pics > my pics” on a selfie of a boy who was clearly in middle school. In fact, his account was composed of only four pictures, three of them selfies. I felt uncomfortable. The teenage boy told me I was being modest.”
Yikes.
And as for myself, the experience was a lunch bag letdown. Yes, I got a few new followers and some comments. But, ultimately, the followers weren’t aligned with my brand and the comments
There is no way to automate Instagram legitimately, effectively, and without risk.
It’s not worth the time searching and setting up
One of the biggest frustrations I found was that searching for “legitimate” (AKA apps that didn’t look too sketchy) automation brands took time and effort. Then, setting up each of them to work with my Instagram account and checking in on them took time and effort, too.
If I had spent the same amount of time just working on a social media strategy, I would be in a much better place right now.
Legitimately helpful Instagram automation toolsNow for the good part. All hope is not lost when it comes to helpful Instagram automation tools. Like most things in life, there’s no magic wand you can wave to get what you want. But, there are magic wands that can make your workday a bit easier.
Hootsuite’s Scheduling Software
Scheduling software allows you to plan your Instagram posts ahead, so you don’t have to scramble the day of. Hootsuite’s scheduling features are a dream for busy content creators and marketers — and key to saving you time on your social media marketing efforts.
Hootsuite Analytics
Tools for Instagram analytics and metrics can automate reports for you, so you can see what’s working and what’s not and pull reports easily for clients or managers that show results across all your social media platforms. We’re clearly a little biased, but we do love Hootsuite Analytics, and social media managers do too.
Heyday
Chatbots for Instagram can alleviate the drudgery of FAQs, customer support, and sales — you just have to find one you can trust. We love Heyday — so much so that we partnered with them.
Heyday lets you manage all of your customer’s queries from a single dashboard, so your Instagram DMs are easy to check. And, it automates messages for you, like frequently asked questions.
Source: Heyday
Hootsuite’s social listening tools
Social listening and hashtag monitoring tools can crawl for keywords important to your brand. You can set up a search for relevant topics, see who’s saying what out there, then comment back.
Start building your Instagram presence the real way using Hootsuite. Schedule and publish posts directly to Instagram, engage your audience, measure performance, and run all your other social media profiles — all from one simple dashboard. Try it free today.
Get Started
Grow on Instagram
Easily create, analyze, and schedule Instagram posts, Stories, and Reels with Hootsuite. Save time and get results.
Free 30-Day Trial
How to create an Instagram chatbot for business
The number of Instagram users in the world exceeds 1.22 billion people, the Russian audience is estimated at 56 million. 83% of social network users learn about new products and services through it, and 80% make a purchase decision based on information in their account.
In order not to miss an order, you need to be ready to respond to inquiries from potential customers at any time and respond as quickly as possible. This is where Instagram chatbots can help you — we have finally implemented this feature in SendPulse. nine0005
- What is a chatbot on Instagram
- What business problems does a chatbot solve?
- FAQ
- Automation of part of the processes in the sales funnel
- Engage subscribers, increase trust
- Targeted mailings nine0008 Reminders
- Collecting Feedback
- Saving user data
- Reaction to the mark in the story
- API request to get data from external sources
- Examples of chatbots on Instagram
- How to Create an Instagram Chatbot with SendPulse nine0009
- Connecting Instagram
- Interface
- Launching auto-replies and chatbot message threads
- Trigger "Welcome Series"
- Trigger "Standard Response"
- Bot Unfollow Trigger
- Creating your own trigger nine0009
- All the features of the SendPulse Chatbot Builder
- Block "Message"
- Continuation of the chain
- Block "Action"
- Filter block
- API request block
- Block "Pause"
- Block "Random choice" nine0009
- Additional features of chatbots in SendPulse
- Bot message segmentation
- Subscription Widget
- live chat
- An example of building a chatbot for Instagram in SendPulse
- Setting up the starting block
- Create the following messages nine0009
- Conclusion
What is a chatbot on Instagram
A chatbot is a virtual consultant that sends automatic responses to users based on triggers, makes targeted mailings, and if integration with CRM is configured, sends customer data to it, sorting according to the filter you set .
Advantages of chatbots for Instagram:
- instant responses to user requests 24/7, which affects their loyalty; nine0009
- increase in sales - customers do not go to competitors because of a long wait;
- reminder mailing lists that promote customer retention;
- savings on salaries of managers - you do not need a lot of employees to process orders in direct.
Chatbot makes doing business much easier. You can entrust him with all routine processes and direct the freed up resources to other areas.
What business tasks does a chatbot solve
This tool provides 24/7 support for your business. Below is a list of functions that can be assigned to a bot on Instagram.
Answers to frequently asked questions
Business accounts often receive direct messages with questions about product availability, prices and sizes, location, lead times, delivery terms, and the like. Make buttons with frequently repeated questions so that the Instagram bot instantly gives automatic answers, and managers do not have to constantly be distracted. Another option is to set up the bot to respond to a specific trigger word in the user's message. nine0003
Automation of part of the processes in the sales funnel
In the process of interaction between the chatbot and users, the needs of the latter are identified and non-targeted leads are screened out. If the sales funnel is small, the Instagram bot can act as a real “salesperson” and close the deal. Usually, to place an order, you still need the participation of a live manager - for this they add a button to switch to the operator - but the chatbot saves time significantly, due to which employees are less loaded and able to serve more customers. If three people were required to process applications, it is quite possible that after connecting the chatbot, one manager will be enough for the same amount of work. And the bot will cope with the recording for a consultation on its own. nine0003
Engage followers, build trust
Instagram bots can be used to engage your audience. For example, make a quiz where you need to choose one of the answer options, and at the end the participant receives a lead magnet - useful material. Getting something valuable for free will affect the user's opinion of you, increase trust, and perhaps later they will want to try a paid product.
Also, through the chatbot, you can give useful information and talk about the expert, his experience, give a link to cases or portfolios. In this case, there is more chance that the user will see this information and become interested than if he has to search through the entire profile - not everyone will do this. nine0003
Targeted mailings
You can set up filters to send messages through the bot based on interests, client status and other data.
Reminders
When you're running consultations or webinars, clients may forget the start time. This problem is solved by an automated reminder sent by a chatbot to Instagram - people spend a lot of time here and are unlikely to miss the message.
Collecting feedback
Use the Instagram bot to conduct surveys and collect feedback. This is a convenient way to discover your weaknesses and problematic customers without spending a lot of effort. nine0003
Save user data
Add a Data Entry block to your script to collect user data and then use it to personalize messages and segment audiences. The chatbot will send this data to CRM.
Reaction to Stories tags
In order not to miss your account's Stories tags and quickly respond to them, set up a thank you message that will be sent automatically. We advise you to thank not only with words, but also with a small discount or other bonus to encourage new purchases and marks. By the way, you can run promotions yourself with gifts for tagging your stories — this is how you make the most of the word of mouth effect. nine0003
API request to receive data from external sources
You can add an "API Request" block to the bot script to receive data from external systems, which will immediately be displayed in a message to the user. For example, you can report the weather by the name of the city, search by the name or article number of the product and display the result in the chatbot.
You can also place a subscription widget on the site to recruit a subscriber base from there. Optionally, you can create a widget for other channels - Facebook, WhatsApp, Telegram and VK. nine0003
For team work, you can invite several managers to your account: then each of them will have access to chats. This process is described in more detail in our instructions.
Discover the Chatbot on Instagram
Convert subscribers into regular customers, automate communication with them and improve sales.
Examples of Instagram Chatbots
Using several Instagram accounts with chatbots as an example, I will show you how to use this tool. nine0003
First example: personal online training app account. After switching to the dialogue, buttons with the most frequent questions immediately appear in front of the user. Click the button with the question of interest, and the bot gives the answer. Given the large number of subscribers, this saves a lot of time.
Bot for Instagram sports applicationThere is a flaw here - the inability to return to the choice of the question. If the user clicked, for example, “How to sign up for a workout?”, He will not be able to ask something else - only if he deletes the correspondence and starts it again. For the convenience of bot subscribers, it is necessary to add the ability to return to the main menu. nine0003
Second example: a bot in an additional account of a millionaire blogger created to post reviews. The user writes the word “quest” in direct, which is a trigger, and an interactive game begins. After passing it, the participant receives a checklist with useful materials.
Bot-quest involving the userThe bot was created in order to interest the subscriber and motivate them to learn from the blogger. Here I do not see any shortcomings, all steps are thought out. In the final, the participant is invited to watch one of two courses to choose from, and only after clicking on the link does a message come to the chat with a checklist. nine0003 Chatbot gives a link to download a file
Third example: a bot in the account of a specialist who creates them. Several buttons with questions are given, including one can view the portfolio by clicking on the link. The disadvantage here, as in the first case, is the inability to return to the choice of the question.
Bot for selling servicesChatbots are used for engagement, informing, selling - you can find different uses, but you need to carefully consider the logic of the bot so that the user does not leave without getting an answer to the question. nine0003
How to create a chatbot for Instagram in SendPulse
How to connect and run a chatbot in SendPulse
Connecting Instagram
To connect a bot to Instagram, you must have a Facebook business page and an Instagram business account .
Instagram must be allowed to access messages, and Facebook must be allowed to access messages from Instagram in the Inbox. The connection process is described in detail in our knowledge base. After connecting, you will have the bot settings in your SendPulse account. More on this later. nine0003
Interface
This is your SendPulse personal account, Chatbots section, where you will create chatbots. In the "Bot Structure" tab, you build its logic.
Personal account where you create and manage Instagram botIn the "Audience" tab, you can see everyone who subscribed to the bot: their status, last activity time, tags, chats with them.
The "Statistics" tab shows the number of subscribers for the period, the number of sent and incoming messages, the number of sessions. nine0003
It is also possible to set up auto-posting.
Statistics on bot messages in the SendPulse personal accountStarting auto-replies and chat bot message threads
When creating chat bots, a trigger element is used - this is an event that triggers auto-replies and message threads. There are two types of triggers in the SendPulse chatbot builder: pre-installed and manually created.
Connected by default:
- welcome series - sent after subscription; nine0009
- standard response - the bot will send it in response to any message for which the command is not registered;
- message after unsubscribing.
Each of them can be edited for yourself.
Trigger "Welcome series"
Select the greeting series, click "Edit chain" and go to the editor.
Setting up a greeting seriesAs we saw in the examples section, the greeting message is often not used. However, it makes the chatbot understandable to the subscriber. You can disable this trigger, but we recommend that you leave it on and continue the welcome series by attaching new messages and other blocks. It is desirable to give the bot a "human" face, to come up with an assistant character. nine0003
It is also recommended here to tell you how to unsubscribe from the bot. The standard commands for this action are "/unsubscribe" and "/stop". You can edit or delete this text block.
"Standard response" trigger
It is unrealistic to prescribe chains for all user requests. If the bot does not recognize the user's phrase, it will receive a standard response. It should be a universal message for solving different issues.
You can redirect the client to a chat with the manager. To do this, our chatbot has an "Action" block. Select the "Open Chat" option when building a thread. Communication will continue smoothly, without notifying the user that the chat has been switched to the manager. nine0003 Write in the structure of the bot switching to an employee
Trigger "Unsubscribe from the bot"
If the user enters the unsubscribe command, he will receive a notification that he has successfully unsubscribed. Don't forget to remind him that he can subscribe again by typing "/start" or "/subscribe" - make this message as warm as possible. Continue the line with the personification of the bot in the form of a character, if one already exists.
Creating your own trigger
If you want to create a new trigger, click on the appropriate button in the Bot Structure section. nine0003 Adding a trigger in the Instagram chatbot builder in SendPulse
There are three types of triggers. You can select "After Subscription" and simply specify the time after which the message will be sent. The "Command" type starts the chain when it receives messages from the subscriber with the words that you specify as keywords. Using the "A360 Event", you can send a message to the user in the messenger with a confirmation of the reservation or with information about his order. Read more about this in the knowledge base. nine0003
All the features of the SendPulse chatbot builder
To build a chain in the visual editor, seven blocks are available on the left panel: "Message", "Chain", "Action", "Filter", "API Request", "Pause" and "Random".
Blocks in the thread editorMessage block
You can add the following elements to a chatbot message in SendPulse:
- text;
- emoji;
- picture;
- button with or without link; nine0090 card;
- variables;
- user input;
- quick answers.
Write your message in the text field. You can insert emojis and variables to personalize information. To do this, click on the {} sign in the upper right corner of the field and select the desired variable from the drop-down list. Each user will receive a message with the value of the variable from their contact.
Add variables for personalizationButton is one of the main elements of user communication with a chatbot. Thanks to it, the subscriber sets the direction for the further development of the bot script.
What types of buttons can be added:
- "Continue the chain" - connects the "Message" element with other elements;
- "Link" - sends to the specified address, for example, to an online store;
- "Payment" - allows you to accept payments in the chatbot.
Up to three buttons can be added to one block. There is a 20 character limit for text on it. nine0003 In the SendPulse constructor, it is possible to add a payment button
If you wish, you can diversify the message with visual content by adding pictures or cards in the form of a carousel to it. Cards are very convenient for showcasing products, because you can also add a title and a button with a link to an external source or payment form.
Place cards in a carousel inside blockOf particular interest is the ability to enter user data . You can collect subscriber responses and store them in a variable for later use. nine0003 Add a data entry element for validating and saving subscribers' answers
Read more: "How to set up manual input of user variables"
You can also create quick response buttons under the message so that the user does not enter values, but chooses from the proposed ones. Up to ten quick response buttons are available. For example, you can create multiple quick responses for age, clothing size, city, and so on.
Use quick replies for user convenienceContinuation of the chain
You can connect the "Message" block with other elements using the button or the "Data entry" function. Then the next message will be sent after the user's action. But you can continue the chain without waiting for it. In this case, we recommend adding a "Pause" block to check if the subscriber interacted with the chain and send a message after a certain time.
Read more: "How to continue the chatbot chain without user action"
"Action" block
From the panel on the left, drag this element onto the workspace. Select the desired action.
Check the appropriate actionWhat the “Action” block allows you to do:
- Open a chat - like when a client needs a personal consultation or a manager needs to complete a transaction. After that, a private chat with the page administrator will open. You can set up notifications for the manager via the email used to register with SendPulse, or via web push to the browser. nine0009
- Unsubscribe from the bot - when you need to remove a person from the list of subscribers and no longer send him messages.
- Add tag - for audience segmentation when sending mailing lists - then messages will be more targeted. For example, tag subscriber preferences or some characteristics. Read more - "How to assign tags to chatbot subscribers".
- Delete tag - the tag can be removed if it has become irrelevant for the subscriber. nine0009
- Set variable - set the value of the variable to use the data in the future. This can be order information or personal data that you use to filter the audience for mailings. Saved variables are available in the "Audience" tab in your account.
- Send webhook - configure sending data about the event in the bot chain to your system for further work with this client. Learn more — How to set up webhook sending in chatbots. nine0009
- Create deal — you can set up chatbot integration with your CRM.
Filter block
Allows you to segment subscribers by their personal data and previous messages, as well as create quizzes. You can filter by variable value, presence of a tag, participation in a chain, and receipt of a newsletter.
Filtering by variable value using additional conditionsRead more:
- “How to use the “Filter” element in the chain constructor”
- "Case: Creating quiz chatbots: the correct mechanics of calculating results"
- "Webinar: How to make a quiz in a chatbot"
API Request block
To send a request to a third-party server to create objects or get data that can then be sent in a bot message. This functionality allows, for example: to show the weather in the specified city on request, to find and display information by product name or article in the chatbot, to create an order or register a subscriber to an event based on its data. nine0003 Get information from external sources using the API Request block
Read more: How to send and receive data from external sources
Pause block minutes to 24 hours. You can also pause until a specific date. This allows you to warm up the client, for example, before offering a purchase.
Use the "Pause" block for time intervals between messagesSelect a condition: continue the chain when the user is inactive or always. In the second case, even when switching to another script branch, messages will arrive at the specified time.
Random Block
Suitable for sending randomly selected messages with useful information: tips, interesting facts, planned exercises. With it, you can arrange tournaments and quizzes.
Random selection is also used in marketing research by A/B testing. Analyze test results and improve your chatbot. nine0003 Use the "Random" block to send random items
Read more: "How to use the "Random" element"
More Chatbot Features in SendPulse
There are some more useful features of the Chatbot for Instagram that you you might want to use.
Segmentation of bot messages
You can send campaigns to specific audience categories based on subscriber data. Due to its personalization, such a mailing will bring a greater response
Segment mailings to make them more relevant to recipientsYou can segment by "Subscription Date" - to do this, select a period of time - or by conditions. There are four types of conditions: "Variable value", "Tags", "Participation in the chain", "Received the mailing list".
Subscription widget
To collect bot subscribers, place a subscription widget on the site. Connect widgets for all social networks and messengers to get the best result. Subscription widgets in SendPulse are multi-channel. nine0003 Create a Bot Subscribe Widget
Live Chat
SendPulse's chatbot service allows you to manage chats with your chatbot subscribers in all messengers, including Instagram, through a common unified chat. This is convenient if customers come from different channels.
Correspondence with clients in all messengers in a single live chatSimple yet powerful landing page builder
Create a mobile landing page, an online store or a multilink for Instagram and promote it through chatbots in messengers, email and SMS - all on one platform! nine0003
An example of building a chatbot for Instagram in SendPulse
Now I will show how to create a chatbot on Instagram using a simple bot for a cosmetics store as an example:
Bot scheme in the visual editorLet's take a step-by-step look at what needs to be done to build such a chain in SendPulse. For simplicity, I will not build it from scratch, but will edit the welcome series. In the process, we will also create new chains. nine0003
Set up the starting block
In the text field of the "Message" block, enter a greeting.
We write a greeting messageI click "Add", I select the element "Picture". I'm uploading an image.
Adding a picture to the bot's messageNext, I add a new text field to the block and fill it in. I click "Add button". I need three buttons: "I want to place an order", "I need a consultation" and "I want to attend a master class".
Adding buttonsCreating the following messages
Drag the "Message" blocks from the panel on the left - three times, for each of the answer options. We add the elements necessary for the logic of the bot.
Moving new blocks of messages to the working areaI want to place a button in the block that leads to the site. To do this, under the text of the button, I mark "Link" and enter the site address. In the visual editor, the presence of a link is displayed as chain links.
Inserting a linkClicking on the button will take the user to the site.
Also in each of the blocks I create another button with the inscription "Back to questions" - it is necessary to give users this opportunity. nine0003
To do this, you need to create a new chain. I return to the "Bot Structure" section, select "Saved", click "Create a chain".
Create a new threadThe "Back to Questions" button should lead to a block where there are two other options besides the one the user has chosen. For example, first he clicked "I want to place an order." Then he returned to the questions and chose the option with a master class. Then I pressed “Back” again and asked for a consultation. Then his path will look like this:
It is necessary to take into account all options for user actionsSave the chain. I create a chain for each button from the welcome message. Back to the hello series.
From the left pane, I drag the Thread element into the workspace, which will launch another series of messages, one of the ones we just made. I open the block and select the chain I need.
Selecting the chain to runConnecting to the previous message. I repeat the steps for the remaining blocks.
At the stage where the user asks for a consultation, you need to open the chat, as shown above. Drag the "Action" block, select "Open chat". The manager will be notified that he needs to go to the chat with the client. nine0003
The result is a bot, the scheme of which you saw at the beginning of the section.
Conclusion
Chatbots on Instagram can make life easier for yourself and your employees. The SendPulse builder makes it easy to create chatbots for any purpose, and our knowledge base contains detailed explanations that are supplemented along with the expansion of functionality.
Set up Instagram chatbot marketing in conjunction with other channels. We have chat bots for Telegram, WhatsApp, VK, Facebook. An integrated approach will give you the best results. nine0003
Create an Instagram chatbot for free | SendPulse
Convert Instagram Followers into Loyal Customers
How to Set Up an Instagram Chatbot Marketing with SendPulse Features:
Promote Your Instagram Direct Chatbot with Ads
Share your products and services with Instagram- bot, and to attract users to it, run targeted ads with the goal of "Instagram Direct". Set up a welcome message in your Facebook ad account and add triggers to start chains. The user will select the answer that is relevant to him and go through the message chain. And if you need advice, connect the manager to the correspondence. nine0003
Accept payment
Everything for effective work with chats on Instagram
Create a bot for Instagram
Instagram Chatbot Management Mobile App
Reply to your followers using the mobile app so you can manage multiple chats and manage your chatbot on the go.
FAQ
How to create a chatbot on Instagram? nine0106
Log in to your SendPulse account, go to the Chatbots section, and connect to your Instagram page to set up the chatbot.
Who needs an Instagram chatbot and why?
Chatbot is useful for any business. If you accept and process dozens or hundreds of direct orders, receive the same questions from leads and customers every day, delegate these tasks to a chatbot. Thus, you do not have to hire a person to work with Direct, because these routine processes can be easily automated. nine0003
How does an Instagram chatbot work?
You need to pre-write chatbot scripts for various subscriber actions, for example, placing an order, exchanging, returning, answering frequently asked questions. Now, every time the user performs the target action, the chatbot will automatically respond to him according to your scenario without your participation. It will also send customer data to CRM and sort by the filter you set. nine0003
What are the benefits of an Instagram chatbot?
By creating a chatbot, you do not have to hire an order processing manager in direct, which can significantly save your budget. The chatbot works 24/7 and seven days a week, which provides an instant response to each user. Consequently, you will be able to increase the number of sales, since the buyer will not have to look for another store where they will respond faster. nine0003
How do I set up welcome and other automatic message threads?
To set up an automatic message thread, first set the desired trigger for sending it - this can be a keyword that the user writes in a chat or a specific event, such as a subscription to a page. Next, write down the message script and sending conditions for each auto-reply. nine0003
How to invite managers to your SendPulse account for teamwork?
Go to "Account Settings" in the "Users" tab and click "Invite User". Read detailed instructions on granting access to your SendPulse account.