Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I want get all following and followers by username #1780

Closed
3 tasks done
refaldyrk opened this issue May 20, 2024 · 4 comments
Closed
3 tasks done

I want get all following and followers by username #1780

refaldyrk opened this issue May 20, 2024 · 4 comments
Labels
question unconfirmed This issue hasn't been read/confirmed/accepted by an admin

Comments

@refaldyrk
Copy link

refaldyrk commented May 20, 2024

Form

Put an [x] if you meet the condition, else leave [ ].

Question

I try to get all followers and following and got some error

Code

A meaningful section of your code (else delete this). If you are using TypeScript replace js with typescript.

import { IgApiClient } from 'instagram-private-api';

const ig = new IgApiClient();
ig.state.generateDevice(process.env.IG_USERNAME);
ig.state.proxyUrl = process.env.IG_PROXY;
(async () => {
    await ig.simulate.preLoginFlow();
    const loggedInUser = await ig.account.login("", "");
    process.nextTick(async () => await ig.simulate.postLoginFlow());
    try {
        let id = await ig.user.getIdByUsername("efalrk");
        let usersFollowers = await ig.feed.accountFollowing(id).items()

        console.log(usersFollowers)
    } catch (e) {
        console.log("Error: " + e)
    }
})();

async function searchFolowing(username) {
    let id = await ig.user.getIdByUsername(username);
    let usersFollowers = await ig.feed.accountFollowing(id).items()

    console.log(usersFollowers)
}

image

Error and Output

node:internal/process/promises:289
            triggerUncaughtException(err, true /* fromPromise */);
            ^

IgNotFoundError: GET /api/v1/fbsearch/suggested_searches/?type=users - 404 Not Found;
    at Request.handleResponseError (C:\Users\pcdev\OneDrive\Documents\instagram-data\node_modules\instagram-private-api\dist\core\request.js:103:20)
    at Request.send (C:\Users\pcdev\OneDrive\Documents\instagram-data\node_modules\instagram-private-api\dist\core\request.js:54:28)
    at async FbsearchRepository.suggestedSearches (C:\Users\pcdev\OneDrive\Documents\instagram-data\node_modules\instagram-private-api\dist\repositories\fbsearch.repository.js:7:26)

Node.js v20.12.1
@refaldyrk refaldyrk added question unconfirmed This issue hasn't been read/confirmed/accepted by an admin labels May 20, 2024
@huojiecs110
Copy link

It seems that you can only get all the followers of your own account, right? Can’t you get all the followers of other people?

@refaldyrk
Copy link
Author

I want to get followers of other people's accounts with their usernames, is this possible?

@huojiecs110
Copy link

I want to get followers of other people's accounts with their usernames, is this possible?

I tested it and it seems that this API can only get one page of data~ because there is no nextMaxId in the returned data.

@refaldyrk
Copy link
Author

ok thanks for your help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question unconfirmed This issue hasn't been read/confirmed/accepted by an admin
Projects
None yet
Development

No branches or pull requests

2 participants