For a long time I was interested in automating an instagram account. From uploading photos, to obtaining suggestions / similar accounts from a user.

This has led me to make many attempts … Even with the original api, which was very serious mistake. I tried scrapy and seleium in python, also puppeteer in nodejs. None of that gave the result I expected, some due to slowness, others due to unexpected errors. I lost interest because of this and other problems.

But with new knowledge, new doors open.

There is a user on github who is developing a custom instagram api, that piece of software is called instagram-private-api developed by dilame and of course you don’t need instagram api credentials, only your instagram username and password.

I know what you’re thinking, is it safe to give my password to a private service?

In a case like this, YES, the project is open source and does not save, or send passwords anywhere, it is completely safe and if you do not believe me, you have the code there to read it.

If you are a novice or not very experienced programmer, using this project can be a bit tedious, due to the lack of extensive documentation.

That is why we are going to use a project that uses instagram-private-api and makes things much simpler, this project is called tools-for-instagram and is being developed by linkfy.

Let’s start with the code

Let’s start by creating a folder anywhere on our computer and starting our npm init

npm init --yes

First of all we install our packages via, we can run this in our terminal

npm install tools-for-instagram -s

Once installed, we have to create our .env file that will contain our username and password

sample of .env file

We will define the actions that our bot will perform