robin_stocks icon indicating copy to clipboard operation
robin_stocks copied to clipboard

Unable to get received transfers

Open chapchap33 opened this issue 4 years ago • 3 comments

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/

chapchap33 avatar Dec 21 '20 15:12 chapchap33

nice find. working on it now.

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

jmfernandes avatar Jan 02 '21 19:01 jmfernandes

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 (?)

SmokeNMirrors avatar Feb 16 '21 05:02 SmokeNMirrors

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', ''))

zot24 avatar Mar 26 '21 03:03 zot24