robin_stocks
robin_stocks copied to clipboard
get_watchlist_by_name("My First List") gives 404 Client Error
robin_stocks.account.get_watchlist_by_name() give a 404 Client error. I have tried with other watchlists still the same.
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=
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.