Socket
Socket
Sign inDemoInstall

bing-api

Package Overview
Dependencies
49
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    bing-api

A library for the Bing Search APIs


Version published
Weekly downloads
2
Maintainers
1
Install size
4.59 MB
Created
Weekly downloads
 

Readme

Source

Bing API Wrapper for Node.js

A very simple wrapper for the Bing API (http://www.bing.com/toolbox/bingdeveloper/). Just simplifies an edge case error check and presents a simple way to set & reuse options.

Usage:

// set BING_APP_ID Environment Variable with a valid key!

var bing = require('../lib/bing-api');
var client = new bing.SearchClient({appId: process.env.BING_APP_ID});
client.search("variolabs", function(error, response, data) {

  if (!error && response.statusCode == 200)
  {
    console.log(data.SearchResponse.Web.Results[0].Url);
  } else {
    console.log("ERROR! " + error + "/" + response.statusCode);
  }

});

Supported options:

/*
 * Should be a space delimited list of valid bing sources:
 * Image, News, PhoneBook, RelatedSearch, Spell, Translation,
 * Video, Web
 */
sourceList: "web"
/*
 * App ID from Bing Dev Portal: http://www.bing.com/toolbox/bingdeveloper/
 */
, appId: null

/*
 * Base URL for API, includes the question mark
 */
, baseUrl: "http://api.bing.net/json.aspx?"

/*
 * API Version
 */
, bingApiVersion: "2.2"

/*
 * Bing API Market
 */
, bingApiMarket: "en-US"

/*
 * Limit responses to this amount
 */
, limit: 10

/*
 * User Agent
 *
 */
, userAgent: "Bing Search Client for Node.js ("+SearchClient.version+")"

License

Provided under the The MIT License (MIT) Copyright (c) 2011 Sujal Shah

See LICENSE for details

FAQs

Last updated on 04 Nov 2011

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc