Cover image for JavaScript INSTAGRAM bot

JavaScript INSTAGRAM bot

danijelajs profile image Danijela.js๐Ÿ›ธ ใƒป1 min read

You know a little bit of JavaScript, and you want to build your following on Instagram, but don't want to share your password with some app, and you don't know BackEnd?! Don't worry, I got you fam! ๐Ÿ˜

I'm gonna show you how to build your personal instagram "bot" ๐Ÿ˜

  1. First, open Instagram in a new tab, log in, then type the hashtag you want, open the first image.

  2. Now you are gonna inspect the โค๏ธ button, the browser console will open, and you will see the class of the button. Usually you have to use the second or third class.

  3. Open the console. Create a variable by the name like, and do the same for the arrow pagination โžก๏ธ, calling the variable next. Access the button element and the pagination with querySelector.

  4. Now use the setInterval method.

  5. Using the if statement, if there is a like button add a click event for the button. Then add another click event for the pagination.

  6. Because Instagram likes to ban accounts with "strange" activities, set the interval to 15-20 seconds. And Voilร !

You now have your personal bot without "sharing" your password. You can use this for following people on instagram, or maybe on some other social media. It's up to you!

Btw I'm not sure if this classifies as a BOT, but it will help ๐Ÿ˜

Posted on Jul 20 '19 by:

danijelajs profile



FrontEnd developer React.js/JavaScript/CSS/HTML/ Redux/JQuery/Firebase/etc. ๐Ÿ“ฉ๐™™๐™–๐™ฃ๐™ž๐™Ÿ๐™š๐™ก๐™–๐™›๐™ช๐™จ๐™ ๐™ค@๐™ฎ๐™–๐™๐™ค๐™ค.๐™˜๐™ค๐™ข


markdown guide

I tried it and it worked... in the first photo, then in the second photo seems like the html that shows the pic and the like button, is destroyed and built again in a few seconds, so in the second photo it did the like.click() somewhere else but not in the second photo...but the next.click() works nice cause these a 'buttons' are not destroyed and changes to the next pic. Besides this, i found it very clever and fun. Can you confirm if my theory is true?


I'm not sure what you mean by "destroyed" ๐Ÿ˜‚ But when ever you click on the tab, it will load the code again. It's set to like every 20 seconds.


YES this one is working very good thanks for sharing @danijelajs and @jiwebdev


This is so "simple" yet highly clever!
I've never though on messing around with the Instagram webapp in this way.



Thanks!๐Ÿ˜Š People don't use the browser console too often. You can do a lot of things with it, you just need a little bit of imagination ๐Ÿ˜Š


API was the first thing that comes into my mind when I heard making bot. Then getting API keys, setting up server, hundred lines of codes bla bla. But this is a clever simple way. Thank you.


I know. It doesn't require any Back-End knowledge, it's "easy peasy lemon squeezy"๐Ÿ‹๐Ÿ˜ Thanks, you are welcome. I'm glad I helped someone ๐Ÿ˜Š๐Ÿ‘๐Ÿป


Can you tell what this code or ur bot will do as am also a newbie.


This worked like a charm! But it looks like IG has picked up on the behaviour and started blocking the action from running :(


They probably just changed the class name. That's why you have to use the browser console.


Hmmm, I'll take a look once they lift my block. Thanks for the tip! :)


Most of the instagram bots do not work anymore. The only instagram bot which works now is InstaCaptain.com . All the other Instagram Bots are now outdated and easily detected.


This is not really an instagram bot. Just a piece of code to use in browser console. So it works. Are you trying to advertise your own app here?


I'm trying it out, sorry I'm new to this stuff, but I wasn't successful at setting it up. I keep getting Uncaught TypeError: Cannot read property 'click' of null


You have to type a hashtag in the search bar on insta, then open the first image, open the console.There is an image of the code here, just copy the code to the console, it should work.Good luck!๐Ÿ€๐Ÿ˜Š