How to instagram DM with a bot?
Have you ever wondered how to automate Instagram direct messages with a bot?
You're in luck! In this guide, you'll learn how to make a bot that automates direct messages on Instagram without a single line of code. What's more, you'll pick up skills that empower you to automate just about anything on the web. How awesome is that? 🚀
# Why would you build a bot to automate Instagram direct messages?
Wouldn't it be great if you could sit back and let your computer do all your work for you? Well, now you can! Get all the engagement of a personal DM while expending all the effort of falling asleep in your chair.
Let’s be real though, there’s a bit of a learning curve to setting up a bot. Even so, we reckon it’s worth it. One member of our community put it like this: “If you don’t have a bit of time to invest this is not for you if you do this is the best thing you will ever encounter LEGIT!”.
If you’ve used a tool like Zapier before, then you should find it no sweat to program a bot for Instagram without coding. This guide takes you through the steps for creating a bot that will automate your most tedious Instagram tasks!
# What exactly is a bot?
A bot is like a robot's software cousin. A bot, like a physical robot, requires instructions to understand how to do the job. In this case, you'll give the bot a set of instructions instructing it in the ancient art of automating Instagram direct messages.
Check out our blog on what are bots to learn more.
# How are bots made?
With Axiom's no code bot builder, you can create bots for Instagram direct messages without having to code. Use a simple point and click interface to create as many bots as you want!
If you follow the steps below, you'll have a working bot by the end of this article.
# How do bots automate posting to Instagram?
Your bot will automate the same web actions you use to send an Instagram DM. Bots operate in the same manner as humans: opening a browser window, visiting a user's profile, and clicking the DM button.
# Will my Instagram account get blocked?
It could if you’re not careful and respectful! Instagram limits direct messaging, so if you created an army of bots automating Instagram 24/7, you would be blocked.
We believe that bots should be used responsibly and should not be used to spam websites or degrade the experiences of other users. To avoid being blocked, familiarise yourself with Instagram's rate limits (opens new window) and do not exceed them. Don't use Axiom to take advantage of the system!
# Let’s learn how to build a bot!
# 1. Install Axiom in your chrome browser
If you haven’t yet installed Axiom, and created an account please goto the chrome store and install Axiom now (opens new window).
By the way, we give all new users 2 hours of runtime. This means you can build and run this bot a few times on us 🙂
# 2. Set up your Google Sheet
Create a new Google Sheet. You can do this in your Chrome browser by entering 'sheet.new' into the address bar. Handy!
First name your sheet 'Automate posting DMs on Instagram’, then add three new tabs to the sheet titled 'User', ‘Messages’, ‘Sent’ and ‘Not sent’
Now in the ‘User’ tab add a Instagram users you would like to test with.
Finally, in the ‘Messages’ add the text of your message you want to send.
# 3. Launch Instagram and open Axiom
First, open your Chrome browser and log into Instagram. Then launch Axiom and click the '+ New Automation' button. You'll now begin combining steps to create your Instagram automation.
# 4. Start from blank
To build your bot from scratch, click on 'Start blank.'
This will open the step selector, so you can start adding steps to your bot.

# 5. Add your first step, ‘Read data to a Google Sheet’
Using the Step Finder to search for ‘Read data to a Google Sheet’ and click on it. The step will be added to Axiom for you to configure.
In the field called 'Spreadsheet URL', you can search for the Google Sheet you created by name. Once found, click on it to select.
For 'Sheet name' click on the drop-down and select the tab 'User' with the links to Instagram user profiles.
On the 'First cell' field, toggle the switch and enter 'A1. This setting tells the bot where to start reading data.
On the 'Last cell' field, click the toggle switch and enter 'A1'. You have limited the bot to read a single row. If you wanted to post two posts concurrently, you could change this setting to A2.
If you want to learn more about Google Sheet steps watch these videos

# 6. Add an ‘Interact with a page's interface’ step
Click the 'Add a new step' button below the ‘read’ step. Using the Step Finder click on 'Interact with a page's interface' to add the step.

In the ‘Go to Url’ field, click the yellow drop-down menu and select ‘google-sheet-data.’ You should now be connected to the Google Sheet from Step 1, which will pass the Instagram profile URL into the ‘Interact’ step.

Inside the Interact step, click on the 'Add a sub step' button. The Interact step features a set of sub steps for automating browser actions like clicking a button or entering text into a form - sounds like what we’re after!
Now switch back to your browser, and navigate to an Instagram user profile you can message. You want the ‘message’ button to be visible on the page so you can continue building the automation.
Re-open Axiom and add a 'Get data from a webpage’ sub step.

Click the 'Select' button and use Axiom’s no-code selector tool to highlight ‘message’ and confirm. Will will scrape this data so we can decide if a DM can be sent or not sent.
# 7. Add ‘Conditionally jump to another’ step
Click the 'Add a new step' button below the 'Interact step’ step. Using the Step Finder search for 'Conditionally jump to another' and click to add.
In Step 6 we scraped the text from the Message button. In this step, we'll check the scrape results to see if that text is present. If it's there, then we'll goto the next step and send a Direct Message. If it's not there, we won't send a message and will jump to Step 11.
In 'Data to check’ select ‘all-interaction-data’.
Then in 'Words to check’ type ‘message’ and set ‘Word matching mode’ to ‘Any’.
Set ‘Jump step’ to 7, then tick 'reverse condition’.

