
Security News
ECMAScript 2025 Finalized with Iterator Helpers, Set Methods, RegExp.escape, and More
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
A simple way to access the Webz.io API from your Node.js code
const webzio = require('webzio');
const client = webzio.config({token: 'YOUR_API_KEY'});
client.query('filterWebContent', {q: 'github'})
.then(output => {
console.log(output['posts'][0]['text']); // Print the text of the first post
console.log(output['posts'][0]['published']); // Print the text of the first post publication date
});
// Get the next batch of posts
client.getNext()
.then(output => {
console.log(output['posts'][0]['thread']['site']); // Print the site of the first post
});
To make use of the webz.io API, you need to obtain a token that would be used on every request. To obtain an API key, create an account at https://webz.io/auth/signup, and then go into https://webz.io/dashboard to see your token.
You can install using npm:
$ npm install webzio
To get started, you need to import the library, and set your access token.
(Replace YOUR_API_KEY
with your actual API key).
const webzio = require('webzio');
const client = webzio.config({token: 'YOUR_API_KEY'});
API Endpoints
The first parameter the query()
function accepts is the API endpoint string. Available endpoints:
filterWebContent
- access to the news/blogs/forums/reviews APIproductFilter
- access to data about eCommerce products/servicesdarkFilter
- access to the dark web (coming soon)Now you can make a request and inspect the results:
client.query('filterWebContent', {q: 'github'})
.then(output => {
console.log(output['totalResults']);
// 15565094
console.log(output['posts'].length);
// 100
console.log(output['posts'][0]['language']);
// english
console.log(output['posts'][0]['title']);
// Putting quotes around dictionary keys in JS
});
For your convenience, functions query
and getNext
both return Promise with
one argument - the response JSON, so you can loop over it and get all the results of this batch (up to 100).
client.query('filterWebContent', {q: 'github'})
.then(output => {
let totalWords = output['posts'].reduce((sum, post) => {
return sum + post['text'].split(' ').length}, 0);
console.log(totalWords);
// 8822
});
config({token})
query(end_point_str, params)
getNext()
- a method to fetch the next page of results.
If you want to make repeated searches, performing an action whenever there are new results, use code like this:
const client = webzio.config({token: 'YOUR_API_KEY'});
let r = client.query('filterWebContent', {q: 'github'});
setInterval(() => {
r.then(output => {
output['posts'].map(post => performAction(post));
return client.getNext();
});
}, 300);
FAQs
webz.io client for Node.js
The npm package webzio receives a total of 706 weekly downloads. As such, webzio popularity was classified as not popular.
We found that webzio 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.
Security News
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
Security News
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.
Research
North Korean threat actors linked to the Contagious Interview campaign return with 35 new malicious npm packages using a stealthy multi-stage malware loader.