jlobos / instagram-web-api

🤳 Instagram Private Web API client for Node
https://npmjs.com/instagram-web-api
MIT License
1.12k stars 186 forks source link

How do you fetch all followers #290

Open S-codes14 opened 2 years ago

S-codes14 commented 2 years ago

I'm sorry, I even sound stupid asking this, but how do you fetch all the users following the user, I have tried to implement it but only get 47 users back:

exports.instagram = async (username1) => {
  await client.login();
  const user = await client.getUserByUsername({ username: username1 });
  // first: user.edge_followed_by.count
  const followers = await client.getFollowers({
    userId: user.id,
    first: user.edge_followed_by.count,
  });
  const data = followers.data

  t = data.map((follower) => {
    return(follower.username)
   });
   console.log(t.length)
   return(t)
};