# 8. Add another ‘Interact with a page's interface’ step
Click the “Add a new step” button below the 'Conditionally jump to another' step. Using the Step Finder find 'Interact with a page's interface' and click to add.
In the “Go to Url” field, click the yellow drop-down menu and select “Google-Sheet-Data.” You should now be connected to the Google Sheet from Step 1, passing in the Instagram profile URL into the ‘Interact’ step.
Add the 'Click element' sub step. Then, click on 'Select' and use our selector tool to highlight the ‘Message’ button on Instagram. Click “Confirm”.
Add a new sub-step ‘Wait’ and enter 2000 - this is to allow enough time for Instagram to finish its business after you click the button.
Next, add a new sub-step called “Enter text”. Do not click “Select” or choose the field - the cursor will already be inside the comment field when it loads.
In the 'Text' field ****enter you message do not use spaces as they return the message.
Next, add a new step called 'Key Press'. Click Record, then press Return, then click Stop Recording. We recommend disabling this sub-step until we are ready to DM. The key press sends the direct message.
To disable the step, click the menu icon to the right of the step header and select “Disable step”.
Add a new “Wait” sub-step and enter 2000.

# 9. Add a step ‘Write to Google Sheets’ to track DM’s sent
Click the 'Add a new step' (not a sub step) below the ‘Interact’ step and choose ‘Write to Google Sheets’.
In the 'Spreadsheet URL' field, search for the sheet you created at the start of this tutorial.
In the 'Sheet Name' field, select the tab called 'Sent'. This tab will keep a record of the DM's sent.
No in the 'Data' field select 'google-sheet-data'.
Toggle 'Clear data before writing | Add to existing data’ to 'Add to existing data’.
In this part, the Instagram URL we initially selected from the google sheet will be added to the “Sent” sheet of the automation. Smart!

# 10. Add ‘Jump to another step’ step
Add a new step 'Jump to another step', this jump will always occur without any conditions.
Set 'Jump to step' to 8.

# 11. Add a new step 'Write to Google Sheets' to track DM’s not sent
You may remember that earlier we did a little trick to scrape the instagram “Message” button and jump down if we didn’t find anything. Well, this step is where we jump to!
Here we will track those users to whom a message could not be sent.
Click 'Add a new step' below the last 'Jump to another step' step and select 'Write to Google Sheets'.
In the 'Spreadsheet URL' field, search for the sheet you previously created at the start of this tutorial.
In the 'Sheet Name' field, select 'Not sent'.
In the 'Data' field select 'google-sheet-data'.
Toggle 'Clear data before writing | Add to existing data' to 'Add to existing data'
As before, this will take the Instagram page URL that we scraped from our sheet initially and store it in a new tab, but as we jumped here when a message could not be sent it will be added to the 'Not Sent' tab instead. Incredible!
# 12. Add “Delete rows from a Google Sheet” step**
Add the step 'Delete rows from a Google Sheet' to delete the row of data that has been used to send the DM. This is to prevent messages from being repeatedly sent to the same users, which would be bad and annoying and would probably get you in trouble.
Using the Step Finder, search for and click “Delete rows from a Google Sheet” in 'Spreadsheet URL' to add the spreadsheet.
Then, in 'First row to delete' enter the number 1 and repeat this in 'Last row to delete', so that both are set to 1.
Set the “Sheet name” to “User”.

# 13. Add the final “Jump to another” step
All this up to now has processed one row from the sheet, but sending one message only gets you so far. We want to have the bot loop through our list and go and do something better with our lives.
To do this, add the step 'Jump to another step' below the last “Delete” step. The idea here is to jump the bot back to step one, repeating the automation. Set 'Jump to step' to 1.
Here we can also control the amount of DM’s sent by the bot in one go. In 'Maximum cycles' set the amount of loops you want the bot to do.
It may be tempting to set this to some ludicrously high number and have the bot run all day and night while you down a few cold ones. Sadly, this will not work for a couple of reasons: one, Instagram has a high chance of getting annoyed with you and blocking you; and two, you will hit the run limit on your Axiom account and your automation will be stopped. It’s best to set this to a reasonable number and run the bot multiple times, leaving plenty of time in between each run.
We’re almost done. The last step is click on the gear icon, select the tab 'Continue on error', and tick the box. This will let the bot continue even when an error occurs. You will see a warning generated for every page that doesn’t have a message button, but it won’t stop running when this happens.
Well done! The bot is ready to test 👍
# Try sending a DM on Instagram to see if it’s working the way you want
Before you do a test run, make sure you’ve disabled the sub-step ‘Key press’ to stop the DM’s from being sent. If not, do that now.
It's best practice to test every bot to check it’s production-ready. With the ‘Post’ button disabled, you can do a test run that will not send a post.
We recommend test running your bot with the desktop app, but you can also do it in the cloud.
Make sure that you confirm your message is successfully entered and the logic is working as you expect.
Go ahead and click ‘run’. Get ready for some magic.
# Fix any issues
If you experience any issue with the bot not clicking buttons, try re-selecting the button or text input. To change the selection, move the cursor slowly over the object and re-select.
The 'Click' step also has a handy feature that allows you to select the button by the text, which can resolve many issues. Just click the “Use element text” button and see if that helps you out.
If you see this overlay don’t worry the bot should still enter the text and send the message. An additional click step could be added to remove it.
Don't forget we have excellent customer support. If you need help, get in touch. https://axiom.ai/customer-support
# Conclusion
You have learned how to use an Instagram direct message bot, sure, but you also have the knowledge to do so much more! Now that you have used an 'Interact' step, automated clicks and key presses, you can build a bot to automate virtually any web app. Remember those jumps steps too - with those in your pocket you’ll be a bot master in no time. Go you!
# If you are interested in automating Instagram you may want to visit these pages:
Automate Instagram posts video