Instagram-private-api: How to get 15,000 followers?

Created on 1 May 2017  路  4Comments  路  Source: dilame/instagram-private-api

Hi, I want 15,000 followers using the AccountFollowers method, but it always returns 7500, why?

this.auth('login', 'password').then(async session => { 
        let account = await Client.Account.searchForUser(session, 'myderbent_plus'); 
        let feeds = await new Client.Feed.AccountFollowers(session, account._params.id, 400);
        feeds.get()
            .then(res => {
                let followers = [];
                for (let item of res){
                    followers.push(item._params.id.toString());
                }
                console.log(followers.length) // result: 7500
            })
    });

As seen above, I use the .get() method, but when using .all() the result is the same. How can I get the right number of followers?
If you even make a limit of 400, it still gives out 7500.

Most helpful comment

I have a similar issue with UserMedia, the this.limit set to "2" doesn't have any impact of the length of the resulting feed, which is for UserMedia always "12".
Seams like a deeper cause in the API or even on Instagram side.

All 4 comments

I have a similar issue with UserMedia, the this.limit set to "2" doesn't have any impact of the length of the resulting feed, which is for UserMedia always "12".
Seams like a deeper cause in the API or even on Instagram side.

i have the same problem, i have 566 followers and i get only 194

function getFollowers(session) {
    return new Promise((resolv, reject) =>  {
        let feed = new Client.Feed.AccountFollowers(session, '****');
        let originalCursor = feed.getCursor();
        console.log(feed.isMoreAvailable()) // false
        feed.get()
        .then((data) => {
            followers = data.map((user) => {
                return user.params.id;
            });

            return resolv(followers);
        })
    })
}

@GNURub

function getFollowers(session) {
const feed =  new Client.Feed.AccountFollowers(session, '****');
feed.map = item => item.id;
return feed.all();
}

@huttarichard Hello, thank you for great module, could you help a little bit?
I tried to get all followers, but app crashes because of large data. (about 10k) I tried to use sockets and send data to frontend partially, but it didn't help. It crashes, I think because of lack RAM
What I did wrong?

    Client.Session.create(device, storage, process.env.USERNAME, process.env.PASSWORD)
        .then(function (session) {
            const feed = new Client.Feed.AccountFollowers(session, accountId, process.env.FOLLOWERS_LIMIT)
            feed.allResults = 0; // Initial value. Empty array by default.
            feed.reduce = (accumulator, chunk) => {
                var result = [];
             // save id's to array and send it to frontend
                chunk.forEach(element => {
                    result.push(element._params.id);
                });
                accumulator += chunk.length;
                socket.emit('news', { followers: result, accumulator: accumulator });
            }; // accumulator is feed.allResults
            feed.on('data', results => console.log(feed.allResults)) // here will be total amount of collected items every request.
            return feed.all() // here will be total amount of collected items in the end.
        })
        .then(function (data) {
            response.status(200).send({ data: data });
        }).catch(function (error) {
            var message = 'Sorry, something went wrong.';
            response.status(500).send({ data: message });
        });
Was this page helpful?
0 / 5 - 0 ratings

Related issues

zalkanorr picture zalkanorr  路  12Comments

theonlygusti picture theonlygusti  路  11Comments

ozican picture ozican  路  143Comments

DenisKrsk picture DenisKrsk  路  33Comments

prichey picture prichey  路  10Comments