cbinsights

0.2.11 • Public • Published

cbi-node

Simple module for using CB Insights's API in node.js. Currently this is just a wrapper, but we aim to make it a more full-featured client in the near future.

To use this module you need access to the CB Insights API.

Other API wrappers:

Installation

npm install cbinsights

Usage

The best way is to set the environment variables CBI_API_KEY and CBI_SECRET_KEY to your API key and secret key respectively and do:

var CBInsights = require('cbinsights');
var cbi = new CBInsights();

If you don't want to do that, you can specify your credentials directly like so:

var cbi = new CBInsights({
    apiKey: 'your API Key',
    secretKey: 'your Secret Key'
});

After you've done that, making a request is easy as pie! Here we grab Foursquare's company info:

cbi.sendAuthenticatedRequest('company/info/?names=Foursquare', function (response) {
    console.log(response);
});

This gives you:

[ { address:
     { city: 'New York',
       continent: 'North America',
       country: 'United States',
       fax: null,
       idAddress: 27590,
       idCity: 3033,
       idContinent: 6,
       idCountry: 1,
       idState: 32,
       phone: '346-494-0946',
       state: 'New York',
       street1: '568 Broadway',
       street2: '10th Floor',
       zipCode: '10012' },
    company: 'Foursquare',
    description: 'Foursquare offers an online mobile social networking service which leverages smartphones and GPS as part of a location-based social network that enables users to voluntarily check-in to different venues. By checking into locations, users collect virtual badges which may also enable special deals by the venue to users who are loyal or who avail themselves of a particular promotion.\n\nFoursquare has applications for the iPhone, Android, Blackberry and Windows Mobile.\n\nThe firm was co-founded by Dennis Crowley and Naveen Selvadurai. Crowley formerly co-founded Dodgeball, a concept similar in some ways to Foursquare. Dodgeball was acquired by Google in 2005.\n\nFourSquare API - The Foursquare API was open to a limited number of developers until November 2009 at which time it was opened up to developers. The foursquare API enables developers to build applications that interact with the foursquare platform. Developers can use the API to create new ways to check-in to foursquare or visualize the data generated by the foursquare community. Developers looking to build a simple widget based on their check-in history are not best served by the full API but instead can leverage the Foursquare\'s feeds system. \n\nThe Foursquare API has aided in the company\'s growth and adoption by users as developer apps have lead to greater reach for the company.',
    email: null,
    founded: '2008-11-30',
    geo: null,
    idCompany: 27741,
    idGeo: null,
    mobileapps: [ [Object], [Object] ],
    ownership: 'Private',
    status: 'Alive / Active',
    url: 'foursquare.com' } ]

For more info, check out the CB Insights API Documentation.

Initialization Options

Option Description Default
useSandbox Set to true while you're developing your app to not waste any API credit. false
apiKey Your API key. The environment variable CBI_API_KEY
secretKey Your secret key. The environment variable CBI_SECRET_KEY

License

The MIT License (MIT)

Copyright (c) 2014 CB Insights

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Readme

Keywords

Package Sidebar

Install

npm i cbinsights

Weekly Downloads

0

Version

0.2.11

License

none

Last publish

Collaborators

  • meetparekh09
  • pmallela-cbi
  • zach.muir.cbi
  • joshua.fernandes14
  • aabbi
  • daniel.stillman
  • lyonscbi
  • jefferson.cbi
  • harley.hicks.cbi
  • jalfano
  • mateogo42
  • recheverria-cbi
  • hazel0109
  • gaurav.mahajan
  • brycekjosness
  • eric.ely
  • cbedwinotalvaro
  • nathalia.camacho
  • ayman.salloum
  • jtyson728
  • giovanni.garcia
  • ihernandez-cbi
  • cbi-devops
  • kchun
  • yyan
  • vfong-cbi
  • jnico-cbi
  • mbalady
  • gshen-cbi
  • cliu-cbi
  • tli-cbi
  • mchoe
  • jpeffley-cbi
  • cjlew
  • shajyahya
  • dkeefe
  • rbednarz
  • jbroderick-cbi
  • amatiyev
  • awebb-cbi
  • amestel
  • kchen-cbi
  • kyle.yost
  • tblyler-cbi
  • pcorujo
  • daguilar-cbi
  • jmeli-cbi
  • zstuart-cbi
  • atestu