Jigsaw

This gem provides a Ruby wrapper around the Jigsaw API, using HTTParty. Currently, only Company Search is supported.

Obtaining an API key

To be able to use this gem, you’ll need a Jigsaw Developer API key. To request an API key, point your browser to developer.jigsaw.com/member/register and follow the instructions there.

Installing the gem

To use this gem, install it with gem install jigsaw or add it to your Gemfile:

gem 'jigsaw'

And install it with bundle install

Usage

Retrieving a list of companies

You can search for companies and you’ll receive three pieces of information:

  1. The number of hits found by this search.

  2. The number of records being returned.

  3. The actual records as an array of JigSaw::CompanyBasic objects.

Searches are refined using these arguments.

Details for argument values can be found in the Data Keys and Values section of the developer documentation.

First register a new Client:

@client = Jigsaw::Client.new(API_KEY)

Then retrieve a list of companies in zip code “02478”:

@total_hits, @fetched_hits, @companies = @client.company_search({:zip_code => "02478"})

Search by zip code and return a single page of 10 results:

@total_hits, @fetched_hits, @companies = @client.company_search({:zip_code => "02478", :page_size => 10, :offset => 0})

Search by zip code and return all results:

@total_hits, @fetched_hits, @companies = @client.company_search({:zip_code => "02478"}, true)

Search by zip code and return all results:

@total_hits, @fetched_hits, @companies = @client.company_search({:zip_code => "02478", :ownership => "private"}, true)

Retrieving company details

Not yet implemented.

Retrieving a list of contacts

Not yet implemented.

Retrieving contact details

Not yet implemented.

To Do

Acknowledgement

This gem is patterned after Marcel de Graaf’s google_pages gem.

Contributing to jigsaw

You’re very welcome to add functionality to this gem. To do so, follow these steps:

Copyright © 2011 Matthew Bellantoni. See LICENSE.txt for further details.