Node.js module for the Bing Search API (Cognitive Services)
lib | ||
test | ||
.gitignore | ||
Gruntfile.js | ||
index.js | ||
LICENSE | ||
package.json | ||
README.md |
Node Bing API
Node.js lib for the Azure Bing Web Search API
Installation
npm install node-bing-api
Usage
Require the library and initialialize it with your account key:
var Bing = require('node-bing-api')({ accKey: "your-account-key" });
Web Search:
Bing.web("Pizza", function(error, res, body){
console.log(body);
},
{
top: 10, // Number of results (max 50)
skip: 3 // Skip first 3 results
});
Images Search:
Bing.images("Ninja Turtles", function(error, res, body){
console.log(body);
}, {skip: 50});
Adding filter(s) for the Image Search
Bing.images("Ninja Turtles", function(error, res, body){
console.log(body);
}, {imagefilters: 'Size:Small+Color:Monochrome'});
Specify Market
Getting spanish results:
Bing.images("Ninja Turtles", function(error, res, body){
console.log(body);
}, {top: 5, market: 'es-ES'});
Adult Filter
Bing.images('Kim Kardashian', function(error, res, body){
console.log(body.d.results);
}, { market: 'en-US', adult: 'Strict'});
Accepted values: "Off", "Moderate", "Strict".
Moderate level should not include results with sexually explicit images or videos, but may include sexually explicit text
License
MIT