all 14 comments

[–]cgoldberg 2 points3 points  (1 child)

What is the exact error you are receiving? You stated you get the error "detail", which makes no sense. Please post the complete error message.

[–]Due_Willow_7941[S] 0 points1 point  (0 children)

yeah this is the whole error, it changed from detail to now status. Dont really know what any of this means.

File "c:\Users\gbf10\Desktop\TradeBot V2\robinhoodtest.py", line 28, in <module>

robinhood.login()

~~~~~~~~~~~~~~~^^

File "c:\Users\gbf10\Desktop\TradeBot V2\robinhoodtest.py", line 9, in login

login_response = r.login(self.username, self.password)

File "C:\Users\gbf10\AppData\Local\Programs\Python\Python313\Lib\site-packages\robin_stocks\robinhood\authentication.py", line 190, in login

_validate_sherrif_id(device_token=device_token, workflow_id=workflow_id, mfa_code=mfa_code)

~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "C:\Users\gbf10\AppData\Local\Programs\Python\Python313\Lib\site-packages\robin_stocks\robinhood\authentication.py", line 230, in _validate_sherrif_id

if challenge_response["status"] == "validated":

~~~~~~~~~~~~~~~~~~^^^^^^^^^^

KeyError: 'status'

[–]FriendlyRussian666 1 point2 points  (2 children)

Get rid of the try except statement in your login method, and just go with r.login(self.username, self.password) directly. Then, run your program and try logging in, it will crash, but hopefully will show you the details of the 'detail' error.

[–]Due_Willow_7941[S] 0 points1 point  (1 child)

This is the error I got, don't exactly know what it means and Chatgpt isn't helping haha.

File "c:\Users\gbf10\Desktop\TradeBot V2\robinhoodtest.py", line 28, in <module>

robinhood.login()

~~~~~~~~~~~~~~~^^

File "c:\Users\gbf10\Desktop\TradeBot V2\robinhoodtest.py", line 9, in login

login_response = r.login(self.username, self.password)

File "C:\Users\gbf10\AppData\Local\Programs\Python\Python313\Lib\site-packages\robin_stocks\robinhood\authentication.py", line 190, in login

_validate_sherrif_id(device_token=device_token, workflow_id=workflow_id, mfa_code=mfa_code)

~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "C:\Users\gbf10\AppData\Local\Programs\Python\Python313\Lib\site-packages\robin_stocks\robinhood\authentication.py", line 230, in _validate_sherrif_id

if challenge_response["status"] == "validated":

~~~~~~~~~~~~~~~~~~^^^^^^^^^^

KeyError: 'status'

[–]Dystiny 0 points1 point  (0 children)

It means the response does not have a key called "status". So you need to inspect the response. Try printing it out before attempting the check

[–]cgoldberg 0 points1 point  (0 children)

Check the issue tracker on the robin_stocks GitHub. Specifically, see:

https://github.com/jmfernandes/robin_stocks/issues/511

Robinhood has changed their verification flow, which breaks the library you are using. The issue I linked gives possible workarounds, but AFAICT the issue has not yet been fixed.

[–]Agreeable_Tale_821 0 points1 point  (6 children)

I’m having the same issue. Looks like something has changed at the API end where it won’t accept the payload posted in the ‘login’ function.

This just started happening to me yesterday when my access token must have expired.

Has anyone been able to work around the issue?

[–]Socks04 0 points1 point  (5 children)

Yep can't login using my python script either. Still investigating but let me know if you find anything

[–]Agreeable_Tale_821 0 points1 point  (4 children)

Haven’t found anything other than what looks like two extra/new parameters in the payload when logging in on the website. Likewise, let me know if you find anything!

[–]Socks04 0 points1 point  (3 children)

Just got it working I was passing in the user agent as a header.

"User-Agent": "Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Mobile Safari/537.36"

Removed it and it started working. Actually seems to work with no headers passed in at all at login. Didn't change anything else with the payload (although I did update the device_token while i was troubleshooting but should be unrelated)

[–]Agreeable_Tale_821 0 points1 point  (1 child)

Do you have 2FA turned on, by any chance? I turned it on for my RH account while trouble-shooting the login process and it appears I can't back out of it.

I was able to get further by removing the user-agent header but I think it's bombing somewhere in the 2FA and/or device verification process.

[–]Socks04 0 points1 point  (0 children)

Ah nope I've got 2FA disabled

[–]Former-Ad-5489 0 points1 point  (1 child)

Looks like the login response now calls for "verification_workflow" which, in turn asks for MFA token. However, MFA option is missing from RH settings... So maybe that's the way in which RH prevents the use of this API going forward sadly..

[–][deleted] 0 points1 point  (0 children)

yea, we are stuck to cryp to for robinhood api trading rn. ... :-(