Using the Prosper API to Automate the Loan Market
This article describes how to begin building applications specifically geared to the Prosper.com website. Prosper.com is a popular auction-style site that helps fulfill loans to individuals through a bidding process.
Figure 1 - Sample Loan Query Application Courtesy of Prosper Development
In the past, the way to secure a loan was to go to a bank or broker, go through hours of tedious financial discovery and wait a month for approval. The internet has changed all that. Sites such as LendingTree and E-Loan make it much easier to obtain a loan. Not only can you obtain a loan quicker, but these sites force banks to compete for your business (Nothing like putting the power back into the hands of the consumer!). The founder of E-Loan, Chris Larsen, decided one day (probably after seeing how e-bay works), that there was another way to provide loans. Why not let individuals lend or borrow money from other individuals through an auction system. So what exactly gets auctioned? Interest rates! And that is how Prosper was born...
How Does Prosper Work?
Prosper allows a borrower request a certain amount of money that they would like to borrow (up to $25,000). The borrower places their request on the auction block. In exchange, the lender gets to know quite a lot of financial detail about the borrower (their credit rating, salary, length of employment, number of delinquencies). The lender uses this information along with the borrower's requested interest rate to decide whether or not they will lend money to the borrower. Keep in mind that this auction is completely blind like e-bay. The lender never knows the identity of the borrower and visa versa. The credit information is real, though. Lenders are allowed to ask questions to the borrower, such as, "Please break down your monthly income and expenses." Or, "Please explain the delinquencies." Once the lender decides to lend money, they can bid as little as $50 on the borrower towards the loan. A loan is not issued unless the full amount requested by the borrower is funded by the multiple lenders. (Many requested loans are not fulfilled for this reason.) Once the loan has been completely filled to the total amount requested by the borrower, a new lender can still bid on the loan until the time runs out. The new lender "ups" the bid by bidding a lower interest rate than the previous lenders who have bid on the borrower so far. Often you'll see a successful loan's interest rate drop as much as 50%! It seems borrowers flock to prosper to pay off high interest credit cards, higher interest loans, or to borrow money to start a business.
The risk is always that the borrower defaults on the loan (stops making monthly payments). The lower the credit grade, the larger the risk to the lender. Grades range from AA, A, B, C, D, E, and HR (High Risk). Higher risk credit grades tend to pay much larger interest rates, but are more likely to default. AA grade is the safest, and rarely defaults, but doesn't usually command a high rate. Prosper makes the lender aware of the risks before placing the bid. They even statistically calculate risk of default and return based on historical site statistics. Still there is no guarantee, so it's always best to diversify if you are a lender.
Prosper allows you to form Groups. As a member of a group, you have the guidance of the Group Leader to help you obtain the loan. The Group Leader can endorse you as a good loan prospect, if he or she feels you are low risk. The group leader can also request proof of salary and let lenders know that you can be trusted. Figure 1, shows a list of groups just started this April.
Prosper has opened up its API to the developer world which is pretty exciting for financial software engineers. The API makes it easy to write .NET Applications to automate tasks and metrics produced by the Prosper website. Prosper provides good documentation on the API so you can get started using it right away. The API works through a WebService. The WebService allows you to Login, Logout, and Query or Retrieve certain data. It does not seem like you can automate bidding yet, but I suspect this will be added in a future release. In this article we will talk about using the Query web method, since this is what was provided in the sample application.
Objects to Query
Prosper has provided a host of objects that you can query on, each providing multiple properties containing loan data. Table 1 are a list of objects and some of their properties.
Table 1 - Queryable Prosper Objects
|Object ||Description ||Useful Properties|
|Listing ||Contains information about a borrower listing including credit history information ||BidCount, CreditGrade, AmountDelinquent, AmountFunded, BorrowerRate|
|Group ||A Group in Prosper consisting of borrowers, lenders, and a group leader. ||Name, ShortDescription,GroupRating|
|Bid ||Bid coming from a lender on a loan ||Amount, ListingKey, MemberKey,Status|
|LenderLoan ||the part of the loan owned by a lender ||BidSource, PrincipalLoaned, PrincipalRepaid, LoanNumber|
|Loan ||the loan object created after a borrower has received the fully requested loan amount ||CreationDate, AmountBorrowed,BorrowerRate,Term|
|MarketPlace ||contains useful statistics about Prosper ||LoanVolumeToDate,MembersToDate|
|Member ||information about a particular member ||GroupKey,Roles,ScreenName|
Setting up the API
To use the API, we just need to generate a Web Service object using .NET.
Here are the steps:
1) Create a new Windows Forms Project or ASP.NET Project
2) Right Click on Solution Explorer and choose Add Web Reference.
3) Fill in the url as shown in figure 2 and press Go. Click Add Reference:
Figure 2 - Adding a Web Reference Object
The reference to the prosper api will appear in your solution as a com.prosper.services as shown in Figure 3. You are now ready to talk directly to the prosper web site to gather information:
Figure 3 - Web Reference to Prosper Appearing in the Solution Explorer
Using the API in C#
Once you've generated the web service reference, you have all the Prosper objects available to you in the .NET framework. You can call any of them just like you would any other class. In this example, we will show you how to query on an object to get a group. You'll first want to add a using statement, so you don't have to preference namespaces every time you access a prosper object:
Listing 1 - Adding a using clause to your class
public partial class ProsperQueryApp : Form
You will also want to declare and construct a prosperapi object in order to use it's query method later:
Listing 2 - Constructing a prosper API object
|private com.prosper.services.ProsperAPI prosperAPI = new com.prosper.services.ProsperAPI();|
You are now free to query on any of the available prosper objects provided. Listing 3 shows a simple query to obtain the group information shown in figure 1:
Listing 3 - Querying on the Group Object using the prosper API
|ProsperObjectResult result = null; |
result = prosperAPI.Query(null, "Group", "Name,CreationDate,IsExceptingNewMembers,ShortDescription", "CreationDate > '04/01/08'");
The first parameter in the Query method is an authentication key, which for the initial release can be set to null. The second parameter specifies the name of the prosper object we are querying on (the Group object). The third parameter is a list of all the properties separated by comma of the Group object from which we are requesting information. All properties that we do not specify in the property list will be returned as null. The last parameter is the conditional expression to filter are query. The query expression is similar to a where clause in a database query.
All of the groups fulfilling the condition creation date > april 1, 2008 will be returned to the prosper result object. The prosper result object contains a collection of prosper objects that you can loop through to retrieve individual object information.
Listing 4 - Looping through the results of the Prosper Query
|ArrayList prosperObjects = new ArrayList();|
foreach (ProsperObject prosperObject in prosperResult.ProsperObjects)
Since we asked for Group objects, the objects returned are of type Group, so if we need to get a property from the group, we just unbox it:
Listing 5 - unboxing a Prosper Group object
|Group myProsperGroup = prosperObjects as Group; |
string descriptionOfGroup = myProsperGroup.ShortDescription;
You can use the ArrayList above to bind to a DataGridView in order to display your query results. Just drop a DataGridView onto your form and add the code in Listing 6 after the query is performed:
Listing 6 - Binding to a DataGridView
|dataGridView1.DataSource = prosperObjects;|
Now that Prosper has opened up it's API to the public, it should be quick and easy to create some cool applications to analyze and track loan information. Prosper has a large enough pool of borrowers that you contains some interesting statistics from querying their loan info. You can also use the prosper API to help you create some cool tools to give you an advantage in the prosper marketplace. I have created a tool myself in .NET called the Prosper Lender's Companion and use it to track and fine tune the bidding process. It's easy to get into the development game at Prosper and perhaps if your developed application is good enough, they will market it on their website! If you are looking to experiment with prosper or borrow money for a .NET project, you can join Prosper and tell them I sent you. In the meantime, don't be afraid to lend a helping hand to the frontier of auction loan markets using C# and .NET.