Code Monkey home page Code Monkey logo

crunchbase-ruby-library's Introduction

Crunchbase

Crunchbase API Version 3 - Ruby Library CrunchBase Data Hub.

Installation

Add this line to your application's Gemfile:

gem 'crunchbase-ruby-library'

And then execute:

$ bundle

Or install it yourself as:

$ gem install crunchbase-ruby-library

Usage Examples

Config your user_key, debug somewhere like development.rb, Recommended directory config/initializers/crunchbase.rb

require 'crunchbase'

Crunchbase::API.key   = 'user_key'
Crunchbase::API.debug = false

Search Organization OR Person OR Product OR IPO OR Acquisitions OR Funding Rounds

Retrieve the way, Please use Search Class. The Search Will Return a list consisting of objects of the OrganizationSummary | PersonSummary | ProductSummary | Funding Rounds type. Example:

Query Orgnization

Method 1
response = Crunchbase::Model::Search.search({query: "Google"}, 'organizations')

Method 2
response = Crunchbase::Model::Search.search({name: "Google"}, 'organizations')

Method 3
response = Crunchbase::Model::Search.search({domain_name: "google.com"}, 'organizations')

response.total_items || response.per_page || response.pages || response.current_page
response.results.each { |r| puts r.name }


Query Person

response = Crunchbase::Model::Search.search({query: "encore"}, 'people')

response.results.each { |i| [i.first_name, i.last_name] }

Query Product

response = Crunchbase::Model::Search.search({}, 'products')

response.results.each { |i| i.name }

Query IPO

response = Crunchbase::Model::Search.search({}, 'ipos')

response.results.each { |i| i.name }

Query Acquisition

response = Crunchbase::Model::Search.search({}, 'acquisitions')

Funding Rounds

response = Crunchbase::Model::Search.search({}, 'funding-rounds')

Get Organization && RelationShips

Get information by the permalink, Example:

response = Crunchbase::Model::Organization.get("facebook")

Relationship objects [ primary_image founders current_team investors owned_by sub_organizations headquarters offices products categories customers competitors members memberships funding_rounds investments acquisitions acquired_by ipo funds websites images videos news ]

response.founders
response.competitors_total_items
response.websites

NOTE: If you want all `past_team` `board_members_and_advisors` items, Please do:

# Methods

past_team = Crunchbase::Model::PastTeam.organization_lists("facebook")
past_team.results.collect { |p| [p.title, p.person.first_name] }

....

Person

Get information by the permalink, Example:

person = Crunchbase::Model::Person.get( permalink )

#<Crunchbase::Model::Person:0x007fc185215f68 @type_name="Person", @uuid="a578dcf9859ec8b52182e3aa3c383b13", ...>

people = Crunchbase::Model::Person.list( page )

people.results

[ #<Crunchbase::Model::PersonSummary:...>,
#<Crunchbase::Model::PersonSummary: ...>,
#<Crunchbase::Model::PersonSummary: ...>,
#<Crunchbase::Model::PersonSummary: ...>
...... ]

Contributing

  1. Fork it ( https://github.com/encoreshao/crunchbase-ruby-library/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

Copyright

Copyright © 2015-05 Encore Shao. See LICENSE for details.

crunchbase-ruby-library's People

Contributors

chenhoward avatar encoreshao avatar martincik avatar zapnap avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.