Skip to content

[BUG] 404 ClientNotFoundError on new /auth_platform/ Instagram challenge endpoint during login #2333

@autoreacher-johannes

Description

@autoreacher-johannes

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

Describe the bug
Some Instagram accounts fail to log in because instagrapi attempts to resolve a challenge using a new Instagram endpoint:
/auth_platform/?apc=

This endpoint returns 404 Not Found, which triggers ClientNotFoundError before the challenge handler can run.
It appears Instagram is rolling out a new challenge flow that instagrapi does not yet support.

To Reproduce

from instagrapi import Client

cl = Client()

cl.set_proxy("http://user:[email protected]:5000")
cl.challenge_code_handler = codechallengehandler

cl.login(username, password)

This triggers a challenge for some accounts → instagrapi tries /auth_platform/ → Instagram returns 404 → login fails.

Traceback

[INFO] POST /accounts/login/ -> 400
[INFO] GET /auth_platform/?apc= -> 404
[WARNING] Endpoint /auth_platform does not exist

instagrapi.exceptions.ClientNotFoundError: 404 Client Error: Not Found for url:
https://i.instagram.com/api/v1/auth_platform/?apc=

During handling of the above exception:
...
File "app.py", line X, in
cl.login(username, password)
File ".../instagrapi/mixins/private.py", line 461
raise ClientNotFoundError(e, response=e.response, **last_json)

Expected behavior
• Login should succeed, or
• If a challenge is required, instagrapi should call the challenge handler (email/SMS).
• Instead, the new /auth_platform/ challenge type causes a hard failure.

Desktop (please complete the following information):
• OS: Linux (Docker)
• Python version: 3.11
• instagrapi version: 2.1.2
• moveipy: Not used
• imagemagick: Not used

Additional context
• Only some accounts are affected (likely accounts without existing sessions).
• Instagram appears to be rolling out a new internal authentication platform flow.
• /auth_platform/ is not supported by instagrapi’s challenge_resolve().
• Temporary workaround:

from instagrapi.exceptions import ClientNotFoundError

try:
cl.login(username, password)
except ClientNotFoundError as e:
if "auth_platform" in str(e).lower():
print("Manual in-app verification required")

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions