-1

I've looked in the watson-developer-cloud package and its namesake namespace on GitHub. Will I need to go directly to the REST API in my app?

Termininja
  • 6,620
  • 12
  • 48
  • 49
David Powell
  • 537
  • 1
  • 4
  • 16
  • [Here](http://github.com/watson-developer-cloud/node-sdk/tree/master/services/alchemy_data_news) – 5agado Dec 22 '15 at 14:41

1 Answers1

0

You can access all the Watson and Alchemy APIs using the watson-developer-cloud npm module.

  1. Install the npm module.

    $ npm install watson-developer-cloud
    
  2. Get an Alchemy API key from Bluemix.

  3. Create a test.js file with the content below

    var watson = require('watson-developer-cloud');
    
    var alchemy_data_news = watson.alchemy_data_news({
      api_key: '<api_key>'
    });
    
    var params = {
      start: 'now-1d',
      end: 'now'
    };
    
    alchemy_data_news.getNews(params, function (err, news) {
      if (err)
        console.log('error:', err);
      else
        console.log(JSON.stringify(news, null, 2));
    });
    
German Attanasio
  • 22,217
  • 7
  • 47
  • 63