DEV Community

Ankan Saha
Ankan Saha

Posted on

Automate instagram with nodejs

Assuming you already have a node.js server set up, you can automate your instagram posts with the instagram-node module.

First, install the module with npm:

npm install instagram-node

Next, create a new file called instagram.js and require the module:

var ig = require('instagram-node').instagram();

Now, you will need to configure the module with your instagram access token. You can get this by creating a new instagram application and following the directions here:

https://www.instagram.com/developer/authentication/

Once you have your access token, set it in the instagram.js file:

ig.use({ access_token: 'YOUR_ACCESS_TOKEN' });

Now you are ready to start making calls to the instagram API. For example, to get a list of recent media for a user, you would use the user_self_media_recent method:

ig.user_self_media_recent(function(err, medias, pagination, remaining, limit) {
// your code here
});

There are many other methods available in the instagram-node module that you can use to automate your instagram posts. For more information, check out the module's github page:

https://github.com/instagram/instagram-node

Top comments (0)