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.68k stars 458 forks source link

get_watchlist_by_name("My First List") gives 404 Client Error #232

Open Rijtim1 opened 3 years ago

Rijtim1 commented 3 years ago

robin_stocks.account.get_watchlist_by_name() give a 404 Client error. I have tried with other watchlists still the same.

nima commented 3 years ago

I get a response as expected when I try this. When I misspell the name of the watchlist, I get the error you're getting.

>>> rh.account.get_watchlist_by_name('DIV')
{'results': [{'created_at': '2021-01-09T01:42:08.254474Z',
              'holdings': False,
              'id': '466f6edc-ced2-4ac6-ad22-e56115f0b076',
              'list_id': '06b90471-7437-48dd-8b4a-59cb853c769f',
              'market_cap': 97354299062.60219,
...

>>> rh.account.get_watchlist_by_name()
400 Client Error: Bad Request for url: https://api.robinhood.com/midlands/lists/items/?list_id=

>>> rh.account.get_watchlist_by_name('lolwat')
400 Client Error: Bad Request for url: https://api.robinhood.com/midlands/lists/items/?list_id=
jmfernandes commented 3 years ago

make sure you are typing in the name of the watchlist with the correct capitalization and spelling. If you don't supply a name it defaults to My First List and if you don't have that list in your profile then you will get a 400 error.