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

API Endpoint not found #1770

Open
RodrigoSKohl opened this issue Apr 9, 2024 · 3 comments
Open

API Endpoint not found #1770

RodrigoSKohl opened this issue Apr 9, 2024 · 3 comments
Labels
bug unconfirmed This issue hasn't been read/confirmed/accepted by an admin

Comments

@RodrigoSKohl
Copy link

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

I am getting this error after pos-login, I can get around this by commenting out the lines

// () => this.client.fbsearch.suggestedSearches('users'),
// () => this.client.fbsearch.suggestedSearches('blended'),

the problem is that when doing this, when sending some messages through the API my account receives a 3 day restriction on sending messages

@RodrigoSKohl RodrigoSKohl added bug unconfirmed This issue hasn't been read/confirmed/accepted by an admin labels Apr 9, 2024
@haneenmahd
Copy link

I can confirm this and this doesn't happen after I remove the post login flow execution in my case:

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

dotenv.config();

const ig = new IgApiClient();
ig.state.generateDevice(process.env.IG_USERNAME);
(async () => {
    await ig.simulate.preLoginFlow();
    const loggedInUser = await ig.account.login(process.env.IG_USERNAME, process.env.IG_PASSWORD);
    // process.nextTick(async () => await ig.simulate.postLoginFlow());
    const userFeed = ig.feed.user(loggedInUser.pk);
    const myPostsFirstPage = await userFeed.items();;
    console.log(myPostsFirstPage[0])
})();

@broskisworld
Copy link

Same here. Removing the ig.simulate.postLoginFlow() removed the error for me but I worry that may end up having other side effects / increasing likelihood of bot detection.

@haneenmahd
Copy link

Yes, that does cause other side effects. The API becomes pretty unusable after removing that.

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

No branches or pull requests

3 participants