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.73k stars 467 forks source link

Unable to get received transfers #209

Open chapchap33 opened 3 years ago

chapchap33 commented 3 years ago

By trying to get all transactions in my account using r.get_bank_transfers(), we can see some are missing. After investigating further, it looks like it's because I initiated a transfer from my bank rather than initiating it from Robinhood. While this URL exists: def banktransfers(): return('https://api.robinhood.com/ach/transfers/') it looks like this one exists as well to collect received transfers from banks: https://api.robinhood.com/ach/received/transfers/

Do you think we should add another definition for the following URL? https://api.robinhood.com/ach/received/transfers/

jmfernandes commented 3 years ago

nice find. working on it now.

Do you know if there are any other urls besides 'received'?

SmokeNMirrors commented 3 years ago

I'm also playing with the get_bank_transfers() function but with a different issue. I'm only able to get the first page of results and my sums are massively off as this only goes back 50 transactions.

I get the output: Found Additional pages. Additional pages exist but could not be loaded.

digging deeper the nextData['next'] is producing a url of the form https://api.robinhood.com/public/ach/transfers/?cursor=XXX but then the request response is a 404 ?!

I happen to try the url stripping out 'public' and it looks to work now (doing manually but got a 2nd page of transfers). Looks to be bad url coming right from robinhood, but I think need to correct with a patch in the helper (?)

zot24 commented 3 years ago

in the mean time and for whoever else encounter this problem, what I did to fix it was to change the line https://github.com/jmfernandes/robin_stocks/blob/8ffc27f91baa6dcf692d33628871e0867a49e3be/robin_stocks/robinhood/helper.py#L304

to looks like

res = SESSION.get(nextData['next'].replace('/public', ''))