Skip to content

Instantly share code, notes, and snippets.

@Nerixyz
Created July 6, 2019 18:14
Show Gist options
  • Select an option

  • Save Nerixyz/36b3928b81819fe8b755d1a09e2649b1 to your computer and use it in GitHub Desktop.

Select an option

Save Nerixyz/36b3928b81819fe8b755d1a09e2649b1 to your computer and use it in GitHub Desktop.
insta-api-demo
const IgApiClient = require('instagram-private-api').IgApiClient;
const ig = new IgApiClient();
ig.state.generateDevice(process.env.IG_USERNAME);
// you'll have to define IG_USERNAME and IG_PASSWORD
(async ()=>{
const response = await ig.account.login(process.env.IG_USERNAME, process.env.IG_PASSWORD);
console.log(response);
})();
{
"name": "insta-api-demo",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {},
"author": "",
"license": "ISC",
"dependencies": {
"instagram-private-api": "^1.16.0"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment