Node.js module for the Bing Search API (Cognitive Services)
Find a file
2015-03-08 15:58:22 +01:00
lib Add adult filter option 2015-03-08 15:44:00 +01:00
test Adding test for failure, removing spurious debugger statement. 2014-10-01 12:00:00 -07:00
.gitignore Ignore t.js 2014-09-19 14:22:53 +02:00
Gruntfile.js jshint laxbreak 2014-10-04 23:00:16 +02:00
index.js Git init 2014-09-18 18:24:52 +02:00
LICENSE Add license file 2014-09-19 14:50:37 +02:00
package.json Bump to version 1.0.0 2015-03-08 15:12:26 +01:00
README.md Image filter values 2015-03-08 15:58:22 +01:00

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" });
Bing.web("Pizza", function(error, res, body){
    console.log(body);
  },
  {
    top: 10,  // Number of results (max 50)
    skip: 3   // Skip first 3 results
  });
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'});

Accepted filter values:

  • Size:<Small | Medium | Large>
  • Size:Height:<Height>
  • Size:Width:<Width>
  • Aspect:<Square | Wide | Tall>
  • Color:<Color | Monochrome>
  • Style:<Photo | Graphics>
  • Face:<Face | Portrait | Other>
Specify Market

Getting spanish results:

Bing.images("Ninja Turtles", function(error, res, body){
  console.log(body);
}, {top: 5, market: 'es-ES'});

List of Bing Markets

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