instagrapi: [BUG] Error 400 when logging in

Try Instagrapi SaaS with a free trial https://hikerapi.com/p/5GBWznd3

Describe the bug When attempting to log-in a error code 400 is given.

To Reproduce

cl = Client()
cl.login("", "")   

Traceback

Traceback (most recent call last):
  File "/usr/local/lib/python3.11/dist-packages/instagrapi/mixins/private.py", line 359, in _send_private_request
    response.raise_for_status()
  File "/usr/lib/python3/dist-packages/requests/models.py", line 1021, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://i.instagram.com/api/v1/accounts/login/

Traceback (most recent call last):
  File "/home/bot.py", line 13, in <module>
    cl.login("", "")       
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/instagrapi/mixins/auth.py", line 441, in login
    logged = self.private_request("accounts/login/", data, login=True)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/instagrapi/mixins/private.py", line 541, in private_request
    raise e
  File "/usr/local/lib/python3.11/dist-packages/instagrapi/mixins/private.py", line 526, in private_request
    self._send_private_request(endpoint, **kwargs)
  File "/usr/local/lib/python3.11/dist-packages/instagrapi/mixins/private.py", line 448, in _send_private_request
    raise UnknownError(**last_json)
instagrapi.exceptions.UnknownError: We couldn't find an account with the username ########. Check the username you entered and try again.

Expected behavior The login process to successfully occur

Desktop (please complete the following information):

  • OS: Ubuntu 21.04
  • Python version 3.8.3
  • instagrapi version (latest)

About this issue

  • Original URL
  • State: open
  • Created 5 months ago
  • Reactions: 10
  • Comments: 38

Most upvoted comments

UnknownError We couldn’t find an account with the username rezavishkaa. Check the username you entered and try again.

Recently, I am getting this error.

I’ve seen this error in the past when trying to log in to my account in the app, just like the screenshots above, with nothing related to the libraries. Seems like sometimes the database sharding on the ig server side doesn’t properly update. Doesn’t seem to be on our end =( I’d wait for a few hours. Is this for fresh logins only? Has anyone tried with existing cookies/session?

Old account is fine with fresh login and with existing session. New account doesn’t work.

UnknownError We couldn’t find an account with the username rezavishkaa. Check the username you entered and try again.

Recently, I am getting this error.

Friends, Instagram no longer uses old versions of accounts/login. There is a new login method. Now I am logging in with the new method. Instagram is no longer functional. Those who want to buy my method should contact @phpkertenkele on telegram.

Much better to wait for admins to update 😃

administrators will not be able to solve this. 😃

lol, common. Stop spreading false news. And yes they will. I will send them solution

Much better to wait for admins to update 😃

administrators will not be able to solve this. 😃

telegram-cloud-photo-size-5-6167809028785289738-y

Hey Everyone GoodNews!

I got the fix, I have tried this 5 accounts. It worked.

You have noticed that when you try to login the same account on instagram app you face the error right?

So I thought it’s an issue from instagram ends. Yesterday someone told in github.

I was randomly trying different method but nothing worked, I tried changing headers but didn’t work.

I tried bruteforcing the login function. My account got logged in after exact 20 request on each of the 5 accounts. I think instagram servers are not getting updated properly but when request 20 times it updates it

Please someone try and let me know. I was constantly working from 24 hours to figure the bug.

UnknownError We couldn’t find an account with the username rezavishkaa. Check the username you entered and try again.

Recently, I am getting this error.

Much better to wait for admins to update 😃

administrators will not be able to solve this. 😃

lol, common. Stop spreading false news. And yes they will. I will send them solution

Thank you, is it possible to share this in the Telegram group or here? Since we can’t contact anyone, we can at least use it until it’s updated.

UnknownError We couldn’t find an account with the username rezavishkaa. Check the username you entered and try again.

Recently, I am getting this error.

I also encountered this problem.Any idea how to solve it?

Here’s now working just fine. Very odd behavior from the ig server side.