Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

a wrapper for the api

branch: master

Fetching latest commit…


Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 test
Octocat-spinner-32 .document
Octocat-spinner-32 .gitignore
Octocat-spinner-32 LICENSE
Octocat-spinner-32 README.rdoc
Octocat-spinner-32 Rakefile
Octocat-spinner-32 VERSION
Octocat-spinner-32 simplificator-ruby-kiva.gemspec



This is a ruby wrapper for the api. See for details.


Still work in progress, some tests are missing, documentation is quite weak. Most API calls from Kiva are reflected. offers a list of API methods, not implemented: Methods, Release, Templates


Whenever the unknown elements are encountered in the JSON documents, then an exception is raised. Let me know if this happens and i will add the missing attributes. Or set Kiva::Api.friendly = true AND let me know.


0.2.0 Updated API to include more functionality, added some tests 0.1.0 Initial Release


include Kiva

Api.app_id = 'your api id here, not required but recommended, see' ### Loans ## finding Loans by ID

#puts Loan.find(:id => 180009).terms #puts Loan.find(:id => '180009, 180008').size #puts Loan.find(:id => [180009, '180008']).size

## finding Loans by lender_id #puts Loan.find(:lender_id => 'matt', :page => 1).inspect

## finding Loans #puts Loan.find(:query => 'Chinchilla', :page => 1).inspect #puts Loan.find(:partner_id => [150, 156, 188, 190, 120], :query => 'Vegetable', :status => :in_repayment, :page => 2).inspect

### Partners

#puts Partner.find().first.inspect #puts Partner.find(:id => 1).inspect

### Lending Actions #LendingAction.recent.first

### Journal Entries #puts JournalEntry.find(:loan_id => 180009, :include_bulk => true, :page => 10).inspect #puts Loan.find(:id => 180009).journal_entries(:include_bulk => true).first.comments #puts Comment.find(:journal_entry_id => 28342).inspect

### Team #puts Team.find(:id => 2).team_since #puts Team.find(:shortname => 'buildkiva') #puts Team.find(:id => 6341).lenders(:page => 1).inspect

Note on Patches/Pull Requests

  • Fork the project.

  • Make your feature addition or bug fix.

  • Add tests for it. This is important so I don't break it in a future version unintentionally.

  • Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)

  • Send me a pull request. Bonus points for topic branches.


Copyright © 2010 pascalbetz. See LICENSE for details.

Something went wrong with that request. Please try again.