node package manager
Stop writing boring code. Discover, share, and reuse within your team. Create a free org »

centralindex

centralindex

Introduction

The centralindex Node.js module is an NPM module that allows Node.js developers to start using the Central Index API with minimal code. The Central Index is a global data exchange, with a simple REST/JSON api.

What do I need before I start?

Hello World

You'll need to install the centralindex module using

  npm install centralindex

Then your first script could look something like:

  // load the centralindex npm module
  var ci = require('centralindex');
  
  // configure your api key
  ci.setAPIKey('<insert api key here>');
    
  // pull a known entity by its unique entity_id
  ci.getEntity('379236608286720', function(error,body) {
    if(!err) {
      console.log(body);
    } else {
      console.log("Something went wrong");
    }
  });
  

You'll find further examples in the "examples" subdirectory.

Function reference

  • getEntity = function(entity_id, callback)
  • getEntitySearchWhatBylocation = function(what, where, per_page, page, country, language, callback)
  • getEntitySearchWhat = function(what, per_page, page, country, language, callback)
  • getEntitySearchWhoBylocation = function(who, where, per_page, page, country, callback)
  • getEntitySearchWho = function(who, per_page, page, country, callback)
  • getEntityAdvertisers = function(tag, where, limit, country, language, callback)
  • getEntityAdd = function(language, callback)
  • getEntityReport = function(entity_id, gen_id, language, callback)
  • getAutocompleteCategory = function(str, language, callback)
  • getAutocompleteLocation = function(str, country, callback)
  • getToolsDocs = function(object, format, callback)

See the API Docs for more information.