Lend Academy Network Forum

Lending Club Discussion => Investors - LC => Topic started by: Kombinator on May 09, 2014, 02:40:10 AM

Title: Obtaining / calculating cash balance via API data
Post by: Kombinator on May 09, 2014, 02:40:10 AM
Wanted to see if anyone has a quick method to do this, as LC doesn't have the account API endpoint which specifically states remaining cash balance like Prosper does. 
Title: Obtaining / calculating cash balance via API data
Post by: BruiserB on May 09, 2014, 09:35:12 AM
I think most of the third party automated investor sites ask for user name and password in addition to the API key so that they can log into a user's account and screen scrape available balance before purchasing notes.  I know they would prefer to have this available from the API so they would avoid any liability issues associated with having users' log in credentials.


Sent from my iPad using Tapatalk
Title: Re: Obtaining / calculating cash balance via API data
Post by: Kombinator on May 09, 2014, 12:10:19 PM
Well Prosper does have this available directly via API, my question was mainly for LC specifically if there was a clear way to calculate available cash balance from information currently provided via API download or from the Notes file.
Title: Re: Obtaining / calculating cash balance via API data
Post by: Fred on May 09, 2014, 02:14:17 PM
You can try getting it through this link:

Code: [Select]
https://www.lendingclub.com/browse/cashBalanceAj.action?rnd=some_random_number
The response is in JSON, like this:

Code: [Select]
{"result": "success","cashBalance": "$xxx.xx"}
Title: Re: Obtaining / calculating cash balance via API data
Post by: gamassey on May 09, 2014, 03:56:36 PM
You can try getting it through this link:

Code: [Select]
https://www.lendingclub.com/browse/cashBalanceAj.action?rnd=some_random_number
The response is in JSON, like this:

Code: [Select]
{"result": "success","cashBalance": "$xxx.xx"}

That is excellent!
Where did you learn that "cashBalanceAj" is the name of the cash balance field?  When can I find a list of other available fields?
Title: Re: Obtaining / calculating cash balance via API data
Post by: kbenson99 on May 09, 2014, 05:20:48 PM
It's not a field.  It's data that LC is retrieving asynchronously from the server.  For example, on accessing https://www.lendingclub.com/browse/browse.action page, an Ajax call is made to https://www.lendingclub.com/browse/cashBalanceAj.action?rnd=some_random_number to obtain cash balance.

To gain insight into what calls are being made, the easiest way I found is to use Chrome.  For example, on the https://www.lendingclub.com/browse/browse.action page, right mouse click anywhere on the page and select "Inspect element".  Chrome will open a console at the bottom of the page.  Click on the "Network" tab.  Refresh the https://www.lendingclub.com/browse/browse.action page and you'll see all the Ajax calls being made and all the web resources (js, css, etc) being retrieved by the current page.
Title: Re: Obtaining / calculating cash balance via API data
Post by: gamassey on May 09, 2014, 11:38:10 PM
To gain insight into what calls are being made, the easiest way I found is to use Chrome.  For example, on the https://www.lendingclub.com/browse/browse.action page, right mouse click anywhere on the page and select "Inspect element".  Chrome will open a console at the bottom of the page.  Click on the "Network" tab.  Refresh the https://www.lendingclub.com/browse/browse.action page and you'll see all the Ajax calls being made and all the web resources (js, css, etc) being retrieved by the current page.

Thank you, that was very helpful!  Now I am dangerous.
Title: Re: Obtaining / calculating cash balance via API data
Post by: Kombinator on May 10, 2014, 02:01:44 PM
Perfect, this is indeed very helpful, thanks so much