Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
bingsearch7-api
Advanced tools
A fork of node-bing-api module for Cognitive Services Bing Search API v7.0
Node.js lib for the Microsoft Cognitive Services Bing Web Search API
A fork of node-bing-api by goferito
All I did was change the endpoint URL to 7.0
npm install bingsearch7-api
Require the library and initialize it with your account key:
var Bing = require('bingsearch7-api')({ accKey: "your-account-key" });
This API provdes callbacks by default, but users of node 8 and newer can make the library return Promises with util.promisify()
. For example, to use Bing.web
:
var util = require('util'),
Bing = require('node-bing-api')({ accKey: 'someKey' }),
searchBing = util.promisify(Bing.web.bind(Bing));
Bing.web("Pizza", {
count: 10, // Number of results (max 50)
offset: 3 // Skip first 3 results
}, function(error, res, body){
// body has more useful information besides web pages
// (image search, related search, news, videos)
// but for this example we are just
// printing the first two web page results
console.log(body.webPages.value[0]);
console.log(body.webPages.value[1]);
});
Bing.composite("Playstation 4 Pro", {
count: 10, // Number of results (max 15 for news, max 50 if other)
offset: 3 // Skip first 3 results
}, function(error, res, body){
console.log(body.news);
});
Bing.news("Anonymous", {
count: 10, // Number of results (max 15)
offset: 3 // Skip first 3 results
}, function(error, res, body){
console.log(body);
});
Bing.video("monkey vs frog", {
count: 10, // Number of results (max 50)
offset: 3 // Skip first 3 result
}, function(error, res, body){
console.log(body);
});
Bing.images("Ninja Turtles", {
count: 15, // Number of results (max 50)
offset: 3 // Skip first 3 result
}, function(error, res, body){
console.log(body);
});
Bing.relatedSearch('berlin'
, { market: 'en-US' }
, (err, res, body) => {
const suggestions = body.relatedSearches.value.map(r => r.displayText)
console.log(suggestions.join('\n'))
})
Bing.spelling('awsome spell', function (err, res, body) {
console.log(body.flaggedTokens.suggestions[0].suggestion); //awesome spell
});
Requires specific Account key
Available Options:
Getting spanish results:
Bing.images("Ninja Turtles"
, {count: 5, market: 'es-ES'}
, function(error, res, body){
console.log(body);
});
Full list of supported markets: es-AR,en-AU,de-AT,nl-BE,fr-BE,pt-BR,en-CA,fr-CA,es-CL,da-DK,fi-FI,fr-FR, de-DE,zh-HK,en-IN,en-ID,en-IE,it-IT,ja-JP,ko-KR,en-MY,es-MX,nl-NL,en-NZ, no-NO,zh-CN,pl-PL,pt-PT,en-PH,ru-RU,ar-SA,en-ZA,es-ES,sv-SE,fr-CH,de-CH, zh-TW,tr-TR,en-GB,en-US,es-US
Bing.images('Kim Kardashian'
, {market: 'en-US', adult: 'Strict'}
, function(error, res, body){
console.log(body.value);
});
Accepted values: "Off", "Moderate", "Strict".
Moderate level should not include results with sexually explicit images or videos, but may include sexually explicit text.
To use this library with a web only subscription, you can require and initialize it with an alternate root url:
var Bing = require('node-bing-api')
({
accKey: "your-account-key",
rootUri: "https://api.datamarket.azure.com/Bing/SearchWeb/v1/"
});
In order to run the tests, the integration tests require to create a secrets.js
file
from the provided secrets.js.example
example, and fill it in with a valid access key.
Then just mocha
.
MIT
FAQs
A fork of node-bing-api module for Cognitive Services Bing Search API v7.0
The npm package bingsearch7-api receives a total of 1 weekly downloads. As such, bingsearch7-api popularity was classified as not popular.
We found that bingsearch7-api demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.