Instagram Signup using python requests

Question:

I am trying to create a instagram account using python and requests, when i send the last request to confirm the account creation it return : {"account_created": false, "errors": {"ip": ["Lu2019adresse IP que vous utilisez a u00e9tu00e9 signalu00e9e comme un proxy ouvert. Si vous pensez quu2019il su2019agit du2019une erreur, rendez-vous sur http://help.instagram.com/"]}, "status": "ok", "error_type": "signup_block"}, the error is in french and mean: "The ip you are using has been flagged has an open proxy"

After doing some research on internet i found out that the error code showing is because instagram ip banned me so i tried with multiple different ip which i am sure are not compromised nor banned by default.
So i concluded that the requests i send may flag instagram antibot/antiproxy system. After 2 hours of trials and error i couldnt figure out how i could bypass it.

The code i wrote :

Code deleted

Code explanation:
Stage 1 : Generate data used for registration
Stage 2 : Ask tempmail.io for a new email and extract the email and email token from the response
Stage 3 : try to extract csrf token from the cookie (fail everytime idk why)
Stage 4 : send manifest (instagram always respond with code 401)
Stage 5 : send signup request to instagram (response : 200)
Stage 6 : send signup data generated in Stage 1 and 2 (response : 200)
Stage 7 : send birthdate (response : 200)
Stage 8 : ask instagram for email verification with the email generated in Stage 2 (response: 200)
Stage 9 : loop to check for email from instagram
Stage 10 : extract verification code from email
Stage 11 : send requests to delete email
Stage 12 : send verification code to instagram and extract signup code from response (response : 200)
Stage 13 : send signup attempt requests and try to complete registration (response : 200 but answer to the request with {"account_created": false, "errors": {"ip": ["Lu2019adresse IP que vous utilisez a u00e9tu00e9 signalu00e9e comme un proxy ouvert. Si vous pensez quu2019il su2019agit du2019une erreur, rendez-vous sur http://help.instagram.com/"]}, "status": "ok", "error_type": "signup_block"})

All the requests i send are the one from a normal signup attempt from a webbrowser. The whole information in headers including CSRF token, deviceID… are from normal registration attempt using a webbrowser and coverted using https://curlconverter.com/ and are sent in the right order. I didnt sent some requests like falco and logging_client_events as i dont think they are needed for signup.

Any answers are well appreciated 🙂

Asked By: Juloup 78

||

Answers:

I fixed the error by extracting csrf token from the cookie by using ”session.cookies.get_dict()” and by passing the cookie to other requests now the account is created successfully.

Answered By: Juloup 78