Gem Version Continuous Integration Status Coverage Status CodeClimate Dependency Status

idigbio_client is a Ruby wrapper for iDigBio API


Add this line to your application’s Gemfile:

“by gem ‘idigbio_client’

And then execute:

$ bundle

Or install it yourself as:

$ gem install idigbio_client


Client functions can be grouped in 4 categories

  • inspect - introspective methods
  • search - search by provided parameters
  • show - show any one object based on its UUID
  • stats - various statistical data


Methods in this section supply meta-information important for effective use of the client.

Method IdigbioClient.types

Returns an array of types (resources) available via API.

“by require “idigbio_client”


returns [records, mediarecords, recordsets, publishers]

Method IdigbioClient.fields(type)

Returns a hash with description of fields associated with a resource. Takes one optional parameter type. If type is not given it returns fields to all types in a hash.

typeString or Symbolindicates which type to query for its fields; default nil

“by require “idigbio_client”


fields of a specific type

IdigbioClient.fields(:mediarecords) IdigbioClient.fields(“records”)


Takes a hash of opts, returns a hash with results of a search.

:rqsearch query hash; default {}
:limithow many records to return in total; default 100
:offsetfrom which record to start; default 0

“by require “idigbio_client”

specimen records search

params = { rq: { genus: “acer” }, limit: 15 } params)

setting offset: will start count for 15 records from 11th result

params = { rq: { genus: “acer” }, limit: 15, offset: 10 } params)

using non-default type :mediarecords, params: params)



Takes uuid, returns record associated with UUID. Record can be of any type.


“by require “idigbio_client”“1c29be70-24e7-480b-aab1-61224ded0f34”)


Method: IdigbioClient.count(opts)

Returns the number of records of a specified type

:typeString or Symbolresource type; default :records
:paramsHashsearch options hash; default {}

“by require “idigbio_client”

IdigbioClient.count IdigbioClient.count(type: :recordsets) IdigbioClient.count(type: :mediarecords, params: { rq: { genus: “acer” } })


After checking out the repo, run bin/setup to install dependencies. Then, run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release to create a git tag for the version, push git commits and tags, and push the .gem file to


  1. Fork it ([my-github-username]/idigbio_client/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Authors – Greg Traub, Dmitry Mozzherin

Copyright (c) 2015 Greg Traub, Dmitry Mozzherin See LICENSE for details.