Fetching Data

More

Lending Actions

Lending actions are cool bits of data that we've offered on the front page of Kiva for a while. On the website we've called this “recent activity” and you might have seen us call these “transactions” as well. Basically, a lending action is the singular action of a lender making a loan to an entrepreneur on Kiva. It's comprised of an ID, a loan listing, a lender listing, and a date at which the lending action was completed.

Currently, only the 50 most recent lending actions are available via the API through this call:

http://api.kivaws.org/v1/lending_actions/recent.json

A lender might make any loan amount or even a few loans to the same entrepreneur but it will show up as one lending action. Also, lending actions made more than 48 hours ago or those by anonymous lenders are not shown.

Journal Entries and Comments

A loan can have any number of journal entries. These are updates about the status of the loan, the borrower, or sometimes, the field partner. Also, visitors to the Kiva site (not necessarily lenders) can make comments to a journal entry. Journal entries are typically accessed by passing in the ID for a specific loan:

http://api.kivaws.org/v1/loans/42939/journal_entries.json

The methods for fetching journal entries take an optional parameter, include_bulk. By default this is set to 0 since we assume that in mose cases you're not interested in boring automated notifications (often these are triggered by payments made to a loan – information you can fetch from a loan's detail). However, to get bulk entries as well as the meatier entries, just set this parameter to 1.

Each journal entry listing will have a comment_count field showing the number of comments posted to the entry. Since most entries don't have comments, you can use this to only fetch comments for entries with comments or those that appear to have especially lively discussion around them. The call to fetch comments for a journal entry only requires a journal entry ID (which is guaranteed to be unique for every journal, regardless of loan). Such a call looks like this:

http://api.kivaws.org/v1/journal_entries/28342/comments.json

Teams

A lending team is comprised of a number of lenders, and at least one lender (the team captain). Lenders come together in a team to pool their lending toward a common cause or interest, and as such, teams are also related to loans. Teams are identified by a numerical ID, but can also have an customizable alias, called a shortname, which may also be used for identification. Typically you get information about a team using the numeric team ID:

http://api.kivaws.org/v1/teams/2.json

You can get the list of lenders in a team by passing in the same ID to this call:

http://api.kivaws.org/v1/teams/2/lenders.json

and the loans atrributed to the team are fetched in similar way:

http://api.kivaws.org/v1/teams/2/loans.json

If a user happens to know the shortname of their team, it's also possible to do a lookup of team information using that alias instead of the team ID:

http://api.kivaws.org/v1/teams/using_shortname/buildkiva.json

Team API methods are a work in progress - we should have more soon that allow reverse lookup (such as finding out which teams a lender belongs to...)

Kiva
  • © 2009 - 2014 Kiva. All rights reserved.
  • Terms Of Service
  • Kiva is a 501(c)(3) nonprofit.