jmfernandes / robin_stocks

This is a library to use with Robinhood Financial App. It currently supports trading crypto-currencies, options, and stocks. In addition, it can be used to get real time ticker information, assess the performance of your portfolio, and can also get tax documents, total dividends paid, and more. More info at
http://www.robin-stocks.com
MIT License
1.74k stars 468 forks source link

Not possible to get any watchlist besides 'Default' watchlist #134

Open tom-ek opened 4 years ago

tom-ek commented 4 years ago

Hi robin_stocks team,

I was trying to retrieve watchlist information from my account, however, it is not possible to get any information on any watchlist except for the 'Default' watchlist.

Using the function robin_stocks.account.get_all_watchlists() I only get the 'Default' watchlist returned (I have three more watchlists in the account I am working with)

The function robin_stocks.account.get_watchlist_by_name only provides access to the 'Default' watchlist and returns for any other watchlist the following output:

{'detail': 'Not found.'}

There might have been a change in the URL schema and I was playing around with various modified urls, however, to no avail so far.

Thanks for the great work on putting this together!

tom-ek commented 4 years ago

Update: Found the new URL syntax :)

However, one needs to first find the mapping of the internal ID of the watchlist to the watchlist name.

URL query to get the watchlist ID/name mapping: rh.helper.request_get('https://api.robinhood.com/midlands/lists/default/')

URL query to get the actual list based on the ID from the previous query: rh.helper.request_get('https://api.robinhood.com/midlands/lists/items/,'list_id':)

I already have a local implementation in the library that allows me now to use both functions (get_all_watchlists() and get_watchlist_by_name) again.

If it is okay with you, I can submit a Pull request?

jmfernandes commented 4 years ago

Yes a pull request would be great. Thanks for the hard work.