Socket
Socket
Sign inDemoInstall

instagram-web-api-node

Package Overview
Dependencies
23
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    instagram-web-api-node

Instagram web api nodejs.


Version published
Maintainers
1
Created

Readme

Source

instagram-api-web

Recode from :

  • https://github.com/dilame/instagram-private-api
  • https://github.com/jlobos/instagram-web-api

How to install

npm i instagram-web-api-node

How to use

const { IgApiClient } = require("instagram-web-api-node");
function save(data){
  let cookie = JSON.stringify(data); 
  //save cookie to file or database after 
  //code save
  return cookie;
}
(async () => { 
  try {
      const instagram = new IgApiClient();
      // This function executes after every request
      instagram.request.end$.subscribe(async () => {
        const serialized = await instagram.state.serialize();
        save(serialized); 
      });
      //set login account
      const { username, password } = process.env; 
      //Get access token for headers default. (Just for login without cookies)
      await instagram.ig.setCookieForFirst(); 
      //login use account username and password
      await instagram.ig.login(username, password);
  } catch (error){
      console.log(error.name)
  }
})();
const { IgApiClient } = require("instagram-web-api-node");
(async () => { 
  try {
      const instagram = new IgApiClient();
      await instagram.state.deserialize(cookie); //cookiejson
      
      const follow = instagram.ig.follow(userid);
  } catch (error){
      console.log(error.name)
  }

<<<<<<< HEAD

=======

61930590ac41950bd55210f5af9fb951554311d5

Keywords

FAQs

Last updated on 09 Nov 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc