Git Product home page Git Product logo

crunchbase-api's Introduction

Crunchbase API

Codacy Badge Gem Version Build Status Code Climate

Ruby API wrapper for Crunchbase API version 2.

Deprecated

Please note that the Crunchbase API v2.0 was shut down on May 31st, 2015, and as such this gem is no longer functional.

Installation

Add this line to your application's Gemfile:

gem 'crunchbase-api'

And then execute:

$ bundle

Or install it yourself as:

$ gem install crunchbase-api

Usage

You will need a Crunchbase API key. You can get one by signing up here.

require 'crunchbase-api'
Crunchbase.user_key = 'YOUR_API_KEY'

Example

# Print acquisitions done by Facebook
company = Crunchbase::Organization.get 'facebook'
company.acquisitions.each do |a|
  acquisition = a.fetch
  sum = acquisition.price.nil? ? 'Unknown amount' : "#{acquisition.price} #{acquisition.price_currency_code}"
  puts "#{acquisition.announced_on.to_s}: #{acquisition.name} (#{sum})"
end

# 2014-07-02: Acquisition (500000000 USD)
# 2014-06-03: Acquisition (Unknown amount)
# 2014-04-24: Acquisition (Unknown amount)
# 2014-03-25: Facebook acquired Oculus VR (2000000000 USD)
# 2014-02-19: Facebook acquired WhatsApp (19000000000 USD)
# 2014-01-13: Facebook acquired Branch (15000000 USD)
# 2014-01-08: Facebook acquired Little Eye Labs (Unknown amount)
# 2013-12-17: Facebook acquired SportStream (Unknown amount)

Notes

Failed requests (such as the ones requesting non-existent entities) will throw Crunchbase::CrunchbaseException.

Ordering

.list methods take an order argument. Valid options are Crunchbase::ORDER_CREATED_AT_DESC (default), Crunchbase::ORDER_CREATED_AT_ASC, Crunchbase::ORDER_UPDATED_AT_DESC and Crunchbase::ORDER_UPDATED_AT_ASC.

Relation objects

.list methods return an array of Relation objects, as do the relationship getters for most individual entities. These are summary objects returned by Crunchbase API, containing type and name of the target entity, along with timestamps. You can retrieve the "full" entity by calling .fetch method on the relation object.

--

Organizations

Organization.get – Retrieve an organization by permalink

Crunchbase::Organization.get(permalink)

Properties: name, permalink, description, short_description, homepage_url, founded_on, is_closed, closed_on, primary_role, total_funding_usd, number_of_investments, number_of_employees, stock_symbol, stock_exchange, role_company, founded_on_trust_code, closed_on_trust_code, headquarters, board_members_and_advisors, categories, current_team, customers, images, investments, members, news, offices, past_team, primary_image, sub_organizations, websites, created_at, updated_at.

Relationships: competitors, funding_rounds, founders, products, acquisitions, ipo.

Organization.list – Retrieves a list of organizations

Crunchbase::Organization.list(page, order)

--

People

Person.get – Retrieve a person profile by permalink

Crunchbase::Person.get(permalink)

Properties: first_name, last_name, permalink, bio, born_on, died_on, is_deceased, location_uuid, created_at, updated_at.

Relationships: founded_companies.

Person.list – Retrieve a list of people

Crunchbase::Person.list(page, order)

--

Products

Product.get – Retrieve product details by permalink

Crunchbase::Product.get(permalink)

Properties: name, permalink, lifecycle_stage, owner_id, launched_on, died_on, created_at, updated_at.

Product.list – Retrieve a list of products

Crunchbase::Product.list(page, order)

--

Funding rounds, Acquisitions and IPOs

FundingRound.get – Retrieve information about funding round by uuid

Crunchbase::FundingRound.get(uuid)

Properties: name, permalink, funding_type, money_raised, money_raised_usd, money_raised_currency_code, announced_on, announced_on_trust_code, canonical_currency_code, series, created_at, updated_at.

Relationships: funded_organization.

Acquisition.get – Retrieve information about acquisition by uuid

Crunchbase::Acquisition.get(uuid)

Properties: name, permalink, acquisition_type, price, price_currency_code, announced_on, disposition_of_acquired, created_at, updated_at.

Relationships: acquirer, acquiree.

Ipo.get – Retrieve information about IPO by uuid

Crunchbase::Ipo.get(uuid)

Properties: name, permalink, opening_share_price, opening_share_price_currency_code, stock_symbol, stock_exchange_symbol, went_public_on, canonical_currency_code, money_raised, money_raised_currency_code, opening_valuation, opening_valueation_currency_code, created_at, updated_at.

Relationships: funded_company.

crunchbase-api's People

Contributors

codacy-badger avatar gsdean avatar russorat avatar sandisk avatar stuartchaney avatar valsavva avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

crunchbase-api's Issues

Example Broken

Currently getting a 301 when implementing the example.

crunchbase-api.rb:42:inrescue in fetch': Failed to fetch`

Crunchbase::Organization.find_all_by_query breaks if company name includes ampersand

Looks like the find_all_by_query function does not correctly handle the ampersand (&) symbol when encoding the url. Maybe try CGI::escape() instead of URI::escape() here?

Crunchbase::Organization.find_all_by_query('Ernst & Young LLP').first
Crunchbase::CrunchbaseException: Failed to fetch https://api.crunchbase.com/v/2/organizations?query=Ernst%20&%20Young%20LLP&page=1&order=created_at%20desc&user_key=xxxxxxxxxxxxxx: Bad Encoding
    from /var/lib/gems/1.9.1/gems/crunchbase-api-0.2.1/lib/crunchbase-api.rb:41:in `rescue in fetch'
    from /var/lib/gems/1.9.1/gems/crunchbase-api-0.2.1/lib/crunchbase-api.rb:32:in `fetch'
    from /var/lib/gems/1.9.1/gems/crunchbase-api-0.2.1/lib/crunchbase-api/entity.rb:20:in `fetch_list'
    from /var/lib/gems/1.9.1/gems/crunchbase-api-0.2.1/lib/crunchbase-api/organization.rb:62:in `find_all_by_query'
    from (irb):20
    from /usr/bin/irb:12:in `<main>'

Person photo

Hi!

When getting a person info, Crunchbase retuns a link to photo as "primary image".
Please see sample response: http://pastie.org/9446102 at line 86.

i'm wondering if you could implement that.

Thanks,
Mark

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.