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

Retirement Support #304

Open
1 task done
abhmul opened this issue Dec 31, 2022 · 11 comments
Open
1 task done

Retirement Support #304

abhmul opened this issue Dec 31, 2022 · 11 comments

Comments

@abhmul
Copy link

abhmul commented Dec 31, 2022

Checklist

  • I have searched the issues of this repo and believe that this is not a duplicate.

Feature Request

Now that Robinhood has added retirement accounts, it would be good to be able to manage investment there as well. I can look into how to do this, but if anyone familiar with the codebase and api has pointers on how to do this, that would be helpful.

Questions I have

  1. Is there any documentation available on what API endpoints are available?
  2. I placed a test order on my retirement account for VTI of $1 through the RobinHood website. When placing the order, the website says my "Estimated Shares" were 0.005212, but the api request for the order used a quantity of 0.004577. In fact the price on the website was $191.86 but the price in the request was $218.44. Why the discrepancy?

Notes on what I've figured out

  • There is an account number for your retirement account that is different from your brokerage account number. However, you cannot get it with a GET request to https://api.robinhood.com/accounts/. I managed to find mine by tracking the requests Robinhood sends. Once you have the number you can send requests with the account number in the payload, and everything should work as expected.
@abhmul abhmul added the feature label Dec 31, 2022
@adithyabsk
Copy link
Member

Hi @abhmul, that's interesting! Right now, this project is in maintainance mode and is accepting contributions. Robinhood does not have a documented API as such and will require reverse engineering to figure out both the endpoints and the payloads.

If this feature is of interest to you please submit a PR and I'll review and merge.

@jhirschibar
Copy link
Contributor

You can find your retirement account numbers by examining your retirement account statement. It is in the top right corner. The API endpoints in pyrh work well when substituting in the retirement account number in place of the default brokerage account number

@Jamonek
Copy link
Member

Jamonek commented Mar 7, 2023

I'll work on documenting changes required over the coming weeks.

@jhirschibar
Copy link
Contributor

I'm working on some tools too that I may end up pushing. I look forward to your docs

@viaConBodhi
Copy link

Started playing around with it and it looks like endpoint + "?account_numbers=YOACT###sGOHERE" is returning data for those accounts. Just started testing but it's looking promising.

@mw66
Copy link

mw66 commented Apr 25, 2023

how to programmatically get the retirement account number?

@mw66
Copy link

mw66 commented Apr 25, 2023

@abhmul

Can you show some code snippets on how to "send requests with the account number in the payload", e.g. when placing an order?

Thanks?

@jhirschibar
Copy link
Contributor

how to programmatically get the retirement account number?

I've not found a way as of yet, only via account statement so far

@viaConBodhi
Copy link

@mw66 easiest way to get your act# is to get it from the reports/statement pdf. Haven't tried submitting an order so not sure. After authenticating in the variable "rh", and making sure you've imported the request, json and pandas libraries, you can use the endpoint in the url.py file in this project to build a call like

df = pd.DataFrame(rh.session.get('https://api.robinhood.com/orders/?account_numbers=YOUR-ACT-#-HERE').json()['results'])

and this will return a DF with your info. They may use the same variable "account_numbers" for the submitting order payload but haven't tested yet. You could prob look at the traffic or just update the code and test trying to buy something for a $1 to see if it processes. Let us know your findings if you do.

@joortcom
Copy link

FYI: robin_stocks support multiple Retirement accounts:

jmfernandes/robin_stocks#377
jmfernandes/robin_stocks#387

Copy link

stale bot commented Mar 17, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants