Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bing-api

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bing-api

A library for the Bing Search APIs

  • 0.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
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

Package last updated on 04 Nov 2011

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc