
Research
Security News
Malicious PyPI Package Exploits Deezer API for Coordinated Music Piracy
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
addsearch-js-client
Advanced tools
AddSearch is a hosted search platform for all your web content. This API Client lets you easily use the AddSearch Search API from your JavaScript code on web browsers or with Node.js.
The library is available on the global CDN jsDelivr:
<script src="https://cdn.jsdelivr.net/npm/addsearch-js-client@0.1/dist/addsearch-js-client.min.js"></script>
To install the library locally or to use it with Node.js:
npm install addsearch-js-client --save
# After installation, add the library to your JS code
# var AddSearchClient = require('addsearch-js-client');
// Create client with your 32-character SITEKEY
var client = new AddSearchClient('YOUR PUBLIC SITEKEY');
// Callback function
var cb = function(res) {
// Print results to console
console.log(res);
}
// Execute search. Callback function cb will be called with search results
client.search('keyword', cb);
The client provides the following functions.
// Search with a specific keyword
client.search('keyword', callback);
// Search with the previously used keyword or execute a "match all" query
client.search(callback);
// Configure Search suggestions on AddSearch Dashboard first
// Get suggestions starting with a specific prefix
client.suggestions('a', callback);
// Enable/disable fuzzy matching used in typo tolerance (default "true")
client.useFuzzyMatch(false);
// Documents in specific language (e.g. "en" or "de")
client.setLanguage('en');
// Documents published between specific date range
client.setDateFilter('2019-01-01', '2019-01-31');
Filter by URL patterns, document types or addsearch-category meta tag values. See the full documentation.
// Only PDF files or products
client.setCategoryFilters('doctype_pdf,products');
Filter by custom fields. Custon fields can be defined in meta tags or AddSearch crawler can pick them up from your HTML or JSON data. See the full documentation.
// Search by specific city (Berlin, Paris or Boston)
client.addCustomFieldFilter('city','berlin');
client.addCustomFieldFilter('city','paris');
client.addCustomFieldFilter('city','boston');
// Remove Paris (Berlin and Boston remaining)
client.removeCustomFieldFilter('city','paris');
// Remove all cities
client.removeCustomFieldFilter('city');
// Defaults: page "1", pageSize "10", sortBy "relevance", sortOrder "desc"
client.setPaging(page, pageSize, sortBy, sortOrder);
// Next {pageSize} results
client.nextPage();
// Previous {pageSize} results
client.previousPage();
The client is tested on
To modify this client library, clone this repository to your computer and execute following commands.
npm install
npm test
npm run build
Built bundle is saved under the dist/ folder
Feel free to send any questions, ideas and suggestions at support@addsearch.com.
FAQs
AddSearch API JavaScript client
The npm package addsearch-js-client receives a total of 1,674 weekly downloads. As such, addsearch-js-client popularity was classified as popular.
We found that addsearch-js-client demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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 researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.
Security News
Newly introduced telemetry in devenv 1.4 sparked a backlash over privacy concerns, leading to the removal of its AI-powered feature after strong community pushback.