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?
问问题
185 次
1 回答
0
watson-developer-cloud
您可以使用npm 模块访问所有 Watson 和 Alchemy API 。
安装 npm 模块。
$ npm install watson-developer-cloud
从Bluemix获取 Alchemy API 密钥。
创建一个
test.js
包含以下内容的文件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)); });
于 2015-12-22T14:47:20.390 回